DB Conn MCP server
io.github.Idle-Sync/db-conn-mcp·v0.7.1·2 starsA dead-simple, self-hosted MCP server for securely querying databases via AI agents.
2 stars74 downloads/wk
Reviews
Write oneNobody has reviewed DB Conn yet.
If you have run it, two minutes of your experience saves the next person an afternoon.
DB Conn tools (23, 3 write)
write = sends, deletes, buys or postsRead from the package source without running it. The installed server may list more.
cancel_querywrite actionCancel the statement running in server backend `pid` (find pids via show_activity).
check_databaseTest connectivity for one database (or all) — returns OK or a sanitized cause.
check_sequencesFind sequences lagging behind their column's max value (stale after migrations).
close_cursorClose an open cursor and release its database connection. Idempotent.
diff_schemasCompare the schemas of two configured databases (tables, columns, PK/FK).
doctorDiagnose the whole setup, not just connectivity — use when something is misbehaving and check_database alone doesn't explain why.
dump_schema_faithfulProduce a byte-faithful schema dump using the database's own tool (pg_dump -s).
execute_read_querywrite actionRun a read-only SELECT query (enforced as a read-only transaction).
execute_write_querywrite actionRun an INSERT/UPDATE/DELETE/DDL statement on a write-mode database.
explain_queryShow the execution plan for a read-only query (EXPLAIN; optionally ANALYZE).
fetch_rowsFetch the next N rows from an open cursor (see open_query_cursor).
find_columnsFind columns by name across all tables (fuzzy, case-insensitive substring).
get_database_schemaGet the whole database's schema at once, as JSON or as a runnable SQL script.
get_object_definitionGet the faithful SQL definition of a non-table object by name.
get_table_schemaGet columns, types, and primary/foreign keys for a table.
list_databasesList configured databases with their allowed mode and yolo flag (no DSN).
list_tablesList all tables and views in the named database.
open_query_cursorOpen a server-side cursor over a read-only query for batched fetching.
sample_table_rowsFetch the first N rows of a table to learn its data shape.
search_valueFind WHERE a value appears across tables (fuzzy, case-insensitive substring).
set_yolo_modeEnable/disable yolo (skip the write-consent prompt) for one database, persisted.
show_activityShow current server activity: pid, state, wait events, query/transaction age.
table_statsApproximate row counts and disk/index sizes per table, largest first.
Public scan report
scanner v0.1.10 · 2026-11-03 · same rubric, same numbers if you re-run it
- Code scan25 source files scanned25/25
- –Live reliabilityno gateway calls yet and no remote to proben/a
- –Tool poisoningtools not inspected (local package is not executed); not countedn/a
- Auth qualitylocal package, no credentials required12/15
- Maintenancelast push 82 days ago12/15
- Maintainer identityregistry namespace matches repository owner7/10
How DB Conn compares
Against every graded MCP server, from our own scans and uptime checks. Updated after each scan run.
- Safety score
- 86/100
- higher than 72% of 48,243 servers
- Tools
- 23
- the typical server has 7
- Tools that change things
- 13%
- typical: 0%. Fewer write tools means less an agent can break
- GitHub stars
- 2
- more than 75% of 28,706 servers
- Downloads a week
- 74
- more than 55% of 12,306 servers with a package
What its tools let an agent do: 17 read · 1 create · 2 change · 1 delete · 2 run or deploy
Install DB Conn in Claude Code, Cursor or VS Code
claude mcp add db-conn-mcp -- uvx db-conn-mcp
What the publisher says
From the DB Conn repository's README, as published. We do not edit it. Read it on GitHub
<!-- mcp-name: io.github.Idle-Sync/db-conn-mcp -->
db-conn-mcp
A dead-simple, self-hosted Model Context Protocol (MCP) server for querying your databases with AI agents (Claude, Cursor, Windsurf, VS Code, Zed, Codex, and more).
It does one thing well: let an agent safely explore and query a database you point it at — with security delegated to the simplest possible primitives (a static JSON file and your database's own read-only transactions), not custom auth servers or fragile SQL parsing.
v1 ships PostgreSQL only. All database-specific code lives behind a Dialect seam, so adding MySQL/SQLite later is a single new file.
Why
- Read stays read. A read database runs every query in a native read-only transaction, and the read tool only accepts a single read-only statement (SELECT/WITH/VALUES/TABLE/SHOW/EXPLAIN) — so an agent can't slip in a write or a SET … READ WRITE to flip the session. For a hard, privilege-level guarantee that holds no matter what, point the DSN at a read-only database role (see Use a read-only role).
- No secret leaks. DSNs/passwords are never logged or returned by any tool. Connection failures come back as sanitized diagnostics (a category + fix), never a raw traceback with your host and credentials in it.
- Tiered write safety. Writes are gated server-side: mode (hard, native) → dry-run first (a commit is refused unless that exact statement was previewed) → yolo (per-database trust) → user_consent (explicit per-operation approval).
- Zero-friction setup. An interactive wizard registers your database and injects the server into your AI client's config for you — across 9 popular clients, each in its own format. Prefer clicking? db-conn-mcp gui opens a local dashboard that does the same, and proves each client can actually launch the server.
Install
Requires Python 3.12+.
# Recommended: isolated but globally available on your PATH
pipx install db-conn-mcp
# or plain pip
pip install db-conn-mcpThis installs the db-conn-mcp command.
Upgrade
Not sure how you installed it? Each manager keeps its own registry — ask them:
pipx list # db-conn-mcp listed here → pipx
uv tool list # listed here → uv tool
pip show db-conn-mcp # found in the current Python env → pipIf none of those know it, your MCP client config is likely launching it via uvx (check the command in the client's config entry — that entry is the source of truth for what actually runs, and which db-conn-mcp / Get-Command db-conn-mcp shows the binary on your PATH).
Then use the matching upgrade command:
pipx upgrade db-conn-mcp # pipx
pip install --upgrade db-conn-mcp # pip
uv tool upgrade db-conn-mcp # uv toolRunning via uvx (e.g. in an MCP client config)? There's nothing installed to upgrade, but uvx caches resolved versions — use db-conn-mcp@latest as the command to always resolve the newest release, or run uv cache clean db-conn-mcp to force a re-resolve.
After upgrading, restart/reconnect your AI client so it picks up the new version (and any new tools). Verify with db-conn-mcp -v.
You don't have to remember to check. When you run a db-conn-mcp subcommand in a terminal, it prints a single line if a newer release is published — looked up in the background, so it never slows a command down or changes its exit code (offline just means no line). Set DBCONNMCPNOUPDATE_CHECK=1 to silence it. The server your MCP client launches never checks; db-conn-mcp doctor is the deliberate, authoritative version of the same question.
Shortened. The full README is on GitHub.
Nothing above is checked by us. What we check is on the safety report.
DB Conn: common questions
- Is DB Conn MCP server safe?
- Yes, by our scan: it is graded A (86/100). Read the DB Conn safety report
- How do I install DB Conn?
- It runs on your machine. Copy the Claude Code, Cursor, VS Code or Claude Desktop config from the install section.
- Does DB Conn need an API key?
- Not as far as the registry entry and our scan can tell: no credentials are declared or required.
- Is DB Conn maintained?
- The last commit was 84 days ago (2026-08-13). The latest release is v0.7.1.
- How does DB Conn compare with other MCP servers?
- safety score 86/100 (higher than 72% of 48,243 servers); tools 23 (the typical server has 7); tools that change things 13% (typical: 0%. Fewer write tools means less an agent can break). Full comparison.