Includes support link integration for the project via Buy Me A Coffee, allowing users to financially support the development of the MCP server.
Planned for Q4 2025 to provide search-optimized AI interactions with Elasticsearch, enabling context-aware queries and operations.
Listed in the roadmap for Q3 2025 to add support for document-oriented schema understanding, enabling AI reasoning with MongoDB databases.
Enables AI agents to interact with MySQL databases by providing rich context about schema, relationships, and data patterns. Allows execution of SQL queries, data modification operations, and transaction management with full schema awareness.
Provides tools for AI-optimized interaction with PostgreSQL databases, including schema exploration, query execution, and performance analysis. Enables AI to understand and manipulate database structures with schema-aware context.
Planned integration in Q3 2025 roadmap that will provide key-value pattern recognition for AI when working with Redis databases.
Targeted for integration in Q3 2025 to support lightweight database understanding, enabling AI to work with SQLite databases with full context awareness.
Click on "Install 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 Database MCP Servershow me the top 5 customers by total sales from the mysql1 database"
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 Database MCP Server
Overview
The DB MCP Server provides a standardized way for AI models to interact with multiple databases simultaneously. Built on the FreePeak/cortex framework, it enables AI assistants to execute SQL queries, manage transactions, explore schemas, and analyze performance across different database systems through a unified interface.
Related MCP server: MCP Server
Core Concepts
Multi-Database Support
Unlike traditional database connectors, DB MCP Server can connect to and interact with multiple databases concurrently:
Dynamic Tool Generation
For each connected database, the server automatically generates specialized tools:
Clean Architecture
The server follows Clean Architecture principles with these layers:
Domain Layer: Core business entities and interfaces
Repository Layer: Data access implementations
Use Case Layer: Application business logic
Delivery Layer: External interfaces (MCP tools)
Features
Simultaneous Multi-Database Support: Connect to multiple MySQL, PostgreSQL, SQLite, and Oracle databases concurrently
Lazy Loading Mode: Defer connection establishment until first use - perfect for setups with 10+ databases (enable with
--lazy-loadingflag)Database-Specific Tool Generation: Auto-creates specialized tools for each connected database
Clean Architecture: Modular design with clear separation of concerns
OpenAI Agents SDK Compatibility: Full compatibility for seamless AI assistant integration
Dynamic Database Tools: Execute queries, run statements, manage transactions, explore schemas, analyze performance
Unified Interface: Consistent interaction patterns across different database types
Connection Management: Simple configuration for multiple database connections
Health Check: Automatic validation of database connectivity on startup
Supported Databases
Database | Status | Features |
MySQL | ✅ Full Support | Queries, Transactions, Schema Analysis, Performance Insights |
PostgreSQL | ✅ Full Support (v9.6-17) | Queries, Transactions, Schema Analysis, Performance Insights |
SQLite | ✅ Full Support | File-based & In-memory databases, SQLCipher encryption support |
Oracle | ✅ Full Support (10g-23c) | Queries, Transactions, Schema Analysis, RAC, Cloud Wallet, TNS |
TimescaleDB | ✅ Full Support | Hypertables, Time-Series Queries, Continuous Aggregates, Compression, Retention Policies |
Deployment Options
The DB MCP Server can be deployed in multiple ways to suit different environments and integration needs:
Docker Deployment
Note: Mount to
/app/my-config.jsonas the container has a default file at/app/config.json.
STDIO Mode (IDE Integration)
For Cursor IDE integration, add to .cursor/mcp.json:
SSE Mode (Server-Sent Events)
Client connection endpoint: http://localhost:9092/sse
Source Code Installation
Configuration
Database Configuration File
Create a config.json file with your database connections:
Command-Line Options
Available Flags:
-t, -transport: Transport mode (stdioorsse)-c, -config: Path to database configuration file-p, -port: Server port for SSE mode (default: 9092)-h, -host: Server host for SSE mode (default: localhost)-log-level: Log level (debug,info,warn,error)-log-dir: Directory for log files (default:./logsin current directory)-db-config: Inline JSON database configuration
SQLite Configuration Options
When using SQLite databases, you can leverage these additional configuration options:
SQLite Connection Parameters
Parameter | Type | Default | Description |
| string | Required | Path to SQLite database file or |
| string | - | Key for SQLCipher encrypted databases |
| boolean | false | Open database in read-only mode |
| integer | 2000 | SQLite cache size in pages |
| string | "WAL" | Journal mode: DELETE, TRUNCATE, PERSIST, WAL, OFF |
| boolean | true | Use modernc.org/sqlite (CGO-free) or mattn/go-sqlite3 |
SQLite Examples
Basic File Database
Encrypted Database (SQLCipher)
In-Memory Database
Read-Only Database
Oracle Configuration Options
When using Oracle databases, you can leverage these additional configuration options:
Oracle Connection Parameters
Parameter | Type | Default | Description |
| string | Required | Oracle database host |
| integer | 1521 | Oracle listener port |
| string | - | Service name (recommended for RAC) |
| string | - | System identifier (legacy, use service_name instead) |
| string | Required | Database username |
| string | Required | Database password |
| string | - | Path to Oracle Cloud wallet directory |
| string | - | Path to directory containing tnsnames.ora |
| string | - | Named entry from tnsnames.ora |
| string | - | Edition-Based Redefinition edition name |
| boolean | false | Enable driver-level connection pooling |
| boolean | false | Allow queries on standby databases |
| string | AMERICAN_AMERICA.AL32UTF8 | Character set configuration |
Oracle Examples
Basic Oracle Connection (Development)
Oracle with SID (Legacy)
Oracle Cloud Autonomous Database (with Wallet)
Oracle RAC (Real Application Clusters)
Oracle with TNS Entry
Oracle with Edition-Based Redefinition
Oracle Connection String Priority
When multiple connection methods are configured, the following priority is used:
TNS Entry (if
tns_entryandtns_adminare configured)Wallet (if
wallet_locationis configured) - for Oracle CloudStandard (host:port/service_name) - default method
Available Tools
For each connected database, DB MCP Server automatically generates these specialized tools:
Query Tools
Tool Name | Description |
| Execute SELECT queries and get results as a tabular dataset |
| Run data manipulation statements (INSERT, UPDATE, DELETE) |
| Begin, commit, and rollback transactions |
Schema Tools
Tool Name | Description |
| Get information about tables, columns, indexes, and foreign keys |
| Generate SQL or code from database schema |
Performance Tools
Tool Name | Description |
| Analyze query performance and get optimization suggestions |
TimescaleDB Tools
For PostgreSQL databases with TimescaleDB extension, these additional specialized tools are available:
Tool Name | Description |
| Perform general TimescaleDB operations |
| Convert a standard table to a TimescaleDB hypertable |
| List all hypertables in the database |
| Execute optimized time-series queries with bucketing |
| Analyze time-series data patterns |
| Create materialized views that automatically update |
| Manually refresh continuous aggregates |
For detailed documentation on TimescaleDB tools, see TIMESCALEDB_TOOLS.md.
Examples
Querying Multiple Databases
Managing Transactions
Exploring Database Schema
Working with SQLite-Specific Features
Working with Oracle-Specific Features
Troubleshooting
Common Issues
Connection Failures: Verify network connectivity and database credentials
Permission Errors: Ensure the database user has appropriate permissions
Timeout Issues: Check the
query_timeoutsetting in your configuration
Logs
Enable verbose logging for troubleshooting:
Testing
Running Tests
The project includes comprehensive unit and integration tests for all supported databases.
Unit Tests
Run unit tests (no database required):
Integration Tests
Integration tests require running database instances. We provide Docker Compose configurations for easy setup.
Test All Databases:
Test Oracle Database:
Test TimescaleDB:
Regression Tests
Run comprehensive regression tests across all database types:
Continuous Integration
All tests run automatically on every pull request via GitHub Actions. The CI pipeline includes:
Unit Tests: Fast tests that don't require database connections
Integration Tests: Tests against MySQL, PostgreSQL, SQLite, and Oracle databases
Regression Tests: Comprehensive tests ensuring backward compatibility
Linting: Code quality checks with golangci-lint
Contributing
We welcome contributions to the DB MCP Server project! To contribute:
Fork the repository
Create a feature branch (
git checkout -b feature/amazing-feature)Commit your changes (
git commit -m 'feat: add amazing feature')Push to the branch (
git push origin feature/amazing-feature)Open a Pull Request
Please see our CONTRIBUTING.md file for detailed guidelines.
Testing Your Changes
Before submitting a pull request, please ensure:
All unit tests pass:
go test -short ./...Integration tests pass for affected databases
Code follows the project's style guidelines:
golangci-lint run ./...New features include appropriate test coverage
License
This project is licensed under the MIT License - see the LICENSE file for details.