Centralmind (Database Gateway) MCP server

Database integration with security and compliance. Supports: PostgreSQL, MySQL, ClickHouse, Snowflake, MSSQL, BigQuery, Oracle Database, SQLite, ElasticSearch and DuckDB.
Back to servers
Setup instructions
Provider
CentralMind
Release date
Mar 13, 2025
Language
Go
Stats
428 stars

CentralMind Gateway is a powerful tool that allows you to create API or MCP servers that expose your database to AI agents in minutes. It automatically generates AI-optimized APIs for your structured data, supporting multiple protocols and database systems.

Installation

Docker Installation (Recommended)

The quickest way to get started is using Docker:

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"

After running this command, you'll have access to:

Using Docker Compose

For a more structured setup, you can use Docker Compose:

docker compose -f ./example/simple/docker-compose.yml up

Manual Installation

If you prefer to build from source:

# Clone the repository
git clone https://github.com/centralmind/gateway.git

# Navigate to project directory
cd gateway

# Install dependencies
go mod download

# Build the project
go build .

Generating an API

Gateway uses LLM models to generate your API configuration. Here's how to set it up:

1. Configure an AI Provider

Gateway supports multiple AI providers. For example, to use Google Gemini (which offers a free tier):

export GEMINI_API_KEY='yourkey'

You can get an API key from Google AI Studio.

2. Run Discovery Command

Use the discovery command to analyze your database and generate an API:

./gateway discover \
  --ai-provider gemini \
  --connection-string "postgresql://user:[email protected]/dbname?sslmode=require" \
  --prompt "Generate for me awesome readonly API"

3. Review Generated Configuration

The discovery process will create a gateway.yaml file with your API configuration:

api:
  name: Awesome Readonly API
  description: ''
  version: '1.0'
database:
  type: postgres
  connection: YOUR_CONNECTION_INFO
  tables:
    - name: payment_dim
      # Table details and endpoints configuration

Using the Gateway

Starting the Server

Once you have your configuration file, start the server:

./gateway start --config gateway.yaml

Integrating with AI Tools

MCP Protocol for AI Agents

To add Gateway as an MCP Tool to Claude Desktop, adjust Claude's config:

{
  "mcpServers": {
    "gateway": {
      "command": "PATH_TO_GATEWAY_BINARY",
      "args": ["start", "--config", "PATH_TO_GATEWAY_YAML_CONFIG", "mcp-stdio"]
    }
  }
}

Using with Cursor

You can connect Gateway to Cursor and other MCP-compatible tools:

  1. Start your Gateway server
  2. Configure the MCP connection in your AI tool pointing to the SSE endpoint
  3. The AI can now directly query your database through the Gateway

Supported Databases

Gateway supports multiple database systems:

  • PostgreSQL
  • MySQL
  • ClickHouse
  • Snowflake
  • Microsoft SQL Server
  • BigQuery
  • Oracle Database
  • SQLite
  • ElasticSearch

Security Features

Gateway includes several security features:

  • Authentication with API keys and OAuth
  • PII protection with regex or Microsoft Presidio plugins
  • Row-Level Security (RLS) using Lua scripts
  • Comprehensive monitoring with OpenTelemetry
  • Caching strategies for performance optimization

For detailed documentation, visit docs.centralmind.ai.

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "gateway" '{"command":"docker","args":["run","-i","--platform","linux/amd64","ghcr.io/centralmind/gateway:v0.2.18","--connection-string","postgresql://my_user:my_pass@localhost:5432/mydb","start","stdio"]}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "gateway": {
            "command": "docker",
            "args": [
                "run",
                "-i",
                "--platform",
                "linux/amd64",
                "ghcr.io/centralmind/gateway:v0.2.18",
                "--connection-string",
                "postgresql://my_user:my_pass@localhost:5432/mydb",
                "start",
                "stdio"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "gateway": {
            "command": "docker",
            "args": [
                "run",
                "-i",
                "--platform",
                "linux/amd64",
                "ghcr.io/centralmind/gateway:v0.2.18",
                "--connection-string",
                "postgresql://my_user:my_pass@localhost:5432/mydb",
                "start",
                "stdio"
            ]
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later