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.
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.
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"}}}}