LabscoMCP early access ↗
xiangma9712MCP SERVER

MySQL MCP Server by xiangma9712

Query MySQL from an assistant with writes that always roll back — SELECT runs for real, UPDATE only tells you whether it would have worked.

Relational SQL DatabasesCommunity

No longer maintained. The GitHub repository for this server is archived — no fixes or security updates are expected.

View project ↗

LABSCO SUMMARY

A dry run for SQL you did not write.

The rollback design is the reason to pick this one: an assistant can draft an UPDATE, prove it parses and touches the rows it claims, and still leave the database untouched. Treat it as validation rather than protection — the credentials you supply are real, and SQL injection is explicitly left to whoever builds on top.

What it is

A containerized MCP server for MySQL with an unusual safety property: it accepts write statements but never commits them. A read query returns rows; a write query is executed inside a transaction that is rolled back, so what comes back is whether the statement is valid, not a changed database.

What you get

  • query — run a read-only statement and get the rows back as JSON
  • test_execute — run a write statement and get back whether it can execute, with the change rolled back
  • list_tables — the table names in the database
  • describe_table — a table's columns with type, nullability, key, default and extra

Requirements

A reachable MySQL server and credentials for it. Put MYSQL_HOST, MYSQL_PORT, MYSQL_USER and MYSQL_PASSWORD in ~/.mcp/.env; the client runs ghcr.io/xiangma9712/mcp/mysql with --env-file pointed at it. To reach a MySQL running on your own machine, set the host to host.docker.internal and pass --add-host=host.docker.internal:host-gateway — OrbStack supplies that automatically, but adding the flag is the reliable path. Package mcp-mysql at 1.0.3.

Setup effort

One command plus credentials — docker run -i --rm --add-host=host.docker.internal:host-gateway --env-file ~/.mcp/.env ghcr.io/xiangma9712/mcp/mysql, then supply credentials