Best for
- Users who need safe, read-only AI access to SQL databases
- Teams with data-privacy requirements needing PII redaction
- Developers wanting a zero-dependency, single-binary deployment
- Environments using multiple database backends
DBMCP is a well-engineered database MCP server: a single ~7 MB binary covering MySQL/MariaDB, PostgreSQL, and SQLite, read-only by default and backed by AST-level SQL validation, single-statement enforcement, and dangerous-function blocking — a solid security posture. Its standout features are the opt-in 46-type regex PII redaction and fail-closed ONNX NER detection. The tool surface is complete (schema discovery, querying, explain plans, optional writes) with stdio and HTTP transports and cursor pagination. Caveats: redaction is off by default, write mode requires careful risk assessment, and it is a third-party project rather than an official offering from the database vendors.
Strongest · Documentation 17/20 Weakest · Reliability 9/20
Static review · not runListed 2026-09-07
Read the FMRS scoring method →Runtime:Prebuilt binary
DB_BACKEND
Database backend (mysql, mariadb, postgres, sqlite); required.
DB_PASSWORD
Database password from your database service; sensitive.
DB_SSL_KEY
Path to client key file; sensitive.
DB_HOST
Database host, defaults to 127.0.0.1.
DB_PORT
Database port, backend-dependent default (MySQL 3306, PostgreSQL 5432).
DB_USER
Database user, backend-dependent default.
DB_NAME
Database name or SQLite file path.
DB_CHARSET
Character set, MySQL/MariaDB only.
DB_SSL
Enable SSL connection, default false.
DB_SSL_CA
Path to CA certificate file.
DB_SSL_CERT
Path to client certificate file.
DB_SSL_VERIFY_CERT
Verify server certificate, default true.
DB_READ_ONLY
Read-only mode toggle, default true (hides write tools).
DB_MAX_POOL_SIZE
Maximum connection pool size, default 5.
DB_CONNECTION_TIMEOUT
Connection timeout in seconds.
DB_QUERY_TIMEOUT
Query execution timeout in seconds, default 30.
DB_PAGE_SIZE
Max items per paginated tool response (1-500), default 100.
PII_ENABLE
Enable PII redaction of query output, default false.
PII_OPERATOR
PII operator: replace, mask, redact, or hash.
PII_CATEGORIES
Comma-separated PII categories to detect, e.g. financial,government.
PII_NER_ENABLE
Enable ML/NER detection (person, location), default false.
PII_NER_MODEL
Path to NER model directory; required with PII_NER_ENABLE=true.
LOG_LEVEL
Log level: error, warn, info, debug, trace.
HTTP_HOST
HTTP bind host, default 127.0.0.1.
HTTP_PORT
HTTP bind port, default 9001.
HTTP_ALLOWED_ORIGINS
Allowed CORS origins, comma-separated.
HTTP_ALLOWED_HOSTS
Allowed Host headers, comma-separated.
macOS/Linux/WSL: run curl -fsSL https://dbmcp.haymon.ai/install.sh | bash; Windows PowerShell: irm https://dbmcp.haymon.ai/install.ps1 | iex; Windows CMD: curl -fsSL https://dbmcp.haymon.ai/install.cmd -o install.cmd && install.cmd && del install.cmd. Also installable via Docker (ghcr.io/haymon-ai/dbmcp), Cargo, and other methods. After installation, add a .mcp. in your project root configuring the dbmcp stdio subcommand with DB_BACKEND, DB_HOST, DB_USER, DB_PASSWORD, DB_NAME, etc. For HTTP mode, start the server yourself (e.g. dbmcp http ...) and point the client at http://127.0.0.1:9001/mcp with "type": "http".
{"mcpServers":{"dbmcp":{"command":"dbmcp","args":["stdio"],"env":{"DB_BACKEND":"mysql","DB_HOST":"127.0.0.1","DB_PORT":"3306","DB_USER":"root","DB_PASSWORD":"secret","DB_NAME":"mydb"}}}}
Shown for Claude Desktop. Other clients may use a different file or key (VS Code uses "servers") — the configurator below converts it.
{
"servers": {
"dbmcp": {
"command": "dbmcp",
"args": [
"stdio"
],
"env": {
"DB_BACKEND": "mysql",
"DB_HOST": "127.0.0.1",
"DB_PORT": "3306",
"DB_USER": "root",
"DB_PASSWORD": "secret",
"DB_NAME": "mydb"
}
}
}
}
Goes in your project's .vscode/mcp.json (VS Code uses a "servers" key).
claude mcp add dbmcp -e DB_BACKEND=mysql -e DB_HOST=127.0.0.1 -e DB_PORT=3306 -e DB_USER=root -e DB_PASSWORD=secret -e DB_NAME=mydb -- dbmcp stdio
Run it in a terminal; replace any <…> placeholders with your own values first.
Check that tools like listTables and readQuery appear in your MCP client's tool list; asking "list the available databases" and getting a result confirms the connection works.
Once connected, you can ask your AI assistant things like:
No matching tools
Listed from the project's documentation, not tested by this site.
DBMCP (ai.haymon/dbmcp) is an open-source (MIT-licensed) database MCP server maintained by haymon-ai, supporting MySQL/MariaDB, PostgreSQL, and SQLite. It ships as a ~7 MB single binary with no Python/Node/Docker runtime dependencies, and offers stdio and HTTP (streamable-http) transports. It runs in read-only mode by default (write tools hidden), with opt-in regex-based PII redaction (46 built-in entity types across 7 categories) and optional ONNX Runtime ML/NER detection (persons, locations, etc.). Connections support SSL/TLS, connection pooling, and query timeouts.
Connect ClickHouse to your AI assistants
Unofficial MCP server providing advanced access to the ChEMBL chemical database
Google's official database MCP toolbox — define AI-accessible database tools via config
Bytebase's official, minimalist two-tool database MCP server
Source revision a1ccacb271a5 Data synced 2026-10-19 Read the FMRS scoring method