Database MCP server for MySQL, MariaDB, PostgreSQL & SQLite
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
One-click editor setup isnβt available for this listing yet β we donβt have a confirmed install command, and weβd rather show nothing than point your editor at the wrong package or host. Follow the projectβs own setup instructions, linked above.
Inspect callable tools, capabilities, and parameters exposed to AI agents by Dbmcp.
tablesCallable MCP tool function
schemaCallable MCP tool function
kindCallable MCP tool function
ownerCallable MCP tool function
commentCallable MCP tool function
viewsCallable MCP tool function
A single-binary MCP server for SQL databases. Connect your AI assistant to MySQL/MariaDB, PostgreSQL, or SQLite with zero runtime dependencies.
Website Β· Documentation Β· Releases

listDatabases, listTables, listViews, listTriggers, listFunctions, listProcedures, listMaterializedViews), data access (readQuery, writeQuery), DDL (createDatabase, dropDatabase, dropTable), and explainQuery. Read-only mode hides the write tools (writeQuery, createDatabase, dropDatabase, dropTable). See MCP Tools for per-backend availability.macOS, Linux, WSL:
Windows PowerShell:
Windows CMD:
See the installation docs for Docker, Cargo, and other methods.
.mcp.json (recommended)Add a .mcp.json file to your project root. MCP clients read this file and configure the server automatically.
Stdio transport β the client starts and manages the server process:
HTTP transport β you start the server yourself, the client connects to it:
Note: The
"type": "http"field is required for HTTP transport. Without it, clients like Claude Code will reject the config.
Configuration is loaded with clear precedence:
CLI flags > environment variables > defaults
Environment variables are typically set by your MCP client (via env or envFile in the server config).
| Subcommand | Description |
|---|---|
stdio | Run in stdio mode |
http | Run in HTTP/SSE mode |
version | Print version information and exit |
A subcommand is required β running dbmcp with no subcommand prints usage help and exits with a non-zero status.
| Flag | Env Variable | Default | Description |
|---|---|---|---|
--db-backend | DB_BACKEND | (required) | mysql, mariadb, postgres, or sqlite |
--db-host | DB_HOST | localhost | Database host |
--db-port | DB_PORT | backend default | 3306 (MySQL/MariaDB), 5432 (PostgreSQL) |
--db-user | DB_USER | backend default | root (MySQL/MariaDB), postgres (PostgreSQL) |
--db-password | DB_PASSWORD | (empty) | Database password |
--db-name | DB_NAME | (empty) | Database name or SQLite file path |
--db-charset | DB_CHARSET | Character set (MySQL/MariaDB only) |
| Flag | Env Variable | Default | Description |
|---|---|---|---|
--db-ssl | DB_SSL | false | Enable SSL |
--db-ssl-ca | DB_SSL_CA | CA certificate path | |
--db-ssl-cert | DB_SSL_CERT | Client certificate path | |
--db-ssl-key | DB_SSL_KEY | Client key path | |
--db-ssl-verify-cert | DB_SSL_VERIFY_CERT | true | Verify server certificate |
| Flag | Env Variable | Default | Description |
|---|---|---|---|
--db-read-only | DB_READ_ONLY | true | Block write queries |
--db-max-pool-size | DB_MAX_POOL_SIZE | 5 | Max connection pool size (min: 1) |
--db-connection-timeout | DB_CONNECTION_TIMEOUT | (unset) | Connection timeout in seconds (min: 1) |
--db-query-timeout | DB_QUERY_TIMEOUT | 30 | Query execution timeout in seconds |
--db-page-size | DB_PAGE_SIZE | 100 | Max items per paginated tool response (range 1β500) |
| Flag | Env Variable | Default | Description |
|---|---|---|---|
--log-level | LOG_LEVEL | info | Log level (trace/debug/info/warn/error) |
http subcommand)| Flag | Default | Description |
|---|---|---|
--host | 127.0.0.1 | Bind host |
--port | 9001 | Bind port |
--allowed-origins | localhost variants | Allowed browser origins (comma-separated). Drives both CORS preflight and server-side Origin rejection. |
--allowed-hosts | localhost,127.0.0.1,::1 | Trusted Host headers (comma-separated). Enforced server-side; HTTP/2 :authority is honored. |
Lists accessible databases, paginated via cursor / nextCursor. See Cursor Pagination for iteration details. Not available for SQLite.
Lists tables in a database, paginated via cursor / nextCursor. See Cursor Pagination for iteration details.
Parameters: database (defaults to the active database; SQLite has no database parameter), cursor, search, detailed.
search is an optional case-insensitive LIKE/ILIKE pattern with % (any sequence) and _ (single character) as wildcards β pass users% to match names beginning with users, or %order% for substring matching. A bare word with no wildcards matches only an exact table name.
detailed (default false) switches the response shape:
tables is a sorted JSON array of bare table-name strings.detailed: true) β tables is a JSON object keyed by table name; each value carries the table's schema, kind, owner, comment, columns[], constraints[], indexes[], and triggers[]. One call returns both the table list and the per-table metadata.Lists 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), cursor, search, detailed. SQLite returns the brief shape only β search and detailed are not accepted there.
search is an optional case-insensitive LIKE/ILIKE pattern with % (any sequence) and _ (single character) as wildcards. The search value must remain identical across paginated calls for cursor continuity.
detailed (default false) switches the response shape:
views is a sorted JSON array of bare view-name strings. View names are unique per schema, so no duplicates appear.detailed: true) β views is a JSON object keyed by bare view name; each value carries the per-backend metadata payload. PostgreSQL exposes schema, owner, description, definition. MySQL/MariaDB exposes schema, definer, security, checkOption, updatable, characterSetClient, collationConnection, definition. See the listViews reference for source columns, enumerated value sets, and intentional omissions per backend.See Cursor Pagination for iteration details.
Lists 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: database (defaults to the active database; SQLite has no database parameter), cursor, search, detailed.
search is an optional case-insensitive LIKE/ILIKE pattern with % (any sequence) and _ (single character) as wildcards. The search value must remain identical across paginated calls for cursor continuity.
detailed (default false) switches the response shape:
Factual signals from GitHub, npm, and our automated checks β not a rating.
No reviews yet β be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/dbmcp)<a href="https://allmcps.com/mcp/dbmcp"><img src="https://allmcps.com/api/badge/dbmcp?style=directory" alt="Dbmcp on AllMCPs" /></a>