{"id":25929488,"url":"https://github.com/centralmind/gateway","last_synced_at":"2025-04-05T22:03:29.795Z","repository":{"id":280357597,"uuid":"930532297","full_name":"centralmind/gateway","owner":"centralmind","description":"MCP-Server from your Database optimized for LLMs and AI-Agents.","archived":false,"fork":false,"pushed_at":"2025-04-01T16:38:52.000Z","size":94578,"stargazers_count":192,"open_issues_count":8,"forks_count":15,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-04-01T16:52:40.277Z","etag":null,"topics":["amazon-bedrock","anthropic-claude","api","automatic-api","clickhouse","elasticsearch","golang","google-vertex-ai","llm","mcp","mysql-database","openai","oracle-database","postgresql","rest-api","snowflake","supabase"],"latest_commit_sha":null,"homepage":"https://centralmind.ai","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/centralmind.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-02-10T19:34:14.000Z","updated_at":"2025-04-01T16:38:56.000Z","dependencies_parsed_at":"2025-04-01T16:43:40.511Z","dependency_job_id":"25d67113-ed15-4e0c-ba61-b94aa6b14c4b","html_url":"https://github.com/centralmind/gateway","commit_stats":null,"previous_names":["centralmind/gateway"],"tags_count":31,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/centralmind%2Fgateway","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/centralmind%2Fgateway/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/centralmind%2Fgateway/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/centralmind%2Fgateway/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/centralmind","download_url":"https://codeload.github.com/centralmind/gateway/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247406084,"owners_count":20933803,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["amazon-bedrock","anthropic-claude","api","automatic-api","clickhouse","elasticsearch","golang","google-vertex-ai","llm","mcp","mysql-database","openai","oracle-database","postgresql","rest-api","snowflake","supabase"],"created_at":"2025-03-03T22:07:32.951Z","updated_at":"2025-04-05T22:03:29.769Z","avatar_url":"https://github.com/centralmind.png","language":"Go","funding_links":[],"categories":["Databases","MCP Middleware \u0026 Orchestration","[Model Context Protocol](https://modelcontextprotocol.io/introduction)","Frameworks","📚 Projects (1974 total)","MCP 服务器精选列表","پیاده‌سازی‌های سرور","📦 Other","AI Services","API generators","💻 \u003ca name=\"development-tools\"\u003e\u003c/a\u003eDevelopment Tools","NLP","APIs and HTTP Requests","Table of Contents","カテゴリ","Tools","MCP Servers","UIs","MCP Servers \u0026 Protocol","Server Implementations"],"sub_categories":["Multi-Database Tools","Multi-modal","How to Submit","MCP Servers","🗄️ 数据库交互","🗄️ \u003ca name=\"databases\"\u003e\u003c/a\u003eپایگاه‌های داده","AI Services","🗄️ \u003ca name=\"database--sql\"\u003e\u003c/a\u003eデータベース・SQL","Databases","CHUI(Chat-based User Interface) or CHUBACA(Chat-Based Client:)","🗄️ \u003ca name=\"databases\"\u003e\u003c/a\u003eDatabases"],"readme":"\u003cdiv align=\"center\"\u003e\n\n![Build Binaries](https://github.com/centralmind/gateway/actions/workflows/build-binaries.yml/badge.svg) \u0026nbsp; \u003ca href=\"https://discord.gg/XFhaUG4F5x\"\u003e\u003cimg src=\"https://dcbadge.limes.pink/api/server/https://discord.gg/XFhaUG4F5x\" height=\"20\"\u003e\u003c/a\u003e \u0026nbsp;\u0026nbsp;\u003ca href=\"https://t.me/+TM3T1SikjzA4ZWVi\"\u003e\u003cimg src=\"https://img.shields.io/badge/telegram-%E2%9D%A4%EF%B8%8F-252850?style=plastic\u0026logo=telegram\" height=20\u003e\u003c/a\u003e \u0026nbsp;\u0026nbsp; \u003ca href=\"https://docs.centralmind.ai\"\u003e\u003cimg src=\"https://img.shields.io/badge/Full%20Documentation-blue?style=for-the-badge\u0026logo=rocket\u0026logoColor=white\" height=\"20\"\u003e\u003c/a\u003e\n\n\u003c/div\u003e\n\n\n\u003ch2 align=\"center\"\u003eCentralMind Gateway: Create API or MCP Server in Minutes\u003c/h2\u003e\n\n\n🚀 Interactive Demo via GitHub Codespaces\n\n[![Deploy with GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/centralmind/sample_databases)\n\n## What is Centralmind/Gateway\n\nSimple way to expose your database to AI-Agent via MCP or OpenAPI 3.1 protocols.\n\n```bash\ndocker run --platform linux/amd64 -p 9090:9090 \\\n  ghcr.io/centralmind/gateway:v0.2.6 start \\\n  --connection-string \"postgres://db-user:db-password@db-host/db-name?sslmode=require\"\n```\n\nThis will run for you an API:\n\n```shell\nINFO Gateway server started successfully!         \nINFO MCP SSE server for AI agents is running at: http://localhost:9090/sse \nINFO REST API with Swagger UI is available at: http://localhost:9090/ \n```\n\nWhich you can use inside your AI Agent:\n\n![mcp-raw-cursor-setup.png](./assets/mcp-raw-cursor-setup.png)\n\nGateway will generate AI optimized API.\n\n\n## Why Centralmind/Gateway\n\nAI agents and LLM-powered applications need fast, secure access to data, but traditional APIs and databases aren't built for this purpose. We're building an API layer that automatically generates secure, LLM-optimized APIs for your structured data.\n\nOur solution:\n\n- Filters out PII and sensitive data to ensure compliance with GDPR, CPRA, SOC 2, and other regulations\n- Adds traceability and auditing capabilities, ensuring AI applications aren't black boxes and security teams maintain control\n- Optimizes for AI workloads, supporting Model Context Protocol (MCP) with enhanced meta information to help AI agents understand APIs, along with built-in caching and security features\n\nOur primary users are companies deploying AI agents for customer support, analytics, where they need models to access the data without direct SQL access to databases elemenating security, compliance and peformance risks.\n\n![demo](/assets/demo.gif)\n\n## Features\n\n- ⚡ **Automatic API Generation** – Creates APIs automatically using LLM based on table schema and sampled data\n- 🗄️ **Structured Database Support** – Supports \u003ca href=\"https://docs.centralmind.ai/connectors/postgres/\"\u003ePostgreSQL\u003c/a\u003e, \u003ca href=\"https://docs.centralmind.ai/connectors/mysql/\"\u003eMySQL\u003c/a\u003e, \u003ca href=\"https://docs.centralmind.ai/connectors/clickhouse/\"\u003eClickHouse\u003c/a\u003e, \u003ca href=\"https://docs.centralmind.ai/connectors/snowflake/\"\u003eSnowflake\u003c/a\u003e, \u003ca href=\"https://docs.centralmind.ai/connectors/mssql/\"\u003eMSSQL\u003c/a\u003e, \u003ca href=\"https://docs.centralmind.ai/connectors/bigquery/\"\u003eBigQuery\u003c/a\u003e, \u003ca href=\"https://docs.centralmind.ai/connectors/oracle/\"\u003eOracle Database\u003c/a\u003e, \u003ca href=\"https://docs.centralmind.ai/connectors/sqlite/\"\u003eSQLite\u003c/a\u003e, \u003ca href=\"https://docs.centralmind.ai/connectors/sqlite/\"\u003eElasticSearch\u003c/a\u003e\n- 🌍 **Multiple Protocol Support** – Provides APIs as REST or MCP Server including SSE mode\n- 📜 **API Documentation** – Auto-generated Swagger documentation and OpenAPI 3.1.0 specification\n- 🔒 **PII Protection** – Implements \u003ca href=\"https://docs.centralmind.ai/plugins/pii_remover/\"\u003eregex plugin\u003c/a\u003e or \u003ca href=\"https://docs.centralmind.ai/plugins/presidio_anonymizer/\"\u003eMicrosoft Presidio plugin\u003c/a\u003e for PII and sensitive data redaction\n- ⚡ **Flexible Configuration** – Easily extensible via YAML configuration and plugin system\n- 🐳 **Deployment Options** – Run as a binary or Docker container with ready-to-use \u003ca href=\"https://docs.centralmind.ai/helm/gateway/\"\u003eHelm chart\u003c/a\u003e\n- 🤖 **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) \u0026 [Google VertexAI](https://docs.centralmind.ai/providers/anthropic-vertexai)\n- 📦 **Local \u0026 On-Premises** – Support for \u003ca href=\"https://docs.centralmind.ai/providers/local-models/\"\u003eself-hosted LLMs\u003c/a\u003e through configurable AI endpoints and models\n- 🔑 **Row-Level Security (RLS)** – Fine-grained data access control using \u003ca href=\"https://docs.centralmind.ai/plugins/lua_rls/\"\u003eLua scripts\u003c/a\u003e\n- 🔐 **Authentication Options** – Built-in support for \u003ca href=\"https://docs.centralmind.ai/plugins/api_keys/\"\u003eAPI keys\u003c/a\u003e and \u003ca href=\"https://docs.centralmind.ai/plugins/oauth/\"\u003eOAuth\u003c/a\u003e\n- 👀 **Comprehensive Monitoring** – Integration with \u003ca href=\"https://docs.centralmind.ai/plugins/otel/\"\u003eOpenTelemetry (OTel)\u003c/a\u003e for request tracking and audit trails\n- 🏎️ **Performance Optimization** – Implements time-based and \u003ca href=\"https://docs.centralmind.ai/plugins/lru_cache/\"\u003eLRU caching\u003c/a\u003e strategies\n\n## How it Works\n\n\u003cdiv align=\"center\"\u003e\n\n![img.png](assets/diagram.png)\n\n\u003c/div\u003e\n\n### 1. Connect \u0026 Discover\n\nGateway connects to your structured databases like PostgreSQL and automatically analyzes the schema and data samples\nto generate an optimized API structure based on your prompt. LLM is used only on discovery stage to produce API configuration.\nThe tool uses [AI Providers](https://docs.centralmind.ai/providers) to generate the API configuration while ensuring security\nthrough PII detection.\n\n### 2. Deploy\n\nGateway supports multiple deployment options from standalone binary, docker or \u003ca href=\"https://docs.centralmind.ai/example/k8s/\"\u003eKubernetes\u003c/a\u003e.\nCheck our \u003ca href=\"https://docs.centralmind.ai/docs/content/getting-started/launching-api/\"\u003elaunching guide\u003c/a\u003e for detailed\ninstructions. The system uses YAML configuration and plugins for easy customization.\n\n### 3. Use \u0026 Integrate\n\nAccess your data through REST APIs or Model Context Protocol (MCP) with built-in security features.\nGateway seamlessly integrates with AI models and applications like \u003ca href=\"https://docs.centralmind.ai/docs/content/integration/langchain/\"\u003eLangChain\u003c/a\u003e,\n\u003ca href=\"https://docs.centralmind.ai/docs/content/integration/chatgpt/\"\u003eOpenAI\u003c/a\u003e and\n\u003ca href=\"https://docs.centralmind.ai/docs/content/integration/claude-desktop/\"\u003eClaude Desktop\u003c/a\u003e using function calling\nor \u003ca href=\"https://docs.centralmind.ai/docs/content/integration/cursor/\"\u003eCursor\u003c/a\u003e through MCP. You can also \u003ca href=\"https://docs.centralmind.ai/plugins/otel/\"\u003esetup telemetry\u003c/a\u003e to local or remote destination in otel format.\n\n## Documentation\n\n### Getting Started\n\n- \u003ca href=\"https://docs.centralmind.ai/docs/content/getting-started/quickstart/\"\u003eQuickstart Guide\u003c/a\u003e\n- \u003ca href=\"https://docs.centralmind.ai/docs/content/getting-started/installation/\"\u003eInstallation Instructions\u003c/a\u003e\n- \u003ca href=\"https://docs.centralmind.ai/docs/content/getting-started/generating-api/\"\u003eAPI Generation Guide\u003c/a\u003e\n- \u003ca href=\"https://docs.centralmind.ai/docs/content/getting-started/launching-api/\"\u003eAPI Launch Guide\u003c/a\u003e\n\n### Additional Resources\n\n- \u003ca href=\"https://docs.centralmind.ai/docs/content/integration/chatgpt/\"\u003eChatGPT Integration Guide\u003c/a\u003e\n- \u003ca href=\"https://docs.centralmind.ai/connectors/\"\u003eDatabase Connector Documentation\u003c/a\u003e\n- \u003ca href=\"https://docs.centralmind.ai/plugins/\"\u003ePlugin Documentation\u003c/a\u003e\n\n## How to Build\n\n```shell\n# Clone the repository\ngit clone https://github.com/centralmind/gateway.git\n\n# Navigate to project directory\ncd gateway\n\n# Install dependencies\ngo mod download\n\n# Build the project\ngo build .\n```\n\n## API Generation\n\nGateway uses LLM models to generate your API configuration. Follow these steps:\n\n\n1. Choose one of our supported AI providers:\n\n- [OpenAI](https://docs.centralmind.ai/providers/openai) and all OpenAI-compatible providers\n- [Anthropic](https://docs.centralmind.ai/providers/anthropic)\n- [Amazon Bedrock](https://docs.centralmind.ai/providers/bedrock)\n- [Google Vertex AI (Anthropic)](https://docs.centralmind.ai/providers/anthropic-vertexai)\n- [Google Gemini](https://docs.centralmind.ai/providers/gemini)\n\n[Google Gemini](https://docs.centralmind.ai/providers/gemini) provides a generous **free tier**. You can obtain an API key by visiting Google AI Studio:\n\n- [Google AI Studio](https://aistudio.google.com/apikey)\n\nOnce 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.\n\nConfigure AI provider authorization. For Google Gemini, set an API key.\n\n```bash\nexport GEMINI_API_KEY='yourkey'\n```\n\n2. Run the discovery command:\n\n```shell\n./gateway discover \\\n  --ai-provider gemini \\\n  --connection-string \"postgresql://neondb_owner:MY_PASSWORD@MY_HOST.neon.tech/neondb?sslmode=require\" \\\n  --prompt \"Generate for me awesome readonly API\"\n```\n\n3. Monitor the generation process:\n\n```shell\nINFO 🚀 API Discovery Process\nINFO Step 1: Read configs\nINFO ✅ Step 1 completed. Done.\n\nINFO Step 2: Discover data\nINFO Discovered Tables:\nINFO   - payment_dim: 3 columns, 39 rows\nINFO   - fact_table: 9 columns, 1000000 rows\nINFO ✅ Step 2 completed. Done.\n\n# Additional steps and output...\n\nINFO ✅ All steps completed. Done.\n\nINFO --- Execution Statistics ---\nINFO Total time taken: 1m10s\nINFO Tokens used: 16543 (Estimated cost: $0.0616)\nINFO Tables processed: 6\nINFO API methods created: 18\nINFO Total number of columns with PII data: 2\n```\n\n4. Review the generated configuration in `gateway.yaml`:\n\n```yaml\napi:\n  name: Awesome Readonly API\n  description: ''\n  version: '1.0'\ndatabase:\n  type: postgres\n  connection: YOUR_CONNECTION_INFO\n  tables:\n    - name: payment_dim\n      columns: # Table columns\n      endpoints:\n        - http_method: GET\n          http_path: /some_path\n          mcp_method: some_method\n          summary: Some readable summary\n          description: 'Some description'\n          query: SQL Query with params\n          params: # Query parameters\n```\n\n## Running the API\n\n### Run locally\n\n```shell\n./gateway start --config gateway.yaml rest\n```\n\n### Docker Compose\n\n```shell\ndocker compose -f ./example/simple/docker-compose.yml up\n```\n\n### MCP Protocol Integration\n\nGateway implements the MCP protocol for seamless integration with Claude and other tools. For detailed setup instructions, see our \u003ca href=\"https://docs.centralmind.ai/docs/content/integration/claude-desktop/\"\u003eClaude integration guide\u003c/a\u003e.\n\n1. Build the gateway binary:\n\n```shell\ngo build .\n```\n\n2. Configure Claude Desktop tool configuration:\n\n```json\n{\n  \"mcpServers\": {\n    \"gateway\": {\n      \"command\": \"PATH_TO_GATEWAY_BINARY\",\n      \"args\": [\"start\", \"--config\", \"PATH_TO_GATEWAY_YAML_CONFIG\", \"mcp-stdio\"]\n    }\n  }\n}\n```\n\n## Roadmap\n\nIt is always subject to change, and the roadmap will highly depend on user feedback. At this moment,\nwe are planning the following features:\n\n#### Database and Connectivity\n\n- 🗄️ **Extended Database Integrations** - Redshift, S3 (Iceberg and Parquet), Oracle DB, Microsoft SQL Server, Elasticsearch\n- 🔑 **SSH tunneling** - ability to use jumphost or ssh bastion to tunnel connections\n\n#### Enhanced Functionality\n\n- 🔍 **Advanced Query Capabilities** - Complex filtering syntax and Aggregation functions as parameters\n- 🔐 **Enhanced MCP Security** - API key and OAuth authentication\n\n#### Platform Improvements\n\n- 📦 **Schema Management** - Automated schema evolution and API versioning\n- 🚦 **Advanced Traffic Management** - Intelligent rate limiting, Request throttling\n- ✍️ **Write Operations Support** - Insert, Update operations\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcentralmind%2Fgateway","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcentralmind%2Fgateway","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcentralmind%2Fgateway/lists"}