Skip to content
Back to search

gateway

Universal MCP-Server for your Databases optimized for LLMs and AI-Agents.

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/centralmind--gateway/badge.svg)](/listings/centralmind--gateway)

HTML

<a href="/listings/centralmind--gateway"><img src="/api/listings/centralmind--gateway/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 261 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. <div align="center">
  2. ![Build Binaries](https://github.com/centralmind/gateway/actions/workflows/build-binaries.yml/badge.svg) &nbsp; <a href="https://discord.gg/XFhaUG4F5x"><img src="https://dcbadge.limes.pink/api/server/https://discord.gg/XFhaUG4F5x" height="20"></a> &nbsp;&nbsp;<a href="https://t.me/+TM3T1SikjzA4ZWVi"><img src="https://img.shields.io/badge/telegram-%E2%9D%A4%EF%B8%8F-252850?style=plastic&logo=telegram" height=20></a> &nbsp;&nbsp; <a href="https://docs.centralmind.ai"><img src="https://img.shields.io/badge/Full%20Documentation-blue?style=for-the-badge&logo=rocket&logoColor=white" height="20"></a>&nbsp;&nbsp; <a href="https://cursor.com/install-mcp?name=CentralMind%20Database%20Gateway&config=eyJjb21tYW5kIjoiZG9ja2VyIHJ1biAtaSAtLXBsYXRmb3JtIGxpbnV4L2FtZDY0IGdoY3IuaW8vY2VudHJhbG1pbmQvZ2F0ZXdheTp2MC4yLjE4IC0tY29ubmVjdGlvbi1zdHJpbmcgcG9zdGdyZXNxbDovL215X3VzZXI6bXlfcGFzc0Bsb2NhbGhvc3Q6NTQzMi9teWRiIHN0YXJ0IHN0ZGlvIn0%3D"><img height="21" src="https://cursor.com/deeplink/mcp-install-dark.svg"></a>
  3. </div>
  4. <h2 align="center">CentralMind Gateway: Create API or MCP Server in Minutes</h2>
  5. 🚀 Interactive Demo avialable here: https://centralmind.ai
  6. ## What is Centralmind/Gateway
  7. Simple way to expose your database to AI-Agent via MCP or OpenAPI 3.1 protocols.
  8. ```bash
  9. docker run --platform linux/amd64 -p 9090:9090 \
  10. ghcr.io/centralmind/gateway:v0.2.18 start \
  11. --connection-string "postgres://db-user:db-password@db-host/db-name?sslmode=require"
  12. ```
  13. This will run for you an API:
  14. ```shell
  15. INFO Gateway server started successfully!
  16. INFO MCP SSE server for AI agents is running at: http://localhost:9090/sse
  17. INFO REST API with Swagger UI is available at: http://localhost:9090/
  18. ```
  19. Which you can use inside your AI Agent:
  20. ![mcp-raw-cursor-setup.png](./assets/mcp-raw-cursor-setup.png)
  21. Gateway will generate AI optimized API.
  22. ## Why Centralmind/Gateway
  23. AI agents and LLM-powered applications need fast, secure access to data. We're building an API layer that automatically generates secure, LLM-optimized APIs for your structured data.
  24. - Quickly start with MCP or OpenAPI, or use Direct/Raw SQL APIs
  25. - Filters out PII and sensitive data to ensure compliance with GDPR, CPRA, SOC 2, and other regulations
  26. - Adds traceability and auditing capabilities, ensuring AI applications aren't black boxes and allowing security teams to maintain control
  27. - Optimized for AI workloads: supports the Model Context Protocol (MCP) with enhanced metadata to help AI agents understand APIs, along with built-in caching and security features
  28. It can be useful during development, when an LLM needs to create, adjust, or query data from your database.
  29. In analytical scenarios, it enables you to chat with your database or data warehouse.
  30. Enrich your AI agents with data from your database using remote function/tool calling.
  31. ![demo](/assets/demo.gif)
  32. ## Features
  33. - ⚡ **Automatic API Generation** – Creates APIs automatically using LLM based on table schema and sampled data
  34. - 🗄️ **Structured Database Support** – Supports <a href="https://docs.centralmind.ai/connectors/postgres/">PostgreSQL</a>, <a href="https://docs.centralmind.ai/connectors/mysql/">MySQL</a>, <a href="https://docs.centralmind.ai/connectors/clickhouse/">ClickHouse</a>, <a href="https://docs.centralmind.ai/connectors/snowflake/">Snowflake</a>, <a href="https://docs.centralmind.ai/connectors/mssql/">MSSQL</a>, <a href="https://docs.centralmind.ai/connectors/bigquery/">BigQuery</a>, <a href="https://docs.centralmind.ai/connectors/oracle/">Oracle Database</a>, <a href="https://docs.centralmind.ai/connectors/sqlite/">SQLite</a>, <a href="https://docs.centralmind.ai/connectors/sqlite/">ElasticSearch</a>
  35. - 🌍 **Multiple Protocol Support** – Provides APIs as REST or MCP Server including SSE mode
  36. - 🔐 **Authentication Options** – Built-in support for <a href="https://docs.centralmind.ai/plugins/api_keys/">API keys</a> and <a href="https://docs.centralmind.ai/plugins/oauth/">OAuth</a>
  37. - 🔒 **PII Protection** – Implements <a href="https://docs.centralmind.ai/plugins/pii_remover/">regex plugin</a> or <a href="https://docs.centralmind.ai/plugins/presidio_anonymizer/">Microsoft Presidio plugin</a> for PII and sensitive data redaction
  38. - 👀 **Comprehensive Monitoring** – Integration with <a href="https://docs.centralmind.ai/plugins/otel/">OpenTelemetry (OTel)</a> for request tracking and audit trails
  39. - 📦 **Local & On-Premises** – Support for <a href="https://docs.centralmind.ai/providers/local-models/">self-hosted LLMs</a> through configurable AI endpoints and models
  40. - 🤖 **Multiple AI Providers Support** - Support for [OpenAI](https://docs.centralmind.ai/providers/openai), [Anthropic](https://docs.centralmind.ai/providers/anthropic), [Amazon Bedrock](https://docs.centralmind.ai/providers/bedrock), [Google Gemini](https://docs.centralmind.ai/providers/gemini) & [Google VertexAI](https://docs.centralmind.ai/providers/anthropic-vertexai)
  41. - ⚡ **Flexible Configuration** – Easily extensible via YAML configuration and plugin system
  42. - 📜 **API Documentation** – Auto-generated Swagger documentation and OpenAPI 3.1.0 specification
  43. - 🔑 **Row-Level Security (RLS)** – Fine-grained data access control using <a href="https://docs.centralmind.ai/plugins/lua_rls/">Lua scripts</a>
  44. - 🏎️ **Performance Optimization** – Implements time-based and <a href="https://docs.centralmind.ai/plugins/lru_cache/">LRU caching</a> strategies
  45. ## How it Works
  46. <div align="center">
  47. ![img.png](assets/diagram.png)
  48. </div>
  49. ### 1. Connect & Discover
  50. Gateway connects to your structured databases like PostgreSQL and automatically analyzes the schema and data samples
  51. to generate an optimized API structure based on your prompt. LLM is used only on discovery stage to produce API configuration.
  52. The tool uses [AI Providers](https://docs.centralmind.ai/providers) to generate the API configuration while ensuring security
  53. through PII detection.
  54. ### 2. Deploy
  55. Gateway supports multiple deployment options from standalone binary, docker or <a href="https://docs.centralmind.ai/example/k8s/">Kubernetes</a>.
  56. Check our <a href="https://docs.centralmind.ai/docs/content/getting-started/launching-api/">launching guide</a> for detailed
  57. instructions. The system uses YAML configuration and plugins for easy customization.
  58. ### 3. Use & Integrate
  59. Access your data through REST APIs or Model Context Protocol (MCP) with built-in security features.
  60. Gateway seamlessly integrates with AI models and applications like <a href="https://docs.centralmind.ai/docs/content/integration/langchain/">LangChain</a>,
  61. <a href="https://docs.centralmind.ai/docs/content/integration/chatgpt/">OpenAI</a> and
  62. <a href="https://docs.centralmind.ai/docs/content/integration/claude-desktop/">Claude Desktop</a> using function calling
  63. or <a href="https://docs.centralmind.ai/docs/content/integration/cursor/">Cursor</a> through MCP. You can also <a href="https://docs.centralmind.ai/plugins/otel/">setup telemetry</a> to local or remote destination in otel format.
  64. ## Documentation
  65. ### Getting Started
  66. - <a href="https://docs.centralmind.ai/docs/content/getting-started/quickstart/">Quickstart Guide</a>
  67. - <a href="https://docs.centralmind.ai/docs/content/getting-started/installation/">Installation Instructions</a>
  68. - <a href="https://docs.centralmind.ai/docs/content/getting-started/generating-api/">API Generation Guide</a>
  69. - <a href="https://docs.centralmind.ai/docs/content/getting-started/launching-api/">API Launch Guide</a>
  70. ### Additional Resources
  71. - <a href="https://docs.centralmind.ai/docs/content/integration/chatgpt/">ChatGPT Integration Guide</a>
  72. - <a href="https://docs.centralmind.ai/connectors/">Database Connector Documentation</a>
  73. - <a href="https://docs.centralmind.ai/plugins/">Plugin Documentation</a>
  74. ## How to Build
  75. ```shell
  76. # Clone the repository
  77. git clone https://github.com/centralmind/gateway.git
  78. # Navigate to project directory
  79. cd gateway
  80. # Install dependencies
  81. go mod download
  82. # Build the project
  83. go build .
  84. ```
  85. ## API Generation
  86. Gateway uses LLM models to generate your API configuration. Follow these steps:
  87. Choose one of our supported AI providers:
  88. - [OpenAI](https://docs.centralmind.ai/providers/openai) and all OpenAI-compatible providers
  89. - [Anthropic](https://docs.centralmind.ai/providers/anthropic)
  90. - [Amazon Bedrock](https://docs.centralmind.ai/providers/bedrock)
  91. - [Google Vertex AI (Anthropic)](https://docs.centralmind.ai/providers/anthropic-vertexai)
  92. - [Google Gemini](https://docs.centralmind.ai/providers/gemini)
  93. Google Gemini provides a generous **free tier**. You can obtain an API key by visiting Google AI Studio:
  94. - [Google AI Studio](https://aistudio.google.com/apikey)
  95. Once logged in, you can create an API key in the API section of AI Studio. The free tier includes a generous monthly token allocation, making it accessible for development and testing purposes.
  96. Configure AI provider authorization. For Google Gemini, set an API key.
  97. ```bash
  98. export GEMINI_API_KEY='yourkey'
  99. ```
  100. 2. Run the discovery command:
  101. ```shell
  102. ./gateway discover \
  103. --ai-provider gemini \
  104. --connection-string "postgresql://neondb_owner:MY_PASSWORD@MY_HOST.neon.tech/neondb?sslmode=require" \
  105. --prompt "Generate for me awesome readonly API"
  106. ```
  107. 3. Enjoy the generation process:
  108. ```shell
  109. INFO 🚀 API Discovery Process
  110. INFO Step 1: Read configs
  111. INFO ✅ Step 1 completed. Done.
  112. INFO Step 2: Discover data
  113. INFO Discovered Tables:
  114. INFO - payment_dim: 3 columns, 39 rows
  115. INFO - fact_table: 9 columns, 1000000 rows
  116. INFO ✅ Step 2 completed. Done.
  117. # Additional steps and output...
  118. INFO ✅ All steps completed. Done.
  119. INFO --- Execution Statistics ---
  120. INFO Total time taken: 1m10s
  121. INFO Tokens used: 16543 (Estimated cost: $0.0616)
  122. INFO Tables processed: 6
  123. INFO API methods created: 18
  124. INFO Total number of columns with PII data: 2
  125. ```
  126. 4. Review the generated configuration in `gateway.yaml`:
  127. ```yaml
  128. api:
  129. name: Awesome Readonly API
  130. description: ''
  131. version: '1.0'
  132. database:
  133. type: postgres
  134. connection: YOUR_CONNECTION_INFO
  135. tables:
  136. - name: payment_dim
  137. columns: # Table columns
  138. endpoints:
  139. - http_method: GET
  140. http_path: /some_path
  141. mcp_method: some_method
  142. summary: Some readable summary
  143. description: 'Some description'
  144. query: SQL Query with params
  145. params: # Query parameters
  146. ```
  147. ## Running the API
  148. ### Run locally
  149. ```shell
  150. ./gateway start --config gateway.yaml
  151. ```
  152. ### Docker Compose
  153. ```shell
  154. docker compose -f ./example/simple/docker-compose.yml up
  155. ```
  156. ### MCP Protocol Integration
  157. Gateway implements the MCP protocol for seamless integration with Claude and other tools. For detailed setup instructions, see our <a href="https://docs.centralmind.ai/docs/content/integration/claude-desktop/">Claude integration guide</a>.
  158. To add MCP Tool to Claude Desktop just adjust Claude's config :
  159. ```json
  160. {
  161. "mcpServers": {
  162. "gateway": {
  163. "command": "PATH_TO_GATEWAY_BINARY",
  164. "args": ["start", "--config", "PATH_TO_GATEWAY_YAML_CONFIG", "mcp-stdio"]
  165. }
  166. }
  167. }
  168. ```
  169. ## Roadmap
  170. It is always subject to change, and the roadmap will highly depend on user feedback. At this moment,
  171. we are planning the following features:
  172. #### Database and Connectivity
  173. - 🗄️ **Extended Database Integrations** - Databricks, Redshift, S3 (Iceberg and Parquet), Oracle DB, Microsoft SQL Server, Elasticsearch
  174. - 🔑 **SSH tunneling** - ability to use jumphost or ssh bastion to tunnel connections
  175. #### Enhanced Functionality
  176. - 🔍 **Advanced Query Capabilities** - Complex filtering syntax and Aggregation functions as parameters
  177. - 🔐 **Enhanced MCP Security** - API key and OAuth authentication
  178. #### Platform Improvements
  179. - 📦 **Schema Management** - Automated schema evolution and API versioning
  180. - 🚦 **Advanced Traffic Management** - Intelligent rate limiting, Request throttling
  181. - ✍️ **Write Operations Support** - Insert, Update operations
  182. ## Database Gateway in MCP Registries
  183. - https://mcpreview.com/mcp-servers/centralmind/gateway
  184. - https://mcp.so/server/gateway/centralmind
  185. - https://smithery.ai/server/@centralmind/gateway
  186. - https://www.pulsemcp.com/servers/centralmind-database-gateway

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.