Skip to content
MCP server

Db Gateway

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

Runs locallyStatus and history
Install
Pricing
Open source
Runs
Locally
Version
1.0.4
Listing updated
4 days ago

About Db Gateway

Db Gateway is an open-source MCP server for databases. It runs locally on your machine and is started by your AI client.

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

Install

Run in a terminal

claude mcp add db-gateway --env DBS='<DBS>' --env MYSQL='<MYSQL>' --env POSTGRESQL='<POSTGRESQL>' --env REDSHIFT='<REDSHIFT>' --env MONGODB='<MONGODB>' --env REDIS='<REDIS>' --env ELASTICSEARCH='<ELASTICSEARCH>' --env KAFKA='<KAFKA>' --env DYNAMODB_ACCESS_KEY_ID='<DYNAMODB_ACCESS_KEY_ID>' --env DYNAMODB_SECRET_ACCESS_KEY='<DYNAMODB_SECRET_ACCESS_KEY>' -- npx -y db-gateway

Add to claude_desktop_config.json

{
  "mcpServers": {
    "db-gateway": {
      "command": "npx",
      "args": [
        "-y",
        "db-gateway"
      ],
      "env": {
        "DBS": "<DBS>",
        "MYSQL": "<MYSQL>",
        "POSTGRESQL": "<POSTGRESQL>",
        "REDSHIFT": "<REDSHIFT>",
        "MONGODB": "<MONGODB>",
        "REDIS": "<REDIS>",
        "ELASTICSEARCH": "<ELASTICSEARCH>",
        "KAFKA": "<KAFKA>",
        "DYNAMODB_ACCESS_KEY_ID": "<DYNAMODB_ACCESS_KEY_ID>",
        "DYNAMODB_SECRET_ACCESS_KEY": "<DYNAMODB_SECRET_ACCESS_KEY>"
      }
    }
  }
}

Add to ~/.cursor/mcp.json

{
  "mcpServers": {
    "db-gateway": {
      "command": "npx",
      "args": [
        "-y",
        "db-gateway"
      ],
      "env": {
        "DBS": "<DBS>",
        "MYSQL": "<MYSQL>",
        "POSTGRESQL": "<POSTGRESQL>",
        "REDSHIFT": "<REDSHIFT>",
        "MONGODB": "<MONGODB>",
        "REDIS": "<REDIS>",
        "ELASTICSEARCH": "<ELASTICSEARCH>",
        "KAFKA": "<KAFKA>",
        "DYNAMODB_ACCESS_KEY_ID": "<DYNAMODB_ACCESS_KEY_ID>",
        "DYNAMODB_SECRET_ACCESS_KEY": "<DYNAMODB_SECRET_ACCESS_KEY>"
      }
    }
  }
}

Add to .vscode/mcp.json

{
  "servers": {
    "db-gateway": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "db-gateway"
      ],
      "env": {
        "DBS": "<DBS>",
        "MYSQL": "<MYSQL>",
        "POSTGRESQL": "<POSTGRESQL>",
        "REDSHIFT": "<REDSHIFT>",
        "MONGODB": "<MONGODB>",
        "REDIS": "<REDIS>",
        "ELASTICSEARCH": "<ELASTICSEARCH>",
        "KAFKA": "<KAFKA>",
        "DYNAMODB_ACCESS_KEY_ID": "<DYNAMODB_ACCESS_KEY_ID>",
        "DYNAMODB_SECRET_ACCESS_KEY": "<DYNAMODB_SECRET_ACCESS_KEY>"
      }
    }
  }
}

Add to ~/.codeium/windsurf/mcp_config.json

{
  "mcpServers": {
    "db-gateway": {
      "command": "npx",
      "args": [
        "-y",
        "db-gateway"
      ],
      "env": {
        "DBS": "<DBS>",
        "MYSQL": "<MYSQL>",
        "POSTGRESQL": "<POSTGRESQL>",
        "REDSHIFT": "<REDSHIFT>",
        "MONGODB": "<MONGODB>",
        "REDIS": "<REDIS>",
        "ELASTICSEARCH": "<ELASTICSEARCH>",
        "KAFKA": "<KAFKA>",
        "DYNAMODB_ACCESS_KEY_ID": "<DYNAMODB_ACCESS_KEY_ID>",
        "DYNAMODB_SECRET_ACCESS_KEY": "<DYNAMODB_SECRET_ACCESS_KEY>"
      }
    }
  }
}

Add to your client's MCP settings (most use this shape)

{
  "mcpServers": {
    "db-gateway": {
      "command": "npx",
      "args": [
        "-y",
        "db-gateway"
      ],
      "env": {
        "DBS": "<DBS>",
        "MYSQL": "<MYSQL>",
        "POSTGRESQL": "<POSTGRESQL>",
        "REDSHIFT": "<REDSHIFT>",
        "MONGODB": "<MONGODB>",
        "REDIS": "<REDIS>",
        "ELASTICSEARCH": "<ELASTICSEARCH>",
        "KAFKA": "<KAFKA>",
        "DYNAMODB_ACCESS_KEY_ID": "<DYNAMODB_ACCESS_KEY_ID>",
        "DYNAMODB_SECRET_ACCESS_KEY": "<DYNAMODB_SECRET_ACCESS_KEY>"
      }
    }
  }
}

Configuration

  • DBSEngines to enable, comma-separated. Only the listed engines get their tools registered. Example: mysql,redis,kafkaRequired
  • READ_ONLYSet to true to hide every write tool and restrict *_execute_query to SELECT-style statements. Recommended when pointing at production.
  • MYSQLMySQL connection string(s), semicolon-separated for multiple instances. Format: mysql://<user>:<password>@<host>:3306/<database>?alias=dev&default=true — alias is required.
  • POSTGRESQLPostgreSQL connection string(s), semicolon-separated. Format: postgresql://<user>:<password>@<host>:5432/<database>?alias=dev&ssl=true — alias is required.
  • REDSHIFTRedshift connection string(s), semicolon-separated. Format: redshift://<user>:<password>@<host>:5439/<database>?alias=dev&ssl=true — alias is required.
  • MONGODBMongoDB connection string(s), semicolon-separated. Format: mongodb://<user>:<password>@<host>:27017/<database>?alias=dev — alias is required.
  • REDISRedis 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.
  • ELASTICSEARCHElasticsearch 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.
  • KAFKAKafka 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_IDAWS access key ID for DynamoDB.
  • DYNAMODB_SECRET_ACCESS_KEYAWS secret access key for DynamoDB.

Pricing

Open source

Db Gateway FAQ

Is Db Gateway free?

Yes. Db Gateway is open source, so you can use and self-host it for free.

How do I add Db Gateway to Claude Code?

Run this command in your terminal: claude mcp add db-gateway --env DBS='<DBS>' --env MYSQL='<MYSQL>' --env POSTGRESQL='<POSTGRESQL>' --env REDSHIFT='<REDSHIFT>' --env MONGODB='<MONGODB>' --env REDIS='<REDIS>' --env ELASTICSEARCH='<ELASTICSEARCH>' --env KAFKA='<KAFKA>' --env DYNAMODB_ACCESS_KEY_ID='<DYNAMODB_ACCESS_KEY_ID>' --env DYNAMODB_SECRET_ACCESS_KEY='<DYNAMODB_SECRET_ACCESS_KEY>' -- npx -y db-gateway

What are the best alternatives to Db Gateway?

The closest alternatives to Db Gateway are Midplane, PlatypusDB, Lorebase, Sovaria and model2data studio.

Alternatives to Db Gateway

  1. Midplane

    MCP server

    Postgres gateway for AI agents with table grants, column masking and approval for writes

    Runs locally
    • Open source
    • 5 GitHub stars
    • Databases
  2. PlatypusDB

    MCP server

    Gives MCP clients access to your PlatypusDB database connections, scoped per agent

    Runs locally
    • Open source
    • Databases
  3. Lorebase

    MCP server

    Lets agents read and change a governed, versioned Postgres knowledge graph

    Runs locally
    • Open source
    • Knowledge and memory
  4. Sovaria

    MCP server

    Manage a Sovaria backend (Postgres, auth, storage, functions) from an AI assistant

    Not checked yet
    • 4 tools
    • Remote
    • Freemium
    • Databases
  5. Generate realistic connected test data, dbt projects and dashboards from a schema

    • Remote
    • Freemium
    • Databases
  6. semlayer

    MCP server

    Infers a semantic layer from your data warehouse and serves it to agents

    Runs locally
    • Free
    • Databases