multi-db-mcp
Provides read-only SQL access to MariaDB databases through the MySQL engine. Tools include listing databases, running read-only queries with optional parameters and row limits, listing tables/views, and describing table schemas, with replica/read-only safety checks and bounded result sizes.
Provides read-only SQL access to configured MySQL databases, including Aurora-compatible endpoints. Tools include listing databases, running read-only queries with optional parameters and row limits, listing tables and views with approximate row counts, and describing table columns and indexes. Safety checks enforce replica/read-only status and run statements in read-only transactions.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@multi-db-mcpshow me the users table schema in production"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
multi-db-mcp
An MCP server for read-only SQL against several named databases (local, staging, production, …) from one place. It supports MySQL (including MariaDB and Aurora) and Postgres.
Safety model
Rule | How it's enforced |
Non-local databases must be read replicas | Before every statement, on the same connection and inside the same transaction, the server checks for |
"Local" means a loopback address, written out in the config | Only |
Entries can't turn the replica check off |
|
SSH tunnels / port forwards | A tunnel to prod looks like |
Nothing writes | Every statement runs in |
Bounded cost | Each entry has a server-side statement timeout ( |
Even so, give each entry a database user that only has read access. These checks protect you, but they shouldn't replace proper grants.
Related MCP server: Common Database MCP Server
Setup
npm install
npm run build
cp databases.example.json databases.json # edit it
cp .env.example .env # put passwords hereAny string in databases.json can use ${ENV_VAR}. Variables come from the MCP client's env or
from a .env file next to the config. Variables already set in the environment take priority.
If an entry is broken (for example, a variable is missing), that entry is skipped and reported by
list_databases; the other entries still work.
Config reference
{
"defaults": { "maxRows": 200, "timeoutMs": 15000 },
"databases": {
"<name>": {
"engine": "mysql" | "postgres",
"host": "...", "port": 3306, "user": "...", "password": "${VAR}", "database": "...",
"description": "shown to the model",
"ssl": true | { "rejectUnauthorized": true, "caFile": "certs/rds-global-bundle.pem" },
"requireReplica": true, // force the replica check on a localhost tunnel
"maxRows": 200, "timeoutMs": 15000
}
}
}The config is read from the MULTI_DB_CONFIG env var, then from the first CLI argument, then from
databases.json in the project root.
Register with Claude Code
claude mcp add multi-db --scope user -- node D:/Projects/multi-db-mcp/dist/index.jsTo use a config stored somewhere else, set the env var:
claude mcp add multi-db --scope user -e MULTI_DB_CONFIG=C:/path/databases.json -- node D:/Projects/multi-db-mcp/dist/index.js.
Tools
list_databases: lists the configured entries. PasscheckConnections: trueto also get each one's version and replica status.query: runs one read statement against a named database, with optional positionalparamsandmaxRows.list_tables: lists tables and views with approximate row counts.describe_table: shows a table's columns and indexes.
Development
npm test # safety unit tests
npm run dev # run from source with tsxThis server cannot be deployed
Maintenance
Related MCP Connectors
Safe, read-only Postgres and MySQL access for AI agents. Audit log + column-level controls.
Query 40 databases from Claude, ChatGPT, or Cursor — on any device. Read-only, encrypted, audited.
Generate, fix, explain and run read-only SQL on PostgreSQL, MySQL and SQL Server
- dataOAuthco.thinair
PostgreSQL, MySQL, and SQL Server in one session. 26 read-only MCP tools for AI agents.
Related MCP Servers
- AlicenseBqualityDmaintenanceProvides secure, read-only access to MariaDB/MySQL databases, allowing users to list databases, explore table schemas, and execute SQL queries with built-in security measures.446 npm4MIT
- AlicenseNot gradedqualityDmaintenanceEnables safe exploration and querying of multiple databases (PostgreSQL, MySQL, SQLite, DB2) with read-only defaults, connection pooling, and parameterized queries for SQL injection prevention.1MIT
- AlicenseNot gradedqualityBmaintenanceProvides secure read-only SQL access to PostgreSQL and ClickHouse databases with built-in safety features like read-only enforcement, timeouts, and managed result files.286 PyPIMIT
- FlicenseNot gradedqualityDmaintenanceEnables read-only SQL querying and schema inspection across MSSQL, PostgreSQL, and MySQL databases via MCP tools.-