
Multi Database MCP Server
Give AI assistants structured access to MySQL, PostgreSQL, SQLite, Oracle, and TimescaleDB simultaneously.
Add to your client
Copy the config for your MCP client and paste it into its config file.
docker pull freepeak/db-mcp-server:latestPaste into ~/Library/Application Support/Claude/claude_desktop_config.json
{
"mcpServers": {
"multi-database-mcp-server": {
"command": "/path/to/db-mcp-server/server",
"args": [
"-t",
"stdio",
"-c",
"/path/to/config.json"
]
}
}
}Step-by-step guides: Add to Claude Desktop · Add to Cursor · Add to Windsurf
Before you start
- A built server binary (via `make build` from source) or the freepeak/db-mcp-server Docker image
- A config.json file declaring your database connections (or inline JSON via -db-config / DB_CONFIG)
- Network access and valid credentials for the target databases (MySQL, PostgreSQL, SQLite, Oracle, and/or TimescaleDB)
About Multi Database MCP Server
A powerful multi-database MCP server implementing the Model Context Protocol to give AI models structured access to multiple databases at once. It can connect to MySQL, PostgreSQL, SQLite, Oracle, and TimescaleDB concurrently and dynamically generates a set of specialized tools (query, execute, transaction, schema, performance, and TimescaleDB-specific operations) for each connected database. Configuration is via a JSON connections file, supporting per-connection tuning (connection pools, query timeouts), SQLite encryption/in-memory/read-only modes, and Oracle wallet/TNS/RAC options. It can be deployed via Docker, prebuilt binary in STDIO mode (for IDE integration like Cursor) or SSE mode, or built from source.
Tools & capabilities (13)
query_<db_id>Execute SELECT queries and get results as a tabular dataset.
execute_<db_id>Run data manipulation statements (INSERT, UPDATE, DELETE).
transaction_<db_id>Begin, commit, and rollback transactions.
schema_<db_id>Get information about tables, columns, indexes, and foreign keys.
generate_schema_<db_id>Generate SQL or code from the database schema.
performance_<db_id>Analyze query performance and get optimization suggestions.
timescaledb_<db_id>Perform general TimescaleDB operations (PostgreSQL with the TimescaleDB extension).
create_hypertable_<db_id>Convert a standard table to a TimescaleDB hypertable.
list_hypertables_<db_id>List all hypertables in the database.
time_series_query_<db_id>Execute optimized time-series queries with bucketing.
time_series_analyze_<db_id>Analyze time-series data patterns.
continuous_aggregate_<db_id>Create materialized views that automatically update.
refresh_continuous_aggregate_<db_id>Manually refresh continuous aggregates.
What this server can do
Multi Database MCP Server provides tools for these capabilities — tap one to see every MCP server that does the same:
When to use it
- Let an AI assistant in Cursor query and modify data across several databases (e.g. a MySQL and a PostgreSQL instance) in the same context.
- Explore and document database schemas — tables, columns, indexes, and foreign keys — through natural-language requests.
- Manage multi-statement transactions (BEGIN/COMMIT/ROLLBACK) safely from an AI workflow.
- Analyze query performance and get optimization suggestions across heterogeneous database systems.
- Work with time-series data in TimescaleDB: create hypertables, run bucketed queries, and manage continuous aggregates.
Security notes
Database credentials (host, user, password, encryption keys, Oracle wallet paths) are stored in the config.json file or passed via the -db-config flag / DB_CONFIG environment variable; protect this file and avoid committing it. The generated execute_<db_id> and transaction_<db_id> tools allow data-modifying SQL (INSERT/UPDATE/DELETE), so connect with a database user scoped to the minimum required privileges. SQLite supports SQLCipher encryption and read-only mode for sensitive databases.
Multi Database MCP Server FAQ
Which databases are supported?
MySQL, PostgreSQL (v9.6-17), SQLite (file-based and in-memory, with SQLCipher encryption), Oracle (10g-23c, including RAC, Cloud Wallet, and TNS), and TimescaleDB.
How do the tools get their names?
Tools are generated per connection using the connection's id. For a database with id 'mysql1' the server creates query_mysql1, execute_mysql1, transaction_mysql1, schema_mysql1, performance_mysql1, and so on.
What transport modes are available?
STDIO mode (`-t stdio`) for IDE integration such as Cursor, and SSE mode (`-t sse`, default localhost:9092) for Server-Sent-Events / HTTP clients. The Docker image defaults to SSE via TRANSPORT_MODE=sse.
How do I handle many databases efficiently?
Use lazy-loading mode with the `--lazy-loading` flag, which defers connection establishment until first use — recommended for setups with 10 or more databases.
Alternatives to Multi Database MCP Server
Compare all alternatives →Google's official MCP server with prebuilt BigQuery tools, querying datasets via Application Default Credentials.
Read/write Postgres access plus index tuning, EXPLAIN plans, and database health analysis for AI agents.
Official Supabase server: manage tables, run SQL, branches, configs and edge functions from your AI client.
Compare Multi Database MCP Server with: