Read-only, enforced twice
Every query is checked before it runs, and multi-statement tricks are rejected. INSERT, UPDATE,DROP and friends never reach your database. Pair it with a read-only DB user and an agent has no path to write.
DB MCP keeps your connections encrypted on your machine and serves them to Claude, Cursor, VS Code and any MCP client over localhost. Your agent sees the schema and runs safe queries. It can't write a thing.
> Which customers churned last month, and what plan were they on?
SELECT c.name, p.plan, c.churned_at FROM customers c JOIN customer_plans p ON p.customer_id = c.id WHERE c.churned_at >= '2026-10-01' LIMIT 100✓ 14 rows · 38 ms · read-only
14 customers churned in October. 9 were on Starter, 4 on Team, 1 on Business. Most left within 30 days of a price change…
Connect the databases you already run
…to the AI tools you already use
Without database access, every question turns into a loop between the chat and your DB client. With DB MCP, the agent does the legwork itself.
Which customers churned last month, and what plan were they on?
I can't see your database. Could you paste the table definitions for customers and plans?
CREATE TABLE customers ( id uuid, name text, churned_at timestamptz, … );
SELECT c.name, p.plan_name FROM customers c JOIN customer_plans p ON … WHERE c.churned_at >= now() - interval '1 month'
ERROR: column p.plan_name does not exist
Sorry about that! Try: SELECT c.name, p.plan, c.churned_at …
name,plan,churned_at Acme Co,Starter,2026-10-03 … 13 more rows
14 customers churned in October. 9 were on Starter, 4 on Team, 1 on Business.
db=> \d customers
\d customer_plansTable "public.customers" … 14 columnsdb=> SELECT c.name, p.plan_name …ERROR: column p.plan_name does not existdb=> SELECT c.name, p.plan, c.churned_at …14 rows · Export → Copy as CSVWaiting for you to paste a query…
Which customers churned last month, and what plan were they on?
SELECT c.name, p.plan, c.churned_at FROM customers c JOIN customer_plans p ON p.customer_id = c.id WHERE c.churned_at >= '2026-10-01'✓ 14 rows · 38 ms · read-only
14 customers churned in October. 9 were on Starter, 4 on Team, 1 on Business. Most left within 30 days of a price change.
Everything an AI coding tool needs to understand your data, and nothing that lets it change it.
Every query is checked before it runs, and multi-statement tricks are rejected. INSERT, UPDATE,DROP and friends never reach your database. Pair it with a read-only DB user and an agent has no path to write.
The MCP server binds to 127.0.0.1. No account, no cloud relay, no hosted copy of your schema.
AES-256-GCM at rest. The key lives in your OS keychain, never in the database or a config file.
DB MCP writes the config for Claude Desktop, Cursor, VS Code, Windsurf and LM Studio for you.
Schema filters, row caps and truncated flags keep big databases from flooding your agent.
Close the window and the server keeps serving. Restart, view logs or quit from the menu bar. Optional start at login.
Every response carries a hint for the next step, and errors come back as structured JSON. Agents recover on their own instead of guessing.
DB MCP sits between your AI tools and your databases. Nothing in the middle but localhost.
Pick an engine, paste your host and a read-only user, then hit Test Connection.
One click writes the MCP config for your editor. Or copy a snippet for anything else.
Your agent lists databases, reads the schema and runs safe queries to answer you.
The AI Clients page in DB MCP writes these entries for you. Prefer to do it by hand? Copy the snippet for your tool and restart it.
claude mcp add --transport http db-mcp http://127.0.0.1:4080/mcp{
"mcpServers": {
"db-mcp": {
"url": "http://127.0.0.1:4080/mcp"
}
}
}{
"servers": {
"db-mcp": {
"type": "http",
"url": "http://127.0.0.1:4080/mcp"
}
}
}{
"mcpServers": {
"db-mcp": {
"serverUrl": "http://127.0.0.1:4080/mcp"
}
}
}{
"mcpServers": {
"db-mcp": {
"command": "npx",
"args": [
"-y",
"mcp-remote",
"http://127.0.0.1:4080/mcp"
]
}
}
}A small, focused surface the agent learns instantly, with field names that match their parameters.
list_databasesLists every enabled connection with its database_id, so the agent knows what it can query.
get_database_schemaLists tables, with an optional name filter so large schemas never flood the context window.
get_table_schemaReturns columns, types, indexes and foreign keys for one table.
execute_read_queryRuns SELECT, EXPLAIN, DESCRIBE or SHOW. Returns row_count and truncated flags. 100 rows by default, 1000 max.
Giving an AI access to production data should feel boring. DB MCP stacks independent safeguards so a single mistake is never enough.
Your part: connect with a database user that has read-only grants. It is the one safeguard enforced by the database itself.
AES-256-GCM. The key lives in the macOS Keychain, Windows Credential Manager or Secret Service, with a 0600 file fallback.
Binds to 127.0.0.1 and rejects any Host header that is not localhost, which blocks DNS rebinding attacks.
Requests to /mcp carrying a browser Origin are refused. The app’s own API needs a per-launch session token.
Write keywords and multi-statement queries are rejected. MongoDB operators like $where, $out and $merge are blocked too.
Results are capped at 100 rows by default and 1000 max, with a 10 second timeout so a runaway query can’t hang your agent.
A tool with database credentials should be auditable. DB MCP is developed in the open on GitHub. Inspect the code, file issues, or send a pull request.
Not by DB MCP. It runs on your computer, the MCP endpoint binds to 127.0.0.1 only, and there is no account, cloud service or telemetry. Query results go to the AI client you connected, which handles them like anything else you share with it.
Write statements are rejected before they reach the database. We still recommend a database user with read-only grants, because that is the safeguard you control at the database itself.
Any client that speaks MCP over HTTP. The app writes the config for Claude Desktop, Cursor, VS Code, Windsurf and LM Studio, and shows a snippet for everything else, including Claude Code.
No, by design. DB MCP is a desktop app for macOS, Windows and Linux so your credentials stay in your OS keychain.
Builds are not code-signed yet. On macOS, Control-click the app and choose Open. On Windows, click More info, then Run anyway. Full steps are in the README.
No. Any program running as your OS user can call it, so your user account is the trust boundary. Browser requests are rejected and the Host header is checked to block DNS rebinding.
Free, open source and running on your machine in minutes.
macOS (Apple silicon & Intel) · Windows · Linux (AppImage, deb, rpm)