query_<db_id>LABSCO SUMMARY
read_only is enforced at the database engine, not just in the tool layer.
Marking a connection read-only blocks writes through both the query and execute tools and sets the engine's own read-only transaction mode on PostgreSQL and MySQL, with SQLite opened in read-only mode. Combined with max_rows truncation that says so explicitly and column masking by regex on result column names, this is the rare database bridge you can point at something that matters.
What it is
A server that connects to multiple databases concurrently and generates a set of tools per connection, so each database gets its own query, execute, transaction, schema and performance surface.
What you get
- query_<db_id>, execute_<db_id> and transaction_<db_id> — SELECTs, data modification, and begin/commit/rollback per database
- schema_<db_id> and generate_schema_<db_id> — tables, columns, indexes and foreign keys, and SQL or code generated from them
- explain_<db_id> and describe_<db_id> — execution plans without running the statement, and one table's columns, indexes and row estimate
- performance_<db_id> — slow-query stats, static SQL lint, index suggestions, and on PostgreSQL a hypopg-backed check of whether the planner would actually use each suggested index
- health_<db_id> — connectivity, ping latency, pool state, and engine cache statistics
- TimescaleDB extras on PostgreSQL databases that have the extension: time-bucketed queries, hypertable and continuous-aggregate listings, compression and retention settings
- A unified tool mode that collapses the per-database naming into one set taking a database parameter, for when 5+ connections blow past a client's tool limit
- Lazy loading, so connections are only established on first use
Requirements
A JSON connections file listing each database with an id, type, host, port, name, user and password. Oracle also accepts TNS entries and wallets. Per-database guardrails are set in the same file: read_only, max_rows, query_timeout and masking_rules. Set DB_MCP_AUDIT_LOG to a path for a JSONL record of every executed statement.
Setup effort
Build from source — git clone https://github.com/FreePeak/db-mcp-server.git
USE CASES
Answering a question that spans two systems
Query the MySQL app database and the Postgres analytics database in the same conversation, each with its own tools.
Letting an assistant explore production safely
Mark the connection read_only and set max_rows, so writes are refused by the engine and result sets stay bounded.
Working out why a query is slow
Read the plan without executing, get index suggestions, then check on PostgreSQL whether the planner would really pick them.
Connecting more databases than your client will show tools for
Switch to unified mode so five databases stop meaning five times the tools.
31 tools
Listed in project docs. Your client may show a different list.
execute_<db_id>transaction_<db_id>schema_<db_id>generate_schema_<db_id>performance_<db_id>explain_<db_id>describe_<db_id>health_<db_id>timescaledb_timeseries_query_<db_id>timescaledb_analyze_timeseries_<db_id>timescaledb_list_hypertables_<db_id>timescaledb_compression_settings_<db_id>timescaledb_retention_policy_<db_id>timescaledb_list_continuous_aggregates_<db_id>timescaledb_continuous_aggregate_info_<db_id>queryexecutetransactionperformanceexplaindescribeschemafilter_tablestimescaledb_timeseries_querytimescaledb_analyze_timeseriestimescaledb_list_hypertablestimescaledb_compression_settingstimescaledb_retention_policytimescaledb_list_continuous_aggregatestimescaledb_continuous_aggregate_infoBEFORE YOU INSTALL
What to know first
Tools you get
31 tools named in the project's documentation.
Where it runs
The documented client runs the server on your machine.
INSTALLATION
Connect your client
Server setup
# Clone the repository
git clone https://github.com/FreePeak/db-mcp-server.git
cd db-mcp-server
# Build the server
make build
# Run the server
./bin/server -t sse -c config.jsonMCP Clients
Cursor
{
"mcpServers": {
"stdio-db-mcp-server": {
"command": "<YOUR_PATH_TO_DB_MCP_SERVER>/bin/server",
"args": [
"-t",
"stdio",
"-c",
"<YOUR_PATH_TO_CONFIG>"
]
}
}
}Use the full path to bin/server inside your db-mcp-server clone (what make build produces) and to your own connections config.json.