io.github.sijunkim/db-gateway
145+ tools across 8 databases: MySQL, PostgreSQL, Redshift, MongoDB, Redis, Kafka, and more
Installation
Ajoutez ceci à la configuration MCP de votre client (Claude Desktop : claude_desktop_config.json ; Cursor : .cursor/mcp.json ; VS Code et les autres utilisent la même forme « mcpServers »).
db-gatewayclaude mcp add db-gateway -e 'DBS=<DBS>' -e 'READ_ONLY=<READ_ONLY>' -e 'MYSQL=<your mysql>' -e 'POSTGRESQL=<your postgresql>' -e 'REDSHIFT=<your redshift>' -e 'MONGODB=<your mongodb>' -e 'REDIS=<your redis>' -e 'ELASTICSEARCH=<your elasticsearch>' -e 'KAFKA=<your kafka>' -e 'DYNAMODB_REGION=<DYNAMODB_REGION>' -e 'DYNAMODB_ACCESS_KEY_ID=<your dynamodb_access_key_id>' -e 'DYNAMODB_SECRET_ACCESS_KEY=<your dynamodb_secret_access_key>' -- npx -y db-gateway@1.0.4
{
"mcpServers": {
"db-gateway": {
"command": "npx",
"args": [
"-y",
"db-gateway@1.0.4"
],
"env": {
"DBS": "<DBS>",
"READ_ONLY": "<READ_ONLY>",
"MYSQL": "<your mysql>",
"POSTGRESQL": "<your postgresql>",
"REDSHIFT": "<your redshift>",
"MONGODB": "<your mongodb>",
"REDIS": "<your redis>",
"ELASTICSEARCH": "<your elasticsearch>",
"KAFKA": "<your kafka>",
"DYNAMODB_REGION": "<DYNAMODB_REGION>",
"DYNAMODB_ACCESS_KEY_ID": "<your dynamodb_access_key_id>",
"DYNAMODB_SECRET_ACCESS_KEY": "<your dynamodb_secret_access_key>"
}
}
}
}
Variables d'environnement
DBSobligatoire Engines to enable, comma-separated. Only the listed engines get their tools registered. Example: mysql,redis,kafkaREAD_ONLYSet to true to hide every write tool and restrict *_execute_query to SELECT-style statements. Recommended when pointing at production.MYSQLsecret MySQL connection string(s), semicolon-separated for multiple instances. Format: mysql://<user>:<password>@<host>:3306/<database>?alias=dev&default=true — alias is required.POSTGRESQLsecret PostgreSQL connection string(s), semicolon-separated. Format: postgresql://<user>:<password>@<host>:5432/<database>?alias=dev&ssl=true — alias is required.REDSHIFTsecret Redshift connection string(s), semicolon-separated. Format: redshift://<user>:<password>@<host>:5439/<database>?alias=dev&ssl=true — alias is required.MONGODBsecret MongoDB connection string(s), semicolon-separated. Format: mongodb://<user>:<password>@<host>:27017/<database>?alias=dev — alias is required.REDISsecret Redis connection string(s), semicolon-separated. Format: redis://:<password>@<host>:6379/0?alias=dev — leave the password empty for a no-auth instance. alias is required.ELASTICSEARCHsecret Elasticsearch connection string(s), semicolon-separated. Format: elasticsearch://<user>:<password>@<host>:9200?alias=dev, or http(s)://<host>:9200?alias=dev for no auth. alias is required.KAFKAsecret Kafka connection string(s), semicolon-separated. Format: kafka://<user>:<password>@<broker1>:9092,<broker2>:9092?alias=dev&mechanism=plain — alias is required.DYNAMODB_REGIONAWS region for DynamoDB. DynamoDB is configured with discrete variables instead of a connection string.DYNAMODB_ACCESS_KEY_IDsecret AWS access key ID for DynamoDB.DYNAMODB_SECRET_ACCESS_KEYsecret AWS secret access key for DynamoDB.
Documentation
Tirée du README du projet sur GitHub, actualisée chaque semaine. Les liens ouvrent GitHub.
Sommaire
DB Gateway MCP Server
English | 한국어
An MCP server that gives AI agents direct access to your databases — 145+ tools across 8 engines.
The point is that the agent reads your schema itself instead of you pasting DDL into a prompt:
You: "Find users who signed up last month and never placed an order"
1. mysql_get_all_schemas → reads every table definition
2. mysql_get_table_relationships → finds the users ↔ orders foreign key
3. mysql_execute_query → runs the LEFT JOIN
Why db-gateway?
Most database MCP servers cover one engine, or a handful of relational ones. If your stack is MySQL for the app, Redshift for analytics, Redis for cache, and Kafka for events, that means four servers with four different config styles.
This is one server, one config block:
| Engines | Tools | |
|---|---|---|
| Relational | MySQL, PostgreSQL, Redshift | 59 |
| NoSQL | MongoDB, Redis, DynamoDB | 48 |
| Search | Elasticsearch | 19 |
| Streaming | Kafka | 19 |
DBS decides which of them are enabled — only those tools get registered, so a MySQL-only setup stays a MySQL-only tool list.
See It Work
Every screenshot below is one real session against a development MySQL database holding 249 rows — unedited output, not mock data. The agent calls a single tool, mysql_execute_query, and never sees a host, port, or password: those stay in the client config, and the agent only ever names the alias.
Point the same server at production with READ_ONLY=true and steps 2 through 4 simply do not exist — the write tools are never registered, so the agent cannot see them to call them.
Quick Start
Requires Node.js 18+. Register it with your MCP client — no install step:
{
"mcpServers": {
"db-gateway": {
"command": "npx",
"args": ["-y", "db-gateway"],
"env": {
"DBS": "mysql,redis",
"MYSQL": "mysql://<user>:<password>@<host>:3306/<database>?alias=dev&default=true",
"REDIS": "redis://:@<host>:6379/0?alias=dev&default=true"
}
}
}
}
DBS decides which engines are enabled — only those tools get registered.
Connection strings
One string per engine. Semicolons separate multiple instances.
| Variable | Format |
|---|---|
MYSQL | mysql://<user>:<password>@<host>:<port>/<db>?alias=name |
POSTGRESQL | postgresql://<user>:<password>@<host>:<port>/<db>?alias=name&ssl=true |
REDIS | redis://:<password>@<host>:<port>/<db-index>?alias=name |
MONGODB | mongodb://<user>:<password>@<host>:<port>/<db>?alias=name |
REDSHIFT | redshift://<user>:<password>@<host>:<port>/<db>?alias=name&ssl=true |
ELASTICSEARCH | elasticsearch://<user>:<password>@<host>:<port>?alias=name, or http(s)://<host>:<port>?alias=name |
KAFKA | kafka://<user>:<password>@<broker>:<port>,<broker2>:<port>?alias=name&mechanism=plain |
aliasis required. It is how tools address a specific instance — omit it and that engine fails to connect.
Several instances of the same engine — separate their connection strings with a semicolon. The agent picks one by passing an alias argument to any tool; default=true marks the one used when no alias is given:
MYSQL="mysql://<user>:<password>@<dev-host>:3306/<db>?alias=dev&default=true;mysql://<user>:<password>@<prod-host>:3306/<db>?alias=prod"
DynamoDB is the exception — it takes DYNAMODB_REGION, DYNAMODB_ACCESS_KEY_ID, and DYNAMODB_SECRET_ACCESS_KEY instead. See .env.example for every option.
Read-Only Mode
READ_ONLY=true hides write tools from the tool list entirely and restricts *_execute_query to SELECT-style statements.
Register production as a second MCP server with this flag on. The agent then cannot modify production data — the write tools do not exist as far as it can see.
"db-gateway-prod": {
"command": "npx",
"args": ["-y", "db-gateway"],
"env": { "READ_ONLY": "true", "DBS": "mysql", "MYSQL": "..." }
}
Documentation
- Tool Reference — all 145+ tools, by engine
- Connection Management — pooling, health checks, and why
connectionLimitmultiplies per session - Deployment — SSE mode, Nginx, PM2, sharing one gateway across a team
License
MIT
Questions fréquentes
Qu'est-ce que io.github.sijunkim/db-gateway ?
145+ tools across 8 databases: MySQL, PostgreSQL, Redshift, MongoDB, Redis, Kafka, and more
Comment installer io.github.sijunkim/db-gateway ?
Il s'exécute sur votre machine. Dans Claude Code : claude mcp add db-gateway -e 'DBS=<DBS>' -e 'READ_ONLY=<READ_ONLY>' -e 'MYSQL=<your mysql>' -e 'POSTGRESQL=<your postgresql>' -e 'REDSHIFT=<your redshift>' -e 'MONGODB=<your mongodb>' -e 'REDIS=<your redis>' -e 'ELASTICSEARCH=<your elasticsearch>' -e 'KAFKA=<your kafka>' -e 'DYNAMODB_REGION=<DYNAMODB_REGION>' -e 'DYNAMODB_ACCESS_KEY_ID=<your dynamodb_access_key_id>' -e 'DYNAMODB_SECRET_ACCESS_KEY=<your dynamodb_secret_access_key>' -- npx -y db-gateway@1.0.4. Pour les autres clients, collez la configuration JSON de cette page dans leurs réglages MCP.
Faut-il une clé API pour io.github.sijunkim/db-gateway ?
Oui. Il attend DBS, MYSQL, POSTGRESQL, REDSHIFT, MONGODB, REDIS, ELASTICSEARCH, KAFKA, DYNAMODB_ACCESS_KEY_ID, DYNAMODB_SECRET_ACCESS_KEY, à renseigner dans sa configuration.
io.github.sijunkim/db-gateway est-il open source ?
Oui. Son code est sur GitHub sous licence MIT.
Qui maintient io.github.sijunkim/db-gateway ?
Il est publié par sijunkim. AI.tn le référence sans le maintenir ni le recommander.
Issu du registre MCP officiel. Être listé n'est pas une recommandation : vérifiez le code et les permissions d'un serveur avant de lui donner accès à vos données.