Skip to content

Summary

A single ~7 MB binary that gives your AI assistant schema discovery, SQL queries and EXPLAIN plans for MySQL, MariaDB, PostgreSQL and SQLite, with a read-only mode.

Features

  • MySQL, MariaDB, PostgreSQL and SQLite from one ~7 MB binary with no runtime dependencies
  • Schema discovery: databases, tables, views, triggers, functions, procedures, materialized views
  • readQuery and explainQuery for data and query-plan inspection
  • Read-only mode hides every write and DDL tool from the model
  • stdio and HTTP transports, with optional bearer-token auth on HTTP
  • CLI flags override environment variables override backend defaults

Installation

Set up this MCP server in your favorite AI agent — copy a ready-made configuration below.

Any MCP-compatible agent

Most agents (Claude, Cursor, Windsurf, VS Code, and more) read a standard mcpServers configuration.

  1. Open your agent's MCP configuration file.
  2. Merge the snippet below into it, filling in the environment variables with your own values.
  3. Restart the agent — the "Database MCP (dbmcp)" tools will be available.
{
  "mcpServers": {
    "haymon-dbmcp": {
      "command": "dbmcp",
      "args": [
        "stdio"
      ],
      "env": {
        "DB_BACKEND": "postgres",
        "DB_HOST": "127.0.0.1",
        "DB_PORT": "5432",
        "DB_USER": "postgres",
        "DB_PASSWORD": "secret",
        "DB_NAME": "mydb"
      }
    }
  }
}

Description

Database MCP, or dbmcp, is a Rust-built MCP server that connects an AI assistant to a SQL database without a Python, Node or Docker runtime. One small binary speaks to MySQL and MariaDB, PostgreSQL and SQLite, so the same setup works whether you are exploring a local SQLite file or a production replica.

The tool set covers the whole inspection loop. Discovery tools list databases, tables, views, triggers, functions, procedures and materialized views (availability varies by backend). readQuery and explainQuery let the model look at data and query plans, while writeQuery plus the DDL tools (createDatabase, dropDatabase, dropTable) are available when you want it to change things. Start the server in read-only mode and the write tools are hidden from the model altogether, which is the safer default for anything that matters.

It runs over stdio, where the client launches and manages the process, or over HTTP with an optional bearer token for remote or multi-client setups. Configuration is layered: CLI flags override environment variables, which override per-backend defaults. Installation is a one-line script on macOS, Linux, WSL and Windows, with Docker and Cargo as alternatives. Released under the MIT licence.

Good fit for developers who want an assistant to explain a schema, draft and sanity-check queries, or review slow-query plans against a real database without handing it a heavyweight toolchain.

Related MCP Servers

MCP: DBHub

by Bytebase

Featured

A universal database MCP server — one integration for PostgreSQL, MySQL, SQL Server, SQLite, and MariaDB.

MCP: PlanetScale

by PlanetScale

PlanetScale's official hosted MCP server — browse organizations, databases and branches, read schema, run guarded SQL, and pull Insights and schema recommendations.

MCP: SQLite

by Model Context Protocol

Query, modify, and analyse a local SQLite database file directly from an AI client.

Browse all MCP servers →