Multi Database MCP Server
A Clean Architecture implementation of a database server for Model Context Protocol (MCP), providing AI assistants with structured access to multiple databases simultaneously.
Features
- Simultaneous Multi-Database Support: Connect to and interact with 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.
- Dynamic Database Tools:
- Execute SQL queries with parameters
- Run data modification statements with proper error handling
- Manage database transactions across sessions
- Explore database schemas and relationships
- Analyze query performance and receive optimization suggestions
- Unified Interface: Consistent interaction patterns across different database types
- Connection Management: Simple configuration for multiple database connections
Usage
The server supports two transport modes:
- SSE Mode (Server-Sent Events)
- STDIO Mode (for IDE integration)
For Cursor integration, you can use the provided scripts:
# Start the server in Cursor
./cursor-mcp.sh config.json
Available Tools
For each connected database, the server dynamically creates a set of database-specific tools. For example, if you have databases with IDs "mysql1", "mysql2", and "postgres1", the following tools will be available:
query_mysql1
- Execute SQL queries on mysql1 databaseexecute_mysql1
- Run data modification statements on mysql1transaction_mysql1
- Manage transactions on mysql1performance_mysql1
- Analyze query performance on mysql1schema_mysql1
- Explore database schema on mysql1list_databases
- Show all available database connections