PerfectXM/mcp-db-server logo

PerfectXM/mcp-db-server

Free

无状态数据库 MCP 服务,连接参数即传即用、零持久化零配置,让 AI 直接操作 MySQL / PostgreSQL / SQLite / SQL Server / Oracle / H2。

FreeFree tier
Inputs: textOutputs: text
Type
Open Source

About PerfectXM/mcp-db-server

PerfectXM/mcp-db-server is an open-source, stateless database MCP (Model Context Protocol) service that enables AI clients to directly interact with databases. Built on Spring AI MCP Server, it uses SSE (Server-Sent Events) transport protocol and integrates seamlessly with AI clients such as Claude Desktop and Cursor. The service supports six major databases: MySQL, PostgreSQL, H2, SQLite, SQL Server, and Oracle. It is designed to be fully stateless, meaning no connection configuration or data is stored on the server; instead, connection parameters are passed by the AI client with each tool invocation. The service employs HikariCP connection pooling with a short-term cache (5-minute TTL) for identical connection parameters, balancing performance and security. It offers six MCP tools for database operations: table query, table structure, indexes, SQL query, SQL write operations, and database metadata. Deployment options include Maven local run, Docker (with provided Dockerfile and docker-compose.yml), and JAR package deployment. The project is licensed under an open-source license and is available on GitHub.

Key Features

MCP protocol based on Spring AI MCP Server with SSE transport
Supports MySQL, PostgreSQL, H2, SQLite, SQL Server, and Oracle databases
Fully stateless: no persistent storage of connection configuration or data
HikariCP connection pooling with 5-minute TTL cache for identical connection parameters
Six MCP tools: table query, table structure, indexes, SQL query, SQL write operations, database metadata
Docker deployment support with Dockerfile and docker-compose.yml
Compatible with AI clients like Claude Desktop and Cursor

Pros & Cons

Pros
  • Stateless design enhances security by not persisting connection credentials
  • Supports a wide range of popular databases (MySQL, PostgreSQL, SQLite, SQL Server, Oracle, H2)
  • Easy to deploy via Docker or Maven, with minimal configuration required
  • Short-term connection pooling improves performance while maintaining statelessness
  • Open-source and free to use, with code available on GitHub
Cons
  • Requires JDK 17+ and Maven for local development, which may be a barrier for some users
  • Stateless design means connection parameters must be passed with every call, which could increase overhead
  • Limited to the six supported databases; other databases are not covered
  • Documentation and community support may be limited as it is a relatively new open-source project
  • Security relies on database user permissions; the service does not add additional access controls

Best For

Enabling AI assistants to query and manipulate databases directlyBuilding AI-powered database management and analysis toolsIntegrating database operations into AI agent workflowsProviding a stateless middleware for secure database access from AI clientsRapid prototyping of database interactions in AI applications

FAQ

What is the purpose of mcp-db-server?
Based on the project description, mcp-db-server is a stateless database MCP service that allows AI clients to directly operate on databases by passing connection parameters with each call. It supports MySQL, PostgreSQL, H2, SQLite, SQL Server, and Oracle.
How does the stateless design work?
The service does not store any connection configuration or data. AI clients provide connection parameters (type, host, port, database, username, password) with each tool invocation. The server uses HikariCP to cache connection pools in memory for a short period (5-minute TTL) for identical parameters, then releases them automatically.
Which AI clients are compatible?
The project mentions compatibility with Claude Desktop and Cursor, as it uses the MCP protocol with SSE transport. Other AI clients that support the MCP protocol may also work, but this should be verified.
Is mcp-db-server free to use?
The project is open-source and appears to be free to use. The pricing model is listed as 'free' in the provided information. Users should check the license file on GitHub for exact terms.
How do I deploy mcp-db-server?
Deployment options include running locally with Maven (JDK 17+ required), using Docker with the provided Dockerfile and docker-compose.yml, or deploying as a JAR package. Detailed instructions are available in the project's README on GitHub.
What databases are supported?
The service supports MySQL, PostgreSQL, H2, SQLite, SQL Server, and Oracle. Each database has a specific type identifier and default port, as listed in the project documentation.