Db Conn MCP
Self-hosted server for letting AI agents explore and query PostgreSQL safely
- Platforms
- CLI, self-hosted, macOS
- Runs
- Locally
- Version
- 0.8.2
- Listing updated
- today
Similar MCP servers
About Db Conn MCP
Db Conn MCP is an MCP server for databases. It runs locally on your machine and is started by your AI client.
db-conn-mcp keeps database access simple: a static connections.json file and the database's own read-only transactions, instead of custom auth servers or SQL parsing. Version 1 supports PostgreSQL only, with database-specific code behind a Dialect seam so MySQL or SQLite could be added later.
For connections in read mode every query runs in a native read-only transaction, and the read tool accepts only a single read-only statement. For a hard guarantee the README suggests pointing the DSN at a read-only role. Connection strings and passwords are never logged or returned, and failures come back as sanitized diagnostics. Writes are tiered: the connection mode, then a dry-run preview that must precede a commit, then optional per-database yolo trust, then explicit consent.
An interactive db-conn-mcp setup wizard registers a database and writes the server into nine popular AI clients' config formats, and db-conn-mcp gui opens a local dashboard that also checks clients can launch it. It needs Python 3.12 or newer and installs with pipx or pip. Optional fallback ports help with SSH tunnels that change port.
Install
Run in a terminal
claude mcp add db-conn-mcp -- uvx db-conn-mcpAdd to claude_desktop_config.json
{
"mcpServers": {
"db-conn-mcp": {
"command": "uvx",
"args": [
"db-conn-mcp"
]
}
}
}Add to ~/.cursor/mcp.json
{
"mcpServers": {
"db-conn-mcp": {
"command": "uvx",
"args": [
"db-conn-mcp"
]
}
}
}Add to .vscode/mcp.json
{
"servers": {
"db-conn-mcp": {
"type": "stdio",
"command": "uvx",
"args": [
"db-conn-mcp"
]
}
}
}Add to ~/.codeium/windsurf/mcp_config.json
{
"mcpServers": {
"db-conn-mcp": {
"command": "uvx",
"args": [
"db-conn-mcp"
]
}
}
}Add to your client's MCP settings (most use this shape)
{
"mcpServers": {
"db-conn-mcp": {
"command": "uvx",
"args": [
"db-conn-mcp"
]
}
}
}Using several servers? Build one config file with the MCP config generator.
Tools this server provides (2)
Taken from the project documentation; the running server may differ.
- list_databases
- Lists configured databases and their active port.
- check_database
- Checks a configured database connection.
What it does
- Native read-only mode
- Read connections run in read-only transactions and accept one read statement.
- Secret hygiene
- DSNs and passwords are never logged or returned.
- Tiered write safety
- Mode, dry-run preview, yolo trust and consent gate writes.
- Setup wizard
- Registers a database and configures nine AI clients.
- Local dashboard
- `db-conn-mcp gui` manages connections and tests client launch.
- Fallback ports
- Probes listed ports when the primary refuses, for tunnels.
Good for
- Let an agent explore a production schema read-only
- Run exploratory queries against a staging database
- Preview a write before committing it
- Wire one database into several AI clients at once
Db Conn MCP FAQ
Which databases are supported?
PostgreSQL in v1.
Can an agent write to my database?
Only on connections in `write` mode, after a dry-run preview and consent unless `yolo` is set.
Are my credentials exposed?
No. DSNs are never shown by any tool, and errors are sanitized.
What Python version is needed?
Python 3.12 or newer.
How do I add Db Conn MCP to Claude Code?
Run this command in your terminal: claude mcp add db-conn-mcp -- uvx db-conn-mcp
What are the best alternatives to Db Conn MCP?
The closest alternatives to Db Conn MCP are Midplane, Postgres Secured (Aegis Zero-Trust), ArcadeDB, Seqora and Snowflake timestamp bits, id discarded.
Where this comes from
- Description: written from the project's README.
- Install steps: from the official MCP Registry entry.