Db Gateway logo

Db Gateway

Connects AI agents to eight database and data systems through 145+ MCP tools, with configurable aliases and read-only mode.

Install Db Gateway

Pick your client, then add it in one click or paste the config.

STDIONode.js
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "db-gateway": {
      "command": "npx",
      "args": [
        "-y",
        "db-gateway"
      ],
      "env": {
        "DBS": "YOUR_VALUE_HERE",
        "MYSQL": "YOUR_VALUE_HERE",
        "POSTGRESQL": "YOUR_VALUE_HERE",
        "REDIS": "YOUR_VALUE_HERE",
        "MONGODB": "YOUR_VALUE_HERE",
        "REDSHIFT": "YOUR_VALUE_HERE",
        "ELASTICSEARCH": "YOUR_VALUE_HERE",
        "KAFKA": "YOUR_VALUE_HERE"
      }
    }
  }
}

Settings → Developer → Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

Values are written into the snippet above so you can paste it as is. They never leave your browser.

Install not yet sandbox-tested— we haven't run this command through our automated sandbox yet. Not a red flag; we're working through the catalog.

Overview

The db-gateway MCP server gives AI agents access to MySQL, PostgreSQL, Redshift, MongoDB, Redis, DynamoDB, Elasticsearch, and Kafka through one MCP configuration. It enables schema discovery, relationship inspection, queries, and engine-specific operations while keeping connection details in the client configuration. Set DBS to control which engines and tools are registered, and use aliases to select among multiple instances. Reach for it when an agent needs to work across different database or data systems, or when production access must be restricted with READ_ONLY=true.

Use cases

  • Query application data across MySQL and PostgreSQL
  • Inspect schemas before generating database queries
  • Separate development and production connections with aliases
  • Expose production data through read-only tools
  • Access Redis, Kafka, or Elasticsearch from one MCP server

Key features

  • 145+ tools across eight data systems
  • Schema and table relationship inspection
  • Alias-based multi-instance connections
  • Engine selection through DBS
  • Read-only mode that hides write tools
  • Node.js and npx-based startup

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked 2d ago

Recent health check succeeded.

7/7 checks healthy over the last 40d

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 10d ago via OSV.dev · db-gateway (npm)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

npm downloads181Package downloads in the last 30 days.
Last commit2mo agoMost recent push to the default branch.
Directory activity1 viewsConfig copies, upvotes, and views on AllMCPs.

How Db Gateway works

What db-gateway does

The db-gateway MCP server exposes database and data-system operations to MCP-compatible AI clients. It supports eight engine categories: MySQL, PostgreSQL, and Redshift for relational workloads; MongoDB, Redis, and DynamoDB for NoSQL; Elasticsearch for search; and Kafka for streaming. The project documents more than 145 tools across these engines.

Agents can inspect database structure before forming requests. A documented workflow uses schema and relationship tools to identify relevant tables and foreign keys, then calls an execution tool to run a query. Connection credentials, hosts, and ports remain in the client configuration; tool calls identify connections through aliases.

How it works

The db-gateway MCP server runs as a Node.js package and can be launched with npx -y db-gateway. It requires Node.js 18 or newer. A client starts the server with a command and environment configuration, then communicates with it over MCP.

DBS selects the engines that are active. Only tools for those engines are registered, so a configuration containing only MySQL does not expose the Redis, Kafka, or other tool groups. Connection strings use an alias query parameter, which is required. Multiple instances of one engine can be separated with semicolons; default=true identifies the instance used when a tool call does not provide an alias.

The server also supports read-only operation. With READ_ONLY=true, write tools are omitted from the tool list, and *_execute_query operations are limited to SELECT-style statements. This allows a separate production registration to expose query access without exposing modification tools.

Setup and configuration

Add the package to an MCP client's server configuration. A minimal setup defines DBS and one connection variable, such as MYSQL or REDIS. Connection formats vary by engine. MySQL, PostgreSQL, Redis, MongoDB, and Redshift use engine-specific URLs; Elasticsearch accepts either its documented URL form or an HTTP(S) endpoint; Kafka accepts one or more brokers in its connection string.

DynamoDB uses separate variables for its region, access key ID, and secret access key rather than the connection-string pattern used by the other engines. The repository's .env.example contains the available options. Credentials should be kept in the client or process environment rather than sent in agent prompts.

Tools and capabilities

Available capabilities depend on the values in DBS. Documented examples include:

  • Reading all schemas from a MySQL environment.
  • Inspecting table relationships and foreign keys.
  • Executing SQL queries, including reads and, when permitted, writes.
  • Returning an insert identifier after a MySQL insert.
  • Addressing development and production instances by alias.
  • Exposing engine-specific tools for relational, NoSQL, search, and streaming systems.

The complete tool set is organized by engine in the repository's tool reference.

Limitations and notes

The db-gateway MCP server does not remove the need to configure network access and valid credentials for each target system. An omitted alias causes that engine's connection to fail, and multiple instances require distinct aliases. Connection pooling and health-check behavior are documented separately; the repository notes that connection limits multiply per session.

Read-only mode is a configuration safeguard, not a description of the underlying database permissions. The target credentials and network policies still determine what the database itself permits.

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Db Gateway

db-gateway is an MCP server that connects AI agents to MySQL, PostgreSQL, Redshift, MongoDB, Redis, DynamoDB, Elasticsearch, and Kafka. Its tools cover schema and relationship inspection, database queries, and engine-specific operations. It uses aliases for connections and can hide write tools when READ_ONLY=true is enabled.

Run it through npx in your MCP client configuration; no separate install step is required. Use the command npx with arguments -y and db-gateway, then define DBS and the connection variables for the engines you want to enable. Node.js 18 or newer is required.

Separate connection strings for the same engine with semicolons and give each one a unique alias. Pass the desired alias to a tool call, and add default=true to the connection that should be selected when no alias is supplied.

Set READ_ONLY=true in the server environment. db-gateway then omits write tools and restricts execute-query tools to SELECT-style statements, so register a production instance with this flag when agents should query but not modify data.

It provides a standard MCP stdio configuration using a command, arguments, and environment variables, so compatibility depends on whether the client supports that MCP server configuration.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewDb Gateway AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/db-gateway?style=directory)](https://allmcps.com/mcp/db-gateway)
HTML Embed
<a href="https://allmcps.com/mcp/db-gateway"><img src="https://allmcps.com/api/badge/db-gateway?style=directory" alt="Db Gateway on AllMCPs" /></a>