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.
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.
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 and PostgreSQL databases concurrently
- 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
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 |
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.json
as 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 Tools
For each connected database, DB MCP Server automatically generates these specialized tools:
Query Tools
Tool Name | Description |
---|---|
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 Tools
Tool Name | Description |
---|---|
schema_<db_id> | Get information about tables, columns, indexes, and foreign keys |
generate_schema_<db_id> | Generate SQL or code from database schema |
Performance Tools
Tool Name | Description |
---|---|
performance_<db_id> | Analyze query performance and get optimization suggestions |
TimescaleDB Tools
For PostgreSQL databases with TimescaleDB extension, these additional specialized tools are available:
Tool Name | Description |
---|---|
timescaledb_<db_id> | Perform general TimescaleDB operations |
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 |
For detailed documentation on TimescaleDB tools, see TIMESCALEDB_TOOLS.md.
Examples
Querying Multiple Databases
Managing Transactions
Exploring Database Schema
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_timeout
setting in your configuration
Logs
Enable verbose logging for troubleshooting:
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.
License
This project is licensed under the MIT License - see the LICENSE file for details.
This server cannot be installed
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
The Multi DB MCP Server is a high-performance implementation of the Database Model Context Protocol designed to revolutionize how AI agents interact with databases. Currently supporting MySQL and PostgreSQL databases.
Related MCP Servers
- -securityAlicense-qualityMCP Server simplifies the implementation of the Model Context Protocol by providing a user-friendly API to create custom tools and manage server workflows efficiently.Last updated -14TypeScriptMIT License
- -securityAlicense-qualityMCP Server provides a simpler API to interact with the Model Context Protocol by allowing users to define custom tools and services to streamline workflows and processes.Last updated -433TypeScriptMIT License
- AsecurityAlicenseAqualityA blazing fast MCP server that enables AI agents to interact with multiple PostgreSQL databases, providing functionality to list tables, inspect schemas, execute queries, and run transactions.Last updated -442TypeScriptMIT License
- AsecurityFlicenseAqualityAn all-in-one Model Context Protocol (MCP) server that connects your coding AI to numerous databases, data warehouses, data pipelines, and cloud services, streamlining development workflow through seamless integrations.Last updated -2Python