Back to Browse

Db Gateway MCP Server

Developer ToolsUse Caution3.2MCP RegistryLocal
Free

Server data from the Official MCP Registry

145+ tools across 8 databases: MySQL, PostgreSQL, Redshift, MongoDB, Redis, Kafka, and more

About

145+ tools across 8 databases: MySQL, PostgreSQL, Redshift, MongoDB, Redis, Kafka, and more

Security Report

3.2
Use Caution3.2High Risk

This MCP server provides database gateway functionality across 8 engines with 145+ tools. While the architecture demonstrates good connection pool management and error handling, critical security vulnerabilities exist: SQL injection risks from unparameterized queries in multiple locations (copyFromS3, unloadToS3, getSchema), exposure of sensitive credentials in connection strings via environment variables without encryption, and overly broad permissions that enable data destruction (TRUNCATE, DROP) without read-only enforcement. The server permits arbitrary SQL execution which, combined with credentials embedded in env vars, creates significant risk in multi-user environments. Supply chain analysis found 4 known vulnerabilities in dependencies (0 critical, 3 high severity). Package verification found 1 issue.

4 files analyzed · 19 issues found

Security scores are indicators to help you make informed decisions, not guarantees. Always review permissions before connecting any MCP server.

Permissions Required

This plugin requests these system permissions. Most are normal for its category.

HTTP Network Access

Connects to external APIs or services over the internet.

env_vars

Check that this permission is expected for this type of plugin.

File System Read

Reads files on your machine. Normal for tools that analyze or process local data.

database

Check that this permission is expected for this type of plugin.

process_spawn

Check that this permission is expected for this type of plugin.

What You'll Need

Set these up before or after installing:

Engines to enable, comma-separated. Only the listed engines get their tools registered. Example: mysql,redis,kafkaOptional

Environment variable: DBS

Set to true to hide every write tool and restrict *_execute_query to SELECT-style statements. Recommended when pointing at production.Optional

Environment variable: READ_ONLY

MySQL connection string(s), semicolon-separated for multiple instances. Format: mysql://<user>:<password>@<host>:3306/<database>?alias=dev&default=true — alias is required.Required

Environment variable: MYSQL

PostgreSQL connection string(s), semicolon-separated. Format: postgresql://<user>:<password>@<host>:5432/<database>?alias=dev&ssl=true — alias is required.Required

Environment variable: POSTGRESQL

Redshift connection string(s), semicolon-separated. Format: redshift://<user>:<password>@<host>:5439/<database>?alias=dev&ssl=true — alias is required.Required

Environment variable: REDSHIFT

MongoDB connection string(s), semicolon-separated. Format: mongodb://<user>:<password>@<host>:27017/<database>?alias=dev — alias is required.Required

Environment variable: MONGODB

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.Required

Environment variable: REDIS

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.Required

Environment variable: ELASTICSEARCH

Kafka connection string(s), semicolon-separated. Format: kafka://<user>:<password>@<broker1>:9092,<broker2>:9092?alias=dev&mechanism=plain — alias is required.Required

Environment variable: KAFKA

AWS region for DynamoDB. DynamoDB is configured with discrete variables instead of a connection string.Optional

Environment variable: DYNAMODB_REGION

AWS access key ID for DynamoDB.Required

Environment variable: DYNAMODB_ACCESS_KEY_ID

AWS secret access key for DynamoDB.Required

Environment variable: DYNAMODB_SECRET_ACCESS_KEY

How to Install

Add this to your MCP configuration file:

{
  "mcpServers": {
    "io-github-sijunkim-db-gateway": {
      "env": {
        "DBS": "your-dbs-here",
        "KAFKA": "your-kafka-here",
        "MYSQL": "your-mysql-here",
        "REDIS": "your-redis-here",
        "MONGODB": "your-mongodb-here",
        "REDSHIFT": "your-redshift-here",
        "READ_ONLY": "your-read-only-here",
        "POSTGRESQL": "your-postgresql-here",
        "ELASTICSEARCH": "your-elasticsearch-here",
        "DYNAMODB_REGION": "your-dynamodb-region-here",
        "DYNAMODB_ACCESS_KEY_ID": "your-dynamodb-access-key-id-here",
        "DYNAMODB_SECRET_ACCESS_KEY": "your-dynamodb-secret-access-key-here"
      },
      "args": [
        "-y",
        "db-gateway"
      ],
      "command": "npx"
    }
  }
}

Documentation

View on GitHub

From the project's GitHub README.

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
EngineToolsEngineTools
MySQL16Redis21
PostgreSQL16DynamoDB13
Redshift27Elasticsearch19
MongoDB14Kafka19

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.

VariableFormat
MYSQLmysql://<user>:<password>@<host>:<port>/<db>?alias=name
POSTGRESQLpostgresql://<user>:<password>@<host>:<port>/<db>?alias=name&ssl=true
REDISredis://:<password>@<host>:<port>/<db-index>?alias=name
MONGODBmongodb://<user>:<password>@<host>:<port>/<db>?alias=name
REDSHIFTredshift://<user>:<password>@<host>:<port>/<db>?alias=name&ssl=true
ELASTICSEARCHelasticsearch://<user>:<password>@<host>:<port>?alias=name, or http(s)://<host>:<port>?alias=name
KAFKAkafka://<user>:<password>@<broker>:<port>,<broker2>:<port>?alias=name&mechanism=plain

alias is 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

License

MIT

Reviews

No reviews yet

Be the first to review this server!