Provides tools for connecting to and querying MySQL databases, with support for caching and bilingual prompts
Provides tools for connecting to and querying PostgreSQL databases, with support for caching and bilingual prompts
database_mcp
Pluggable MCP servers for MySQL and PostgreSQL with a shared core.
Each database has its own driver, prompts and server process.
A gateway.py file exposes both servers under a single FastAPI app.
Features
MySQL / PostgreSQL split: independent servers, drivers and prompts.
Optional TTL cache: global
.envswitch and per-calluse_cache/ttlparameters.Gateway:
/mysql/*and/pgsql/*routes served from one process.Easy extension: add new drivers, prompts and server files for other databases.
Project Structure
Running
Local
MySQL server:
uvicorn server_mysql:mcp.app --host 0.0.0.0 --port 8001PostgreSQL server:
uvicorn server_pgsql:mcp.app --host 0.0.0.0 --port 8002Gateway (both):
uvicorn gateway:app --host 0.0.0.0 --port 8000
Docker
Build image:
Run gateway (default):
Run only MySQL server:
Run only PostgreSQL server:
Environment variables for connection details and cache options are listed in .env.sample.
This server cannot be installed
Related Resources
Related MCP Servers
- -securityAlicense-qualityAn MCP server that integrates with MySQL databases, enabling secure read and write operations through LLM-driven interfaces with support for transaction handling and performance monitoring.Last updated -20217MIT License
- -security-license-qualityUniversal database MCP server connecting to MySQL, PostgreSQL, SQLite, DuckDB and etc.Last updated -11,582MIT License
- -securityFlicense-qualityAn MCP server that allows working with MySQL databases by providing tools for executing read-only SQL queries, getting table schemas, and listing database tables.Last updated -3184
- -securityFlicense-qualityA FastMCP-based server that enables interaction with MySQL databases, supporting client-server communication for querying and analyzing MySQL data.Last updated -