
Dbridge Mcp
io.github.ugurclPublished by GitHub account ugurclv0.7.1Updated Nov 3, 2026
Query SQLite, PostgreSQL, and MySQL in plain language - read-only, with column masking and limits.
Overview
Read-only MCP server that lets an assistant explore and query SQLite, PostgreSQL and MySQL databases in plain language, with masking and row caps.
- What you can do
- Discover schema: list tables, describe columns, keys and row counts, preview sample rows, count rows
- Query data: run a single read-only SELECT or WITH and get results as JSON, CSV or markdown, or inspect a query plan and estimated cost
- Analyze performance: per-column cardinality and null fractions, index sizes and scan counts, simulated index tests, and the slowest recorded statements
- Check safety settings: report the row caps, timeouts and hidden or masked columns currently in effect
- Read the full schema as one JSON resource and follow a guided optimization prompt
- When to use it
- Useful when you want an assistant to answer questions about a real SQL database, or to advise on indexes and slow queries, without giving it write access. It fits reporting and analysis work on data you care about, including production databases, where the built-in guardrails matter.
- Requirements
- Runs locally over stdio via npx or a global npm install; Node.js 22.5 or newer. A connection argument is required: a SQLite file path, or a PostgreSQL or MySQL/MariaDB connection string containing credentials. Optional DBRIDGE_CONFIG points to a JSON file with safety settings; other limits can be set by CLI flags or DBRIDGE_ environment variables. On Windows, launch through cmd /c.
Installation
In SourceWeft
- Open Dbridge Mcp in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
README
dbridge-mcp
An MCP server that lets an AI agent query a SQL database in plain language — safely and read-only.
[CI] [npm] [node >=22.5] [MIT license]
[dbridge-mcp demo: an AI agent answering a question by querying the database]
The agent discovers the schema on its own (list_tables, describe_table), then writes and runs a SELECT for whatever the user asks. No hand-written endpoint per question.
Works with SQLite, PostgreSQL, and MySQL / MariaDB.
Why
A raw LLM cannot know what is inside your database, and web search cannot reach private data. dbridge gives the model a guarded door to that data: it can read and answer, but it cannot write, drop, or leak the whole table.
Why dbridge and not another database MCP?
There are many database MCP servers. dbridge is built around one idea — you should be able to point an AI at a real database without holding your breath — and that shows up as a combination the single-engine servers don't offer:
- One server, three engines. SQLite, PostgreSQL, and MySQL/MariaDB behind the same tools and the same config. Switch databases by changing the connection string, not the tooling.
- Read-only twice over. A SQL guard rejects anything but
SELECT/WITHand every query runs inside a database-enforcedREAD ONLYtransaction — so even a query that outsmarts the guard cannot write. - Column-level privacy. Hide columns from the model entirely, or mask values (
a***@site.com) while keeping them queryable. Most servers expose whatever the connection can see. - Blast-radius controls. Row caps enforced over user-supplied
LIMITs, per-query timeouts,EXPLAIN-based cost rejection for expensive queries, per-minute rate limits, and a capped connection pool. - No native build step. SQLite uses Node's built-in
node:sqlite, sonpx -y dbridge-mcpworks without a compiler toolchain. - Performance insight, not just queries.
column_statsandindex_healthgive the model real cardinality and index-usage data, andtest_indexsimulates an index with hypopg before anyone builds it — so the model's optimization advice is grounded in the actual database instead of guesswork.
If all you need is "run SQL from my agent", plenty of servers do that. dbridge is for pointing an agent at data you actually care about.
Tools
Resources
Prompts
Requirements
Node.js 22.5+ (SQLite uses the built-in node:sqlite, no native build step).
Install
The published package ships a dbridge-mcp binary, so no clone or build step is needed to use it. Point it at a database with the connection argument:
The database engine is chosen from the connection string: a file path is SQLite, postgres:// / postgresql:// is PostgreSQL, and mysql:// is MySQL/MariaDB.
Or install it once, globally:
MCP clients start the server for you as a subprocess — see the client sections below.
Windows note: MCP clients cannot launch
npxdirectly on Windows because it is a.cmdscript. Wrap it withcmd /c— use"command": "cmd"and put"/c", "npx", "-y", "dbridge-mcp", "<connection>"in the args. The examples below use the direct form (macOS/Linux); on Windows add thecmd /cprefix.
Use it in Claude Desktop
Claude Desktop only supports a single global config. Add to claude_desktop_config.json:
For a local SQLite file, replace the connection string with an absolute path to the .db file. Restart Claude Desktop, then ask: "what were the 5 best-selling products last month?"
Use it in Claude Code
Add it to the current project with the CLI:
--scope project writes a shareable .mcp.json in the project root; use --scope user for a global server or omit it for a private per-project one. The .mcp.json looks like:
Run claude from that directory; approve the project server once, then check it with /mcp.
Use it in Cursor
Add the same mcpServers block to .cursor/mcp.json in the project root (or ~/.cursor/mcp.json for all projects), enable the server under Settings → MCP, then ask the Agent a question about your data.
Use it in Windsurf
Add the same mcpServers block to ~/.codeium/windsurf/mcp_config.json, then refresh the server list under Settings → Cascade → MCP.
Use it in OpenCode
Add to opencode.json (project root or ~/.config/opencode/opencode.json):
To tune the safety guard, point the server at a config file with the environment block:
Docker
Build the image and run the server over stdio:
Mount a config file and point DBRIDGE_CONFIG at it:
Safety
- The connection is opened read-only. On PostgreSQL and MySQL every query also runs inside a
READ ONLYtransaction, so writes are rejected by the database itself even if a query slips past the guard. - Only
SELECTandWITHstatements pass; writes, DDL, and data-modifying CTEs are rejected. - A single statement per call; the row cap is enforced even when a query supplies its own larger
LIMIT(default 1000 rows). - Each PostgreSQL and MySQL query is bounded by a per-query timeout (
statement_timeout/max_execution_time), so a runaway or expensive query cannot pin the database. - System catalogs and credential tables (
information_schema,pg_authid,sqlite_master, …) are not queryable; schema discovery goes through the tools. - Restricted columns can be hidden entirely: the model cannot see them in the schema, query them, or receive them in results.
- Tables can be restricted with an allow-list or block-list; blocked tables are invisible and unqueryable.
- Columns can be masked instead of hidden: they stay visible but values come back partially redacted (e.g.
a***@site.com). - Expensive queries can be rejected up front by an
EXPLAINcost estimate, and callers can be rate-limited per minute. - The connection pool size is capped, so dbridge cannot exhaust the database's connections.
Config
Every setting has three sources, in increasing precedence: a JSON file (DBRIDGE_CONFIG), environment variables, then CLI flags. So you can drop the JSON file entirely and set only what you need:
Or keep everything in one place: point DBRIDGE_CONFIG at a JSON file (see dbridge.config.example.json for a full template). Every field is optional:
List values on the command line or in env vars are comma-separated (--allowed-tables products,sales).
Engine note: statementTimeoutMs, maxCost, maxPoolSize, connectionTimeoutMs, requireSsl, and schemas apply to the networked engines (PostgreSQL/MySQL). SQLite is a local file, so it ignores them; the row cap, column/table access control, and masking apply to every engine.
Column masking
maskedColumns keeps a column visible but redacts its values. Each entry is either a column name (defaults to the partial strategy) or an object { "column": ..., "strategy": ..., "keep": ... }:
Unlike hiddenColumns, a masked column can still be used in WHERE/GROUP BY, so use hiddenColumns for true secrets and maskedColumns for values that should be recognizable but not exposed.
Output formats
run_query and sample_table take an optional format argument: json (default, full result object), csv, or markdown. CSV and Markdown return a compact table prefixed with a short rows: N · Nms header — handy for fewer tokens and readable output. Combine with maxCellChars and maxResultBytes to keep large results in check.
Running against a production database
- Pass the connection string via the
DBRIDGE_DB_PATHenvironment variable instead of the command line, so the password does not appear in the process list. - Prefer a dedicated database role with read-only grants on only the tables you want exposed — that is the real security boundary; the guard is defense in depth.
- Set a conservative
statementTimeoutMs,maxRows, andmaxCost, and useallowedTablesto expose only reporting tables.
Local development
To hack on dbridge itself, clone the repo and build from source:
Try it with the MCP Inspector
Then call the tools from the Inspector UI. No LLM or API key needed.
Tests
Changelog
See CHANGELOG.md.
License
MIT
Source: README.md at commit f2a8779
Tools
0Version history
1- v0.7.1LatestSep 16, 2026
Score
40% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 days25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declared10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts
Declare a license in the repository or the registry entry.