# ugurcl/dbridge-mcp [Health: Active]

**Category:** 🗄️ Databases  
**Repository:** https://github.com/ugurcl/dbridge-mcp  
**GitHub Stars:** 1  
**npm Downloads (last month):** 166  
**Views:** 3  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/ugurcl-dbridge-mcp

## Description
Query SQLite, PostgreSQL, and MySQL in plain language — read-only by design, with column hiding/masking, row caps, per-query timeouts, cost-based rejection, and rate limiting.

## Tools
Capabilities this server exposes over MCP:

- **list_tables** — List every table in the database.
- **describe_table** — Return a table's columns, primary key, foreign keys, and row-count estimate.
- **sample_table** — Preview the first rows of a table (`json`/`csv`/`markdown`).
- **count_rows** — Return the exact row count of a table.
- **run_query** — Run a single read-only `SELECT` / `WITH` and return rows as `json`, `csv`, or `markdown`.
- **explain_query** — Return a query's plan and estimated cost without running it.
- **column_stats** — Per-column distinct-value counts and null fractions — is this column selective enough to index?
- **index_health** — List indexes with sizes and scan counts, flagging unused, duplicate, and invalid ones.
- **test_index** — Simulate a `CREATE INDEX` without building it and report whether the planner would use it (PostgreSQL, via [hypopg](https://github.com/HypoPG/hypopg)).
- **slow_queries** — The most expensive recorded statements with call counts and timings (PostgreSQL `pg_stat_statements`, MySQL `performance_schema`).
- **get_limits** — Report the safety limits in effect (caps, timeouts, hidden/masked columns).

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "dbridge-mcp": {
    "command": "npx",
    "args": ["-y","dbridge-mcp"]
  }
}
```

## Documentation

## What ugurcl/dbridge-mcp MCP server does

ugurcl/dbridge-mcp MCP server gives an MCP-compatible client a guarded, read-only view of a SQL database. It supports SQLite, PostgreSQL, and MySQL/MariaDB, using the connection argument to determine which engine to use. A file path selects SQLite, while `postgres://`, `postgresql://`, and `mysql://` connection strings select the corresponding network database.

The server is suited to natural-language data questions because the agent can first inspect the available schema and then produce a query for the user’s request. It also exposes database metadata and performance information for tasks that go beyond retrieving rows.

## How it works

Schema discovery is available through table listing, table descriptions, and a schema resource. Query execution accepts one `SELECT` or `WITH` statement and can format results as JSON, CSV, or Markdown. Query plans can be inspected without executing the query, while row counts, samples, column statistics, index information, and recorded slow statements support analysis and troubleshooting.

ugurcl/dbridge-mcp MCP server applies multiple restrictions around database access. The SQL guard rejects writes, DDL, and data-modifying common table expressions. Queries use read-only database access, and PostgreSQL and MySQL queries also run in read-only transactions. Row limits still apply when a submitted query contains a larger `LIMIT`. PostgreSQL and MySQL queries have per-query timeouts, and expensive queries can be rejected based on estimated cost.

Column privacy can be configured by hiding columns from the model or masking their values while keeping them available for querying. Rate limits and a capped connection pool further limit request volume and concurrent database use.

## Setup and configuration

The package requires Node.js 22.5 or newer. SQLite uses Node’s built-in `node:sqlite`, so the documented npm runner does not require a native compilation step. The published package can be started with `npx -y dbridge-mcp` followed by a database path or connection string.

A configuration file can be supplied through the `DBRIDGE_CONFIG` environment variable. The README shows this variable in Claude Desktop, Claude Code, and OpenCode configurations. MCP clients start the process as a subprocess; examples are provided for Claude Desktop, Cursor, Windsurf, and Claude Code. Docker usage is also documented, including read-only mounting of a configuration file.

## Tools and capabilities

The available tools include:

- `list_tables`, `describe_table`, `sample_table`, and `count_rows` for schema and table inspection.
- `run_query` for one read-only query with selectable output formatting.
- `explain_query` for a plan and estimated cost without execution.
- `column_stats` for distinct-value counts and null fractions.
- `index_health` for index sizes, scan counts, and unused, duplicate, or invalid index flags.
- `test_index` for PostgreSQL hypothetical index testing through HypoPG.
- `slow_queries` for recorded statement timings and call counts where PostgreSQL `pg_stat_statements` or MySQL `performance_schema` is available.
- `get_limits` for reporting active caps, timeouts, and column privacy settings.

The server also provides the `dbridge://schema` resource and an `optimize` prompt for a guided performance review. The prompt examines slow queries, plans, and index health, then validates index recommendations with `test_index` before suggesting them.

ugurcl/dbridge-mcp MCP server is a fit for read-only analytics, private-data question answering, and database diagnostics. It is not intended for migrations, updates, inserts, deletes, schema changes, or other write workflows.

_Full upstream README: https://allmcps.com/mcp/ugurcl-dbridge-mcp/readme_

