LogoFindMcp
Logo of db-mcp-server

db-mcp-server

A multi-database server implementing the Model Context Protocol, enabling AI assistants to access and manage multiple databases.

Introduction

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 database
  • execute_mysql1 - Run data modification statements on mysql1
  • transaction_mysql1 - Manage transactions on mysql1
  • performance_mysql1 - Analyze query performance on mysql1
  • schema_mysql1 - Explore database schema on mysql1
  • list_databases - Show all available database connections

Newsletter

Join the Community

Subscribe to our newsletter for the latest news and updates