# mcp-multi-db

> mcp-multi-db is an open-source MCP server for databases. Read-only MCP server letting AI agents query PostgreSQL, MySQL and SQLite together. It is available on CLI, API, Linux, macOS, Windows and Self-hosted.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** CLI, API, Linux, macOS, Windows, Self-hosted
- **Repository:** https://github.com/mahanuj/mcp-multi-db
- **GitHub stars:** 1
- **License:** ISC
- **Categories:** [databases](https://ai-powered.com/categories/databases)
- **Listing updated:** 2026-12-01

## About

Rather than running one MCP server per database, this server connects an AI client to several SQL databases at once. Connections are declared in a single config file, and the agent selects the target by database identifier before it inspects tables or runs a query.

Every query runs under two layers of protection: a SQL text guard that rejects writes and DDL, and a database-level read-only transaction. Row caps and statement timeouts keep results bounded. An optional governance layer adds per-database tool scoping, table allow and deny lists checked against the query plan, column redaction that holds under aliasing, query budgets and a JSONL audit log.

It suits developers and analysts who want an assistant to explore live operational or analytics data without giving it write access, and teams that need an audit trail of what was run against which database.

## Features

- **Multiple engines in one server:** Connects PostgreSQL, MySQL and SQLite databases side by side through a single MCP endpoint.
- **Read-only enforcement:** Blocks writes through a SQL guard and runs each statement inside a read-only database transaction.
- **Schema discovery:** Lets the agent list databases, tables, views and column metadata before writing a query.
- **Row and time limits:** Caps returned rows and sets statement timeouts so runaway queries are bounded.
- **Opt-in governance:** Offers per-database tool scope, table allow and deny lists, column redaction, rate limits and an audit log.

## Good for

- Letting an assistant explore a production read replica without risking writes
- Querying analytics and reporting databases from one chat session
- Giving a team's AI tools schema-aware access to SQL data with an audit trail
- Restricting which tables and columns an agent can see on sensitive databases

## Tools

From the tool list in its README, going by the names, 1 of 4 tools changes data. From the server's own tool labels and tool names; not verified by us.

- `list_databases` (name suggests: reads): List configured database connections
- `list_tables` (name suggests: reads): List tables/views in a database
- `describe_table` (name suggests: reads): Show column metadata for a table
- `run_query` (name suggests: changes): Run read-only SQL (SELECT, WITH, EXPLAIN)

## FAQ

### Can the agent modify data?

No. Inserts, updates, deletes and DDL are blocked by a SQL guard and by read-only database transactions.

### Which databases are supported?

PostgreSQL, MySQL and SQLite. Other engines would need a new adapter.

### How is the server installed?

It runs with npx mcp-multi-db or as a global npm install, and it also ships a Docker image. It speaks MCP over stdio.

### Are governance features required?

No. Without a policy or audit section, a database behaves with the default read-only protections only.

### Is mcp-multi-db free?

Yes. mcp-multi-db is open source, so you can use and self-host it for free.

### What are the best alternatives to mcp-multi-db?

The closest alternatives to mcp-multi-db are db-mcp-server, sql-query-mcp, thinair-data, Custom MCP Database and DB MCP.

## Where this comes from

- Description: written from the project's README.

## Alternatives

- [db-mcp-server](https://ai-powered.com/mcp/db-mcp-server-2): db-mcp-server is an open-source MCP server for databases.
- [sql-query-mcp](https://ai-powered.com/mcp/sql-query-mcp): sql-query-mcp is an open-source MCP server for databases.
- [thinair-data](https://ai-powered.com/mcp/thinair-data): thinair-data is an MCP server for databases.
- [Custom MCP Database](https://ai-powered.com/mcp/custom-mcp-database): Custom MCP Database is an open-source MCP server for databases.
- [DB MCP](https://ai-powered.com/mcp/db-mcp): DB MCP is an open-source MCP server for databases.
- [MultiDB MCP](https://ai-powered.com/mcp/multidb-mcp): MultiDB MCP is an open-source MCP server for databases.
- [MCP Postgres](https://ai-powered.com/mcp/mcp-postgres): MCP Postgres is an open-source MCP server for databases.
- [Raw SQL MCP](https://ai-powered.com/mcp/raw-sql-mcp): Raw SQL MCP is an open-source MCP server for databases.

---
Source: https://ai-powered.com/mcp/mcp-multi-db
