Dbmcp MCP Server

Database MCP server for MySQL, MariaDB, PostgreSQL & SQLite

Local serverstdioPython

What is the Dbmcp MCP server?

Database MCP server for MySQL, MariaDB, PostgreSQL & SQLite. That is what the dbmcp mcp server brings to an AI assistant: the same capability, reachable through the Model Context Protocol rather than a separate app or dashboard.

The short version

A single-binary MCP server for SQL databases. Connect your AI assistant to MySQL/MariaDB, PostgreSQL, or SQLite with zero runtime dependencies.

  • Multi-database — — MySQL/MariaDB, PostgreSQL, and SQLite from one binary
  • Single binary — — ~7 MB, no Python/Node/Docker needed
  • Multiple transports — — stdio (for Claude Desktop, Cursor) and HTTP (for remote/multi-client)
  • Two-layer config — — CLI flags > environment variables, with sensible defaults per backend

The tools it exposes

The server publishes 14 tools. What each one is for:

  • Subcommand — Description
  • stdio — Run in stdio mode
  • version — Print version information and exit
  • Flag — Env Variable
  • Subcommands — A subcommand is required — running dbmcp with no subcommand prints usage help and exits with a non-zero status
  • listDatabases — Lists accessible databases, paginated via cursor / nextCursor. See Cursor Pagination for
  • listTables — Lists tables in a database, paginated via cursor / nextCursor. See Cursor Pagination for
  • listViews — Lists views in a database, paginated via cursor / nextCursor. Available on MySQL/MariaDB, PostgreSQL (public schema), and SQLite. Parameters
  • listTriggers — Lists user-defined triggers on tables, paginated via cursor / nextCursor. Internal constraint and foreign-key triggers are excluded. Available on
  • listFunctions — Lists user-defined SQL functions, paginated via cursor / nextCursor. PostgreSQL excludes aggregates, window functions, and procedures; MySQL/MariaDB
  • listProcedures — Lists user-defined stored procedures, paginated via cursor / nextCursor. Available on MySQL/MariaDB and PostgreSQL (public schema, PostgreSQL 11+)
  • listMaterializedViews — Lists materialized views in the public schema, paginated via cursor / nextCursor. PostgreSQL only — not available for MySQL/MariaDB or SQLite

Getting it running

Installation goes through your MCP client rather than a global install: point it at @modelcontextprotocol/inspector on npm and it is fetched when the client starts. The copy-paste blocks for Claude Desktop, Claude Code and Cursor are further down this page.

What it needs from you

Configuration is passed through the environment: DB_BACKEND, DB_HOST, DB_PORT, DB_USER, DB_PASSWORD, DB_NAME, DB_SSL_KEY. Treat anything key-shaped as a real credential — scope it to the minimum the server needs, and rotate it if it ever lands in a shared config.

How it compares

Plenty of database access servers cover similar ground. The differences that matter in practice are scope of access and how much setup stands between you and a working tool call. Dbmcp's toolset — Subcommand, stdio, version and 11 more — is a fair guide to whether it matches your workflow. It is maintained by ai.haymon; worth a glance at recent repository activity before you build anything load-bearing on it.

SyncDev reviews every entry in this directory against the project's own documentation before publishing, and revisits them as servers change.

Things to watch

  • It runs with your machine's permissions. That is convenient and also the reason to think about what you point it at before you approve a tool call.
  • With 14 tools registered it takes up a noticeable share of the context window; turn it off in projects that never touch Dbmcp.
  • Missing credentials fail quietly in some clients — if no tools show up, check the environment block first.
  • Keep per-call confirmation enabled while you learn its behaviour; it is the cheapest safeguard you have.

Available tools

ToolWhat it does
SubcommandDescription
stdioRun in stdio mode
versionPrint version information and exit
FlagEnv Variable
SubcommandsA subcommand is required — running dbmcp with no subcommand prints usage help and exits with a non-zero status.
listDatabasesLists accessible databases, paginated via cursor / nextCursor. See [Cursor Pagination](https://dbmcp.haymon.ai/docs/features#cursor-pagination) for iteration details. Not available for SQLite.
listTablesLists tables in a database, paginated via cursor / nextCursor. See [Cursor Pagination](https://dbmcp.haymon.ai/docs/features#cursor-pagination) for iteration details.
listViewsLists views in a database, paginated via cursor / nextCursor. Available on MySQL/MariaDB, PostgreSQL (public schema), and SQLite. Parameters: database (defaults to the active database; SQLite has no database parameter),
listTriggersLists user-defined triggers on tables, paginated via cursor / nextCursor. Internal constraint and foreign-key triggers are excluded. Available on MySQL/MariaDB, PostgreSQL (public schema), and SQLite. Parameters: databas
listFunctionsLists user-defined SQL functions, paginated via cursor / nextCursor. PostgreSQL excludes aggregates, window functions, and procedures; MySQL/MariaDB excludes loadable UDFs (mysql.func). Available on MySQL/MariaDB and Pos
listProceduresLists user-defined stored procedures, paginated via cursor / nextCursor. Available on MySQL/MariaDB and PostgreSQL (public schema, PostgreSQL 11+). Not available for SQLite. Parameters: database (defaults to the active d
listMaterializedViewsLists materialized views in the public schema, paginated via cursor / nextCursor. PostgreSQL only — not available for MySQL/MariaDB or SQLite. Parameters: database (defaults to the active database), cursor, search, detai
readQueryExecutes a read-only SQL query (SELECT, SHOW, DESCRIBE, USE, EXPLAIN). Always enforces SQL validation as defence-in-depth. Parameters: query, database, cursor. SELECT results paginate via cursor / nextCursor; SHOW, DESCR
writeQueryExecutes a write SQL query (INSERT, UPDATE, DELETE, CREATE, ALTER, DROP). Only available when read-only mode is disabled. Parameters: query, database.

How to install the Dbmcp MCP server

```json
{
  "mcpServers": {
    "dbmcp": {
      "type": "http",
      "url": "http://127.0.0.1:9001/mcp"
    }
  }
}

Configuration as documented by the project. Restart the client after saving.

Configuration

VariableDescriptionRequired
DB_BACKENDConfiguration value read at startup.Optional
DB_HOSTEndpoint or connection string the server talks to.Optional
DB_PORTConfiguration value read at startup.Optional
DB_USERConfiguration value read at startup.Optional
DB_PASSWORDConfiguration value read at startup.Optional
DB_NAMEConfiguration value read at startup.Optional
DB_SSL_KEYCredential the server authenticates with.Yes

Example prompts to try

  • Use Dbmcp to Subcommand.
  • Use Dbmcp to stdio.
  • Use Dbmcp to version.

Frequently asked questions

It connects Dbmcp to MCP-compatible AI assistants such as Claude and Cursor, exposing 14 tools (Subcommand, stdio, version, and more) that the assistant can call on your behalf. Instead of copying data back and forth by hand, the assistant works with Dbmcp directly.