Listed from the MCP registry; nobody on Odel publishes it.
Runs on your machine from its package; the steps are below.

At most: moves money, runs code or commands, deletes data, or sends messages for you.
Odel charges nothing per call. The publisher may charge for its own service.
Runs locally over stdio
This server isn't hosted — your MCP client launches it from a package registry. Use one of the commands below, or drop the config into your client (e.g. Claude Desktop).
Run
docker run -i --rm ghcr.io/haymon-ai/dbmcp:0.21.0
MCP client config
{
"mcpServers": {
"dbmcp": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"ghcr.io/haymon-ai/dbmcp:0.21.0"
]
}
}
}Run
docker run -i --rm ghcr.io/haymon-ai/dbmcp:0.21.0
MCP client config
{
"mcpServers": {
"dbmcp": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"ghcr.io/haymon-ai/dbmcp:0.21.0"
]
}
}
}Run
npx -y @haymon-ai/dbmcp
MCP client config
{
"mcpServers": {
"dbmcp": {
"command": "npx",
"args": [
"-y",
"@haymon-ai/dbmcp"
]
}
}
}Distributed via cargo as `dbmcp`.
The privacy first MCP server for SQL databases.
Out of the box, dbmcp redacts e-mail addresses, phone numbers, bank and card numbers, national IDs, API keys, and other pattern-detected values inside the server, so the AI client never sees them. Add a local model for names and places, and column rules for any column you name, such as salaries or margins.
Works with MySQL, MariaDB, PostgreSQL, and SQLite.

<EMAIL_ADDRESS_4e1f0dd69c51e84c> keep equal values equal, so the assistant can still count, group, and join. See Data PrivacylistDatabases, 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.DBMCP_* environment variables, an env file, and an optional YAML config file with ${} interpolation, with sensible defaults per backendknown_hosts verification, automatic reconnectmacOS, Linux, WSL:
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
npm (MCP clients can also launch it with npx -y @haymon-ai/dbmcp):
npm install -g @haymon-ai/dbmcp
See the installation docs for Docker, Cargo, and other methods.
MCP Registry name: mcp-name: ai.haymon/dbmcp
The buttons launch dbmcp with npx (Node.js 18+). VS Code prompts for the connection settings; Cursor installs placeholders to edit afterwards. For Claude Desktop, Claude Code, Codex, Windsurf, Zed, Gemini CLI, Goose, JetBrains, and LM Studio, see MCP Clients.
Claude Code:
/plugin marketplace add haymon-ai/marketplace
/plugin install dbmcp@haymon-ai
Codex:
codex plugin marketplace add haymon-ai/marketplace
codex plugin add dbmcp@haymon-ai
The plugin adds the dbmcp MCP server and the setup and privacy skills, and prompts for the connection settings. See Claude Code and Codex.
.mcp.jsonAdd 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:
{
"mcpServers": {
"dbmcp": {
"command": "dbmcp",
"env": {
"DBMCP_DB_BACKEND": "mysql",
"DBMCP_DB_HOST": "127.0.0.1",
"DBMCP_DB_PORT": "3306",
"DBMCP_DB_USER": "root",
"DBMCP_DB_PASSWORD": "secret",
"DBMCP_DB_NAME": "mydb"
}
}
}
}
HTTP transport — you start the server yourself, the client connects to it:
# Start the server first
DBMCP_TRANSPORT=http DBMCP_DB_BACKEND=mysql DBMCP_DB_USER=root DBMCP_DB_NAME=mydb dbmcp
{
"mcpServers": {
"dbmcp": {
"type": "http",
"url": "http://127.0.0.1:9001/mcp"
}
}
}
Note: The
"type": "http"field is required for HTTP transport. Without it, clients like Claude Code will reject the config.
To require a bearer token, start the server with DBMCP_HTTP_AUTH_TOKEN and send it from the client:
DBMCP_HTTP_AUTH_TOKEN="$(openssl rand -hex 32)" DBMCP_TRANSPORT=http DBMCP_DB_BACKEND=mysql DBMCP_DB_USER=root DBMCP_DB_NAME=mydb dbmcp
{
"mcpServers": {
"dbmcp": {
"type": "http",
"url": "http://127.0.0.1:9001/mcp",
"headers": { "Authorization": "Bearer ${DBMCP_TOKEN}" }
}
}
}
# MySQL/MariaDB
DBMCP_DB_BACKEND=mysql DBMCP_DB_HOST=localhost DBMCP_DB_USER=root DBMCP_DB_NAME=mydb dbmcp
# PostgreSQL
DBMCP_DB_BACKEND=postgres DBMCP_DB_HOST=localhost DBMCP_DB_USER=postgres DBMCP_DB_NAME=mydb dbmcp
# SQLite
DBMCP_DB_BACKEND=sqlite DBMCP_DB_NAME=./data.db dbmcp
# PostgreSQL through an SSH bastion (DB host is resolved by the bastion)
DBMCP_DB_BACKEND=postgres DBMCP_DB_HOST=db.internal DBMCP_DB_USER=postgres DBMCP_DB_NAME=mydb \
DBMCP_SSH_HOST=bastion.example.com DBMCP_SSH_USER=deploy DBMCP_SSH_KEY=~/.ssh/id_ed25519 dbmcp
# HTTP transport (loopback only, no token required)
DBMCP_TRANSPORT=http DBMCP_DB_BACKEND=mysql DBMCP_DB_USER=root DBMCP_DB_NAME=mydb dbmcp
# HTTP transport on all interfaces — a bearer token is REQUIRED
DBMCP_HTTP_AUTH_TOKEN=change-me DBMCP_TRANSPORT=http DBMCP_HTTP_HOST=0.0.0.0 \
DBMCP_DB_BACKEND=mysql DBMCP_DB_USER=root DBMCP_DB_NAME=mydb dbmcp
Warning: Binding a non-loopback address (e.g.
DBMCP_HTTP_HOST=0.0.0.0) exposes the database to anyone who can reach the port.dbmcprefuses to start in that case unlessDBMCP_HTTP_AUTH_TOKENis set. The Host/Origin allowlists protect against browser DNS rebinding only — they are not authentication.
# dbmcp.yaml
database:
backend: postgres
host: localhost
user: postgres
password: ${DB_PASSWORD:?set DB_PASSWORD}
name: mydb
DB_PASSWORD=secret dbmcp --config-file /path/to/dbmcp.yaml
From an MCP client, pass "args": ["--config-file", "~/path/to/dbmcp.yaml"] or an absolute path; relative paths resolve against the process working directory, which the client controls. See Config File.
Every setting has a YAML key, and every setting except privacy.rules (YAML only) has a DBMCP_* environment variable. Each setting is resolved with clear precedence:
process environment > env files (--env-file) > config files (--config-file) > defaults
Environment variables are typically set by your MCP client (via env or envFile in the server config). An empty DBMCP_* value counts as unset. Nothing is discovered automatically: a file is read only when you name it.
| Flag | Env Variable | Description |
|---|---|---|
--config-file <PATH> | DBMCP_CONFIG_FILE | YAML config file (${} interpolation, strict keys); repeatable (env var: comma list), later wins |
--env-file <PATH> | DBMCP_ENV_FILE | Env file of KEY=VALUE lines; repeatable (env var: comma list), later wins |
Layer files by repeating a flag, e.g. a shared base plus local overrides: dbmcp --config-file base.yaml --config-file local.yaml. Each setting comes from the last file that sets it; lists replace.
There are no per-setting flags. Booleans accept true/false, 1/0, t/f (not yes/no); lists are comma-separated in env vars.
${} interpolation, env file format, path resolution, Docker, and error outputSecurity note: Read-only mode is on by default (
DBMCP_DB_READ_ONLY=true). The default HTTPOriginallowlist accepts browser pages from any port onlocalhost/127.0.0.1/[::1]; on shared or development machines, setDBMCP_HTTP_AUTH_TOKENor narrowDBMCP_HTTP_ALLOWED_ORIGINSto the explicit origins you trust (e.g.http://localhost:5173).
The SSH tunnel is MySQL/MariaDB/PostgreSQL only and uses an embedded SSH client (no ssh binary). DBMCP_DB_HOST/DBMCP_DB_PORT are resolved by the SSH server. With both a key and a password set, the key is tried first. See SSH Tunnel for host-key policies, limitations, and troubleshooting.
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 substring filter — users matches users, users_audit, and old_users. The value is wrapped as %users% in a LIKE/ILIKE pattern, so % and _ inside it still act as wildcards.
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:
triggers is a sorted JSON array of bare trigger-name strings.detailed: true) — triggers is a JSON object keyed by trigger name; each value carries the per-backend metadata payload (timing, events, definition, and backend-specific extras like PostgreSQL status/functionName or MySQL/MariaDB session-context fields). See the listTriggers reference for the full per-backend field list.See Cursor Pagination for iteration details.
Lists 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 PostgreSQL (public schema). Not available for SQLite. Parameters: database (defaults to the active database), 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:
functions is a sorted JSON array of bare function-name strings. PostgreSQL overloads appear once per overload (duplicate name strings are expected).detailed: true) — functions is a JSON object keyed by function signature; each value carries the per-backend metadata payload (language, arguments, return type, definition, and backend-specific extras such as PostgreSQL volatility/strict/parallelSafety or MySQL/MariaDB session-context fields). PostgreSQL keys are name(arguments) (overloads disambiguate); MySQL/MariaDB keys are bare names (no overloading). See the listFunctions reference for the full per-backend field list.See Cursor Pagination for iteration details.
Lists 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 database), 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:
procedures is a sorted JSON array of bare procedure-name strings. PostgreSQL overloads appear once per overload (duplicate name strings are expected).detailed: true) — procedures is a JSON object keyed by procedure signature; each value carries the per-backend metadata payload (language, arguments, security, definition, and backend-specific extras such as PostgreSQL owner or MySQL/MariaDB deterministic/sqlDataAccess/session-context fields). PostgreSQL keys are name(arguments) (overloads disambiguate; zero-arg procedures key as name()); MySQL/MariaDB keys are bare names (no overloading). See the listProcedures reference for the full per-backend field list.See Cursor Pagination for iteration details.
Lists 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, detailed.
search is an optional case-insensitive ILIKE pattern with % (any sequence) and _ (single character) as wildcards. SQL meta-characters (', ;, --) are bound as parameter values and never interpolated. The search value must remain identical across paginated calls for cursor continuity.
detailed (default false) switches the response shape:
materializedViews is a sorted JSON array of bare matview-name strings. Matview names are unique per schema, so no duplicates appear.detailed: true) — materializedViews is a JSON object keyed by bare matview name; each value carries schema, owner, description (or null when no COMMENT ON MATERIALIZED VIEW), definition (the SELECT body verbatim from pg_matviews.definition), populated (false for matviews created WITH NO DATA and never refreshed), and indexed (true when at least one index exists; REFRESH MATERIALIZED VIEW CONCURRENTLY additionally requires a unique index). Detailed mode deliberately omits column metadata, tablespace, storage parameters, and unique-index detection — recoverable via definition, listTables(detailed=true), or readQuery against pg_indexes. See the listMaterializedViews reference for source columns and operational semantics.See Cursor Pagination for iteration details.
Executes a read-only SQL query (SELECT, SHOW, DESCRIBE, EXPLAIN). Always enforces SQL validation as defence-in-depth. Parameters: query, database, cursor. SELECT results paginate via cursor / nextCursor; SHOW, DESCRIBE, and EXPLAIN return a single page and ignore cursor. See Cursor Pagination for iteration details.
Executes a write SQL query (INSERT, UPDATE, DELETE, CREATE, ALTER, DROP). Only available when read-only mode is disabled. Parameters: query, database.
Creates a database if it doesn't exist. Only available when read-only mode is disabled. Not available for SQLite. Parameters: database.
Drops an existing database. Refuses to drop the currently connected database. Only available when read-only mode is disabled. Not available for SQLite. Parameters: database.
Drops a table from a database. If the table has foreign key dependents, the database error is surfaced to the user. On PostgreSQL, a cascade parameter is available to force the drop with CASCADE. Only available when read-only mode is disabled. Parameters: database, table, cascade (PostgreSQL only).
Returns the execution plan for a SQL query. Supports an optional analyze parameter for actual execution statistics (PostgreSQL and MySQL/MariaDB; MariaDB runs ANALYZE FORMAT=JSON and refuses analyze while column rules apply). EXPLAIN ANALYZE is only allowed for SELECT statements since it actually executes the query, whether or not read-only mode is enabled. Every EXPLAIN runs inside a read-only transaction, so on MySQL/MariaDB plain EXPLAIN of write statements is rejected. SQLite uses EXPLAIN QUERY PLAN (no ANALYZE support). Always available regardless of read-only mode. Parameters: query, database, analyze (PostgreSQL/MySQL/MariaDB only).
readQuery enforces AST-based SQL validationreadQuery / explainQuery reject multi-statement SQL at parse levelLOAD_FILE(), INTO OUTFILE, INTO DUMPFILE detected in the ASTDBMCP_HTTP_AUTH_TOKEN enforces Authorization: Bearer <token> (constant-time compare, 401 on failure); non-loopback binds refuse to start without a tokenDBMCP_DB_SSL_* variablesknown_hosts (yes by default); SSH passwords and passphrases are never loggedfull, query tool output passes through a regex-based redactor that rewrites detected sensitive spans across 47 built-in entity types spanning seven categories: personal (email, date of birth), financial (cards, IBAN, UK/US bank accounts, sort and US ABA routing codes, CVV), government IDs (US SSN, ITIN, EIN, passports, driver licences, Medicare MBI, NPI, DEA; UK NHS, NINO, passports, driving licences, vehicle plates; German tax, social security, health insurance, ID card, passport, driving licence, physician, practice, commercial register, and plate numbers; Canadian SIN; EU VAT), contact (phone, postcodes of any country plus UK/German ones), network (IP, URL, MAC), digital identity (API keys, JWTs, PEM private keys, password hashes), and crypto wallets. Mode: DBMCP_PRIVACY_MODE (privacy.mode) — none, rules (column rules only), or full (default). Operator: DBMCP_PRIVACY_OPERATOR (privacy.operator) — one of hash (default, keyed tokens like <EMAIL_ADDRESS_…>; key via DBMCP_PRIVACY_KEY (privacy.key)), replace (entity-aware placeholders like <EMAIL_ADDRESS>), mask (length-preserving *), redact (drop). Optional subset via DBMCP_PRIVACY_CATEGORIES (privacy.categories) (comma-separated, e.g. financial,government); unset enables all built-ins. Scope: rows returned by readQuery, writeQuery, and explainQuery, plus tool error messages (regex recognizers only). Column rules (privacy.rules, YAML only, under rules and full) rewrite every value of named table columns, traced through views, CTEs, and expressions, and refuse statements that could reveal them otherwise (see Rules). See Data Privacy for the full surface.PERSON, LOCATION, ORGANIZATION, NATIONALITY_RELIGION_POLITICS, and FACILITY detection that regex cannot catch, turned on under full by setting a user-supplied model directory in DBMCP_PRIVACY_MODEL (privacy.model). Which entities are produced depends on the model's labels (CoNLL models give person/location/organization; OntoNotes-class models add NRP and facility). Inference uses ONNX Runtime (model directory holds config.json, tokenizer.json, model.onnx; recommended: the MIT-licensed optimum/bert-base-NER, an ONNX export of dslim/bert-base-NER; an int8-quantized export runs about 3.5× faster). Fail-closed: a model that cannot load aborts startup and an inference error fails the request — never a silent fallback. Respects privacy.categories. Model-agnostic: multilingual models such as Davlan/bert-base-multilingual-cased-ner-hrl work once exported to ONNX.# Unit tests (requires cargo-nextest)
cargo nextest run --workspace
# Integration tests (requires Docker and cargo-nextest)
./tests/run.sh
# Filter by engine
./tests/run.sh --filter mariadb
./tests/run.sh --filter mysql
./tests/run.sh --filter postgres
./tests/run.sh --filter sqlite
# With MCP Inspector
npx @modelcontextprotocol/inspector ./target/release/dbmcp
# HTTP mode testing
curl -X POST http://localhost:9001/mcp \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"test","version":"0.1"}}}'
This is a Cargo workspace with the following crates:
| Crate | Path | Description |
|---|---|---|
dbmcp | . (root) | Binary shim |
dbmcp-cli | crates/cli/ | CLI parsing, transports, server bootstrap |
dbmcp-sql | crates/sql/ | Shared error types, validation, and identifier utilities |
dbmcp-config | crates/config/ | Configuration loading and validation |
dbmcp-types | crates/types/ | Shared configuration types and privacy vocabulary |
dbmcp-server | crates/server/ | Shared MCP tool implementations and server info |
dbmcp-truncate | crates/truncate/ | Character caps that fit JSON values into a char budget |
dbmcp-mysql | crates/mysql/ | MySQL/MariaDB backend handler and operations |
dbmcp-postgres | crates/postgres/ | PostgreSQL backend handler and operations |
dbmcp-sqlite | crates/sqlite/ | SQLite backend handler and operations |
dbmcp-privacy | crates/privacy/ | Sensitive-data detection and anonymisation of query output |
dbmcp-sql-lineage | crates/sql-lineage/ | Column-level SQL lineage extraction |
dbmcp-ssh | crates/ssh/ | SSH tunnel for database connections |
sqlx-json | crates/sqlx-json/ | Type-safe row-to-JSON conversion for sqlx (RowExt trait) |
cargo build # Development build
cargo build --release # Release build
cargo nextest run --workspace # Run unit tests
cargo clippy --workspace --tests -- -D warnings # Lint
cargo fmt # Format
cargo doc --no-deps # Build documentation
This project is licensed under the MIT License — see the LICENSE file for details.