Multi-Instance
Connect production, staging, and dev databases simultaneously. Each with its own connection pool.
Multi-instance MySQL MCP server with SQL static analysis, read-only enforcement, and built-in security layers. Connect your AI assistant to any MySQL database safely.
go install github.com/phpgao/mysqlmcp@latest
Features
Connect multiple MySQL instances with per-instance security policies. Your AI assistant queries safely.
Connect production, staging, and dev databases simultaneously. Each with its own connection pool.
Prevent accidental writes on production replicas. AI cannot bypass per-instance security.
Vitess SQL parser validates every query. Reject dangerous operations before execution.
Every query gets a per-instance timeout. Context deadline prevents runaway queries.
Run locally via stdio or remotely via HTTP with Bearer Token authentication.
SELECT without LIMIT is rejected. Results truncated at max_rows to prevent memory exhaustion.
Security
Every SQL statement passes through 4 validation layers before touching your database.
Vitess parser validates SQL. DROP DATABASE and dangerous ops blocked.
Multiple statements separated by ; are rejected. One query per call.
SELECT must include LIMIT clause. Value checked against instance max_rows.
INSERT/UPDATE/DELETE rejected on read-only instances. Instance-aware enforcement.
MCP Tools
Minimal toolset. AI picks the right tool for the task without confusion.
list_instancesList all configured MySQL instances with metadataqueryExecute SQL with full 4-layer validation and timeoutdescribe_tableShow table schema (DESCRIBE) — read-only safeexplain_queryShow execution plan (EXPLAIN) — validated, not executedSetup
Add to your MCP client. Works with CodeBuddy Code, Claude Desktop, and any MCP-compatible assistant.
Need remote access? HTTP mode:
mysqlmcp -transport http -port 8000