MCP Multi DB logo

MCP Multi DB

by mahAnuj

Read-only MCP access to PostgreSQL, MySQL, and SQLite through one server with schema discovery and query limits.

Install MCP Multi DB

Pick your client, then add it in one click or paste the config.

STDIONode.js
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "mahanuj-mcp-multi-db": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-multi-db"
      ],
      "env": {
        "MCP_DB_CONFIG": "YOUR_VALUE_HERE",
        "MCP_DATABASES": "YOUR_VALUE_HERE"
      }
    }
  }
}

Settings → Developer → Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

Values are written into the snippet above so you can paste it as is. They never leave your browser.

Automated check passed— started and listed 4 tools correctly ().

Overview

mahAnuj/mcp-multi-db connects one MCP server to configured PostgreSQL, MySQL, and SQLite databases. Agents can discover connections, inspect tables and columns, and run read-only SELECT, WITH, or EXPLAIN queries by database ID. Read-only behavior is enforced both by SQL checks and database-level transactions, with row limits and query timeouts available. Reach for it when an agent needs consistent, schema-aware access to several SQL engines without separate MCP servers.

Use cases

  • Inspect schemas across PostgreSQL, MySQL, and SQLite
  • Run read-only analytics against several configured databases
  • Generate reports without permitting data mutations
  • Restrict agents to approved tables and redacted columns

Key features

  • Connects PostgreSQL, MySQL, and SQLite through one MCP server
  • Lists databases, tables, views, and column metadata
  • Runs read-only SELECT, WITH, and EXPLAIN queries
  • Enforces SQL and database-level read-only controls
  • Supports row limits, timeouts, rate limits, and audit logging
  • Provides optional table policies and column redaction

Tools4

What MCP Multi DB lets your agent do. Expand a tool for its parameters.

Verified live~478 tokens of context

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked

Recent health check succeeded.

27/27 checks healthy over the last 111d

What it can do

From the 4 tools this server returned when we ran it.

Runs commands · 1Read-only tools · 3
Network at startup3 connections
Files written at startupNone
Install scriptsNone
npm provenanceNot published
Package age145 days
Maintainers1

Observed 2026-11-13 in an isolated sandbox. A description of reach, not a security audit.

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 11d ago via OSV.dev · mcp-multi-db (npm)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars1Stargazers on the source repository.
npm downloads545Package downloads in the last 30 days.
Last commit18d agoMost recent push to the default branch.
Availability100%Our rolling endpoint + install checks that succeeded.
Install checkPassedOur sandbox started it and listed its tools.
Tools exposed4Callable tools this server registers over MCP.
Directory activity8 viewsConfig copies, upvotes, and views on AllMCPs.

How MCP Multi DB works

What mahAnuj/mcp-multi-db does

mahAnuj/mcp-multi-db provides one MCP endpoint for multiple SQL database engines: PostgreSQL, MySQL, and SQLite. Each connection receives a unique ID, and the agent selects that ID when inspecting or querying a database. Human-readable labels and descriptions can help distinguish connections in the agent's context.

The server exposes four tools:

  • list_databases returns configured connections and their effective row limits.
  • list_tables lists tables and views for a selected database.
  • describe_table returns column metadata for a table.
  • run_query executes read-only SQL using SELECT, WITH, or EXPLAIN statements.

It fits database exploration, reporting, and read-only analytics workflows where the agent needs to work across different SQL backends through a consistent interface.

How it works

The server communicates with MCP clients over standard input and output. An MCP client starts npx -y mcp-multi-db and passes the database configuration through the environment. The agent first identifies a connection, then can inspect its tables and columns before submitting a query.

Queries are protected by two checks: a SQL-text guard rejects unsupported write operations, and the database adapter uses read-only transaction behavior. Results are bounded by a default row count and a maximum row count. The server-wide maximum cannot exceed 10,000 rows, and adapters stop fetching when the applicable cap is reached.

Optional per-database policies can restrict exposed tools, allow or deny tables, redact columns, narrow row limits, apply query budgets, and record tool activity in JSONL audit logs. Table policies are evaluated from the database engine's query plan for PostgreSQL and SQLite, while column redaction uses result-column origin metadata so aliases do not bypass it.

Setup and configuration

Install is not required for the normal launch path; npx downloads the package when needed. Create a JSON configuration containing a databases array. PostgreSQL and MySQL entries use a connectionString; SQLite entries use an absolute path. Every entry requires a unique id and a type of postgres, mysql, or sqlite.

Set MCP_DB_CONFIG to the configuration file path. MCP_DATABASES can instead hold the JSON inline. The file or inline value may be either an object containing databases or a bare array. Do not commit configuration files containing credentials, and prefer read-only database users.

A standard client registration uses:

config.json
{
  "command": "npx",
  "args": ["-y", "mcp-multi-db"],
  "env": {
    "MCP_DB_CONFIG": "/absolute/path/to/databases.json"
  }
}

The server can also be installed globally with npm and launched as mcp-multi-db.

Tools and capabilities

Schema discovery is built into the tool set, allowing an agent to identify available databases, enumerate tables or views, and inspect column metadata before composing SQL. run_query supports read-only analytical statements rather than mutations.

Configuration can set limits.defaultRows and limits.maxRows globally. A database policy may reduce those values, but cannot increase the server-wide limits. Governance options include a per-database tool list, table allowlists or denylists, column redaction, statement timeouts for PostgreSQL and MySQL, per-database query rate limits, and audit records that omit result values. Audit entries can store full SQL or a SHA-256 SQL hash.

Limitations and notes

The server is read-only by design; it is not intended for INSERT, UPDATE, DELETE, schema changes, or other mutations. Table allow and deny policies are supported for PostgreSQL and SQLite. Statement timeouts are available for PostgreSQL and MySQL but not SQLite. The hard row ceiling is 10,000, regardless of configuration. SQLite connections use database file paths, while PostgreSQL and MySQL connections use standard connection URIs.

Written by AllMCPs with AI assistance from the project’s README and listing data. How we build listings

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about MCP Multi DB

mahAnuj/mcp-multi-db is an MCP server that connects agents to PostgreSQL, MySQL, and SQLite databases. Its main tools list configured databases, list tables, describe table columns, and run read-only SELECT, WITH, or EXPLAIN queries through one MCP connection.

Run it with `npx -y mcp-multi-db`; no separate installation is required for the normal setup. Configure `MCP_DB_CONFIG` with the path to a JSON database configuration, then register the command with an MCP client.

Yes, mahAnuj/mcp-multi-db works with Cursor through its stdio MCP configuration. Add `npx` with `-y mcp-multi-db` as the command and set `MCP_DB_CONFIG` to the database configuration path in Cursor's MCP settings.

Define each connection in a JSON `databases` array with a unique `id` and database `type`. PostgreSQL and MySQL entries use `connectionString`, while SQLite entries use an absolute `path`; expose the file through `MCP_DB_CONFIG` or inline it with `MCP_DATABASES`.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewMCP Multi DB AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/mahanuj-mcp-multi-db?style=directory)](https://allmcps.com/mcp/mahanuj-mcp-multi-db)
HTML Embed
<a href="https://allmcps.com/mcp/mahanuj-mcp-multi-db"><img src="https://allmcps.com/api/badge/mahanuj-mcp-multi-db?style=directory" alt="MCP Multi DB on AllMCPs" /></a>