PerfectXM/mcp-db-server
Free无状态数据库 MCP 服务,连接参数即传即用、零持久化零配置,让 AI 直接操作 MySQL / PostgreSQL / SQLite / SQL Server / Oracle / H2。
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
Pros & Cons
- 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
- 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