CentralMind Gateway MCP
A Go MCP server and REST API for databases: PostgreSQL, MySQL, ClickHouse, Snowflake, BigQuery and more, with personal data masking and a cache
- 548 ★ on the repository
- Last commit
- Apache-2.0
Broad access
Why this level
- Connects to a database with a login and password string and hands table data to the agent
- In raw mode it runs the submitted SQL without a read-only check, and the database account sets the rights
- While creating methods it sends the schema and sample rows to a third-party model provider
Install
- Works in
Manual install
docker run --platform linux/amd64 -p 9090:9090 ghcr.io/centralmind/gateway:v0.2.18 start --connection-string "postgres://db-user:db-password@db-host/db-name?sslmode=require"Starts MCP over SSE on port 9090 and a REST API with Swagger. Replace the connection string with your own.
Access and checks
How we reviewBroad accessThe tool can change data, run commands or handle secrets.
- Connects to a database with a login and password string and hands table data to the agent
- In raw mode it runs the submitted SQL without a read-only check, and the database account sets the rights
- While creating methods it sends the schema and sample rows to a third-party model provider
This is third-party code. Review the repository files before installing.
What it does
Gateway is a single Go binary that connects to a database and gives it to an agent over MCP (stdio and SSE) and, at the same time, as a REST API with Swagger and an OpenAPI 3.1 spec. It supports PostgreSQL, MySQL, ClickHouse, Snowflake, MSSQL, BigQuery, Oracle, SQLite, DuckDB, MongoDB, Elasticsearch, Neon and Supabase. It runs in two modes. In raw mode the agent gets four tools: `list_tables`, `discover_data` with sample rows from chosen tables, `prepare_query`, which checks a query and shows the answer columns, and `query`. In the other mode the `discover` command first sends the schema and data samples to a model (OpenAI, Anthropic, Amazon Bedrock, Gemini or Vertex AI) and saves a set of named methods with ready SQL in `gateway.yaml`. The agent calls those methods instead of writing queries itself. Plugins sit between the database and the answer: personal data removal with regular expressions or Microsoft Presidio, Lua row-level access scripts, an LRU cache, API keys, OAuth and trace export to `OpenTelemetry`.
Who it is for. For developers and analysts who want to give an agent in Cursor or Claude Desktop access to a working database and limit what sensitive columns and rows it returns.
Good fit when
- An agent has to ask questions of a warehouse such as Snowflake or BigQuery and get answers from real tables
- Answers must not show phone numbers, emails or other personal data, and it has to be scrubbed before it reaches the model
- The same database must be served to an agent over MCP and to an application over REST with Swagger docs
- The agent should see only an agreed set of methods with ready SQL instead of writing arbitrary queries
Not a fit when
- You need a PostgreSQL-only server with index tuning and query plans: postgres-mcp covers that
- You need writes and data changes through ready methods: insert and update support is on the authors' roadmap
- You need one server for many databases with a read-only mode and an SSH tunnel: the dbhub entry describes that role
- You do not want to send the schema and sample rows to a third-party model provider while generating methods
Example request
Check which tables the orders database has and show the ten customers with the largest purchases this month, without phone numbers or emailsMCP
- Transport
- stdio, sse
- Authentication
- key is optional
Environment variables
GEMINI_API_KEYsecret- Model provider key for the `discover` command, shown here for Gemini
Limitations
The latest release, v0.2.19, came out in July 2025, while the documentation examples name the v0.2.18 image. License Apache-2.0.
The `discover` command sends the chosen model provider table names, column names and sample rows, and it needs that provider's key, for example `GEMINI_API_KEY`. Answers to the agent's queries are not passed to the model; it takes part only while `gateway.yaml` is created.
In raw mode the `query` handler passes the SQL string to the connector as is, and it shows no read-only restriction. Write and delete rights come from the database account, so give it a read-only role.
Personal data masking is turned on by a plugin in the config; without it answers reach the agent in full.
How to disable. Remove the `gateway` block from the Cursor or Claude Desktop config and stop the container with `docker stop`. Then revoke the database account rights you gave the server.
FAQ
How do I start Gateway with one command?
Docker and a connection string are enough: `docker run --platform linux/amd64 -p 9090:9090 ghcr.io/centralmind/gateway:v0.2.18 start --connection-string "postgres://db-user:db-password@db-host/db-name?sslmode=require"`. The log then shows the MCP SSE address `http://localhost:9090/sse` and the REST API with Swagger at `http://localhost:9090/`.
How does raw mode differ from the mode with ready methods?
In raw mode the agent browses tables, sample rows and writes SQL itself through four tools. In the other mode the `discover` command builds a `gateway.yaml` with named methods in advance, and the agent calls only those.
Which model providers can generate the methods?
OpenAI and compatible ones, Anthropic, Amazon Bedrock, Google Gemini and Google Vertex AI with Anthropic models. The documentation describes a free tier for Gemini through Google AI Studio, and local models connect through a configurable endpoint.
How do I strip personal data from answers?
Turn on the `pii_remover` plugin with regular expressions or `presidio_anonymizer` built on Microsoft Presidio. Rows can also be filtered with Lua scripts in the `lua_rls` plugin.
How do I connect Gateway to Cursor?
The repository has an install button for Cursor: it adds a server that runs `docker run -i` with the Gateway image and the `--connection-string` and `start stdio` arguments. Replace the connection string with your own.
What security plugins exist for API access?
API keys and OAuth for sign-in, Lua scripts for row-level access and `OpenTelemetry` for a call trace. They are enabled in the YAML config.
Discussion
No questions or reviews yet.
Related
MCP serverspgEdge Postgres MCP
pgEdge Postgres MCP Server
Postgres MCP in Go with read-mode queries, EXPLAIN plans, semantic search, several databases and a ready chat client and web interface
An MCP server for PostgreSQL with several databases at once, table descriptions from the catalog, PostGIS and pgvector hints and query plans
Google's open-source MCP server for databases: ready tools for Postgres, MySQL, BigQuery, Spanner and more, plus custom tools in tools.yaml
DB MCP Server
db-mcp-server
An MCP server for several databases with protection: a read-only mode per database and a row limit. Written in Go, launched in Docker
Postgres MCP (Microsoft)
Postgres MCP Server (Microsoft)
Postgres MCP from Microsoft: connection profiles with passwords in the OS keyring, Entra ID sign-in for Azure, queries, schema, CSV and server metrics
A SQLite-based SQL engine with plugins for apps, databases and files: the anyquery mcp command exposes that data to Claude, Cursor and other MCP clients
Comparison with similar tools
Entries that share the main search query, and how they differ.
| Entry | Official | Authentication | Repository stars | Main difference |
|---|---|---|---|---|
| CentralMind Gateway (this entry) | no | key is optional | 548 | |
| DBHub | no | not required | 3,703 | one server for several databases with a read-only mode and an SSH tunnel, with no model-generated methods |
| MCP Toolbox for Databases | yes | not required | 16,705 | Google's Go server with prebuilt sets for different databases and custom tools in a tools.yaml file |
README in short
The repository has a step-by-step example: starting the container, the log output with MCP and REST addresses, then generating `gateway.yaml` with `discover` and a prompt for the model, plus a walk through the file structure. It goes on to cover running from a binary and through Docker Compose, connecting to Claude Desktop and links to the documentation, connectors and plugins. Sources live in `connectors`, `plugins`, `server` and `mcpgenerator`, examples in `example`, including Kubernetes manifests and sample PostgreSQL schemas.