Open sourceFree for macOS, Windows & Linux

Give your AI agent
read-only access to your databases

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.

No account No cloud No telemetry

Connect the databases you already run

  • PostgreSQLSupabase · Neon · RDS · CockroachDB
  • MySQLMariaDB · PlanetScale · RDS
  • SQLiteLocal database files
  • RedshiftAmazon Redshift over SSL
  • MongoDBAtlas · self-hosted · DocumentDB

…to the AI tools you already use

  • Claude Code
  • Claude Desktop
  • Cursor
  • VS Code
  • Windsurf
  • LM Studio
  • + any MCP client
Before & after

Stop being your AI’s
copy-paste middleware

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.

Time
0:00
App switches
0
Copy-pastes
0
Wrong queries
0
AI chat
You

Which customers churned last month, and what plan were they on?

AI

I can't see your database. Could you paste the table definitions for customers and plans?

Youpasted
CREATE TABLE customers (
  id uuid, name text, churned_at timestamptz, …
);
AIwrong column
SELECT c.name, p.plan_name
FROM customers c JOIN customer_plans p ON …
WHERE c.churned_at >= now() - interval '1 month'
Youpasted
ERROR: column p.plan_name does not exist
AI
Sorry about that! Try:
SELECT c.name, p.plan, c.churned_at …
Youpasted
name,plan,churned_at
Acme Co,Starter,2026-10-03
… 13 more rows
AI

14 customers churned in October. 9 were on Starter, 4 on Team, 1 on Business.

DB client · prod_replica
db=> \d customers
\d customer_plans
Table "public.customers" … 14 columns
db=> SELECT c.name, p.plan_name …
ERROR: column p.plan_name does not exist
db=> SELECT c.name, p.plan, c.churned_at …
14 rows · Export → Copy as CSV

Waiting for you to paste a query…

01Press play to see the loop.
Without DB MCP6m 40s6 app switches, 5 copy-pastes, 1 wrong query. Every question.
With DB MCP21sZero app switches, zero copy-pastes. The agent reads the schema first.
Features

Built for agents.
Locked down for you.

Everything an AI coding tool needs to understand your data, and nothing that lets it change it.

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.

100% local

The MCP server binds to 127.0.0.1. No account, no cloud relay, no hosted copy of your schema.

Encrypted credentials

AES-256-GCM at rest. The key lives in your OS keychain, never in the database or a config file.

One-click client setup

DB MCP writes the config for Claude Desktop, Cursor, VS Code, Windsurf and LM Studio for you.

Context-window friendly

Schema filters, row caps and truncated flags keep big databases from flooding your agent.

Lives in your tray

Close the window and the server keeps serving. Restart, view logs or quit from the menu bar. Optional start at login.

Tools that guide the agent

Every response carries a hint for the next step, and errors come back as structured JSON. Agents recover on their own instead of guessing.

How it works

A secure bridge on your own machine

DB MCP sits between your AI tools and your databases. Nothing in the middle but localhost.

Your computer
AI clients
  • Claude Code
  • Cursor
  • VS Code
  • Windsurf
DB MCP
  • Read-only guard
  • Keychain vault
  • Host & Origin checks
Your databases
  • PostgreSQL
  • MySQL
  • SQLite
  • Redshift
  • MongoDB
  1. 01

    Add a connection

    Pick an engine, paste your host and a read-only user, then hit Test Connection.

  2. 02

    Connect your AI client

    One click writes the MCP config for your editor. Or copy a snippet for anything else.

  3. 03

    Ask in plain English

    Your agent lists databases, reads the schema and runs safe queries to answer you.

Setup

Connected in under a minute

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.

  • Default port 4080, changeable in Settings
  • No token to paste, nothing to expose publicly
  • Works with any client that speaks MCP over HTTP
terminal
claude mcp add --transport http db-mcp http://127.0.0.1:4080/mcp
MCP tools

Four tools. Zero guesswork.

A small, focused surface the agent learns instantly, with field names that match their parameters.

  1. 01list_databases

    Lists every enabled connection with its database_id, so the agent knows what it can query.

  2. 02get_database_schema

    Lists tables, with an optional name filter so large schemas never flood the context window.

  3. 03get_table_schema

    Returns columns, types, indexes and foreign keys for one table.

  4. 04execute_read_query

    Runs SELECT, EXPLAIN, DESCRIBE or SHOW. Returns row_count and truncated flags. 100 rows by default, 1000 max.

Security

Defense in depth, by default

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.

  • Credentials encrypted at rest

    AES-256-GCM. The key lives in the macOS Keychain, Windows Credential Manager or Secret Service, with a 0600 file fallback.

  • Loopback only, rebinding-proof

    Binds to 127.0.0.1 and rejects any Host header that is not localhost, which blocks DNS rebinding attacks.

  • Browsers are shut out

    Requests to /mcp carrying a browser Origin are refused. The app’s own API needs a per-launch session token.

  • Writes never reach the database

    Write keywords and multi-statement queries are rejected. MongoDB operators like $where, $out and $merge are blocked too.

  • Bounded queries

    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.

Open source

Read every line that touches your data

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.

  • Tauri 2
  • Rust
  • TypeScript
  • Hono
  • MCP SDK
  • React
  • SQLite
FAQ

Questions, answered

Is my data sent anywhere?

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.

Can an agent modify or drop my data?

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.

Which AI tools work with it?

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.

Is there a hosted or web version?

No, by design. DB MCP is a desktop app for macOS, Windows and Linux so your credentials stay in your OS keychain.

Why does my OS warn me on first launch?

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.

Does the MCP endpoint require authentication?

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.

Let your agent understand your data today.

Free, open source and running on your machine in minutes.

macOS (Apple silicon & Intel) · Windows · Linux (AppImage, deb, rpm)