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.
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:
For a more structured setup, you can use Docker Compose:
docker compose -f ./example/simple/docker-compose.yml up
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 .
Gateway uses LLM models to generate your API configuration. Here's how to set it up:
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.
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"
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
Once you have your configuration file, start the server:
./gateway start --config gateway.yaml
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"]
}
}
}
You can connect Gateway to Cursor and other MCP-compatible tools:
Gateway supports multiple database systems:
Gateway includes several security features:
For detailed documentation, visit docs.centralmind.ai.
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.
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.
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"
]
}
}
}
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.
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.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.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