go-mcp-mysql
@optimisticdur
Zero burden, ready-to-use Model Context Protocol (MCP) server for interacting with MySQL and automation. No Node.js or Python environment needed. mcp, mcp-server, model-context-protocol, mysql
Overview
What is go-mcp-mysql?
go-mcp-mysql is a zero-burden, ready-to-use Model Context Protocol (MCP) server for interacting with MySQL databases. It provides tools for CRUD operations on databases and tables, supports a read-only mode to prevent accidental writes, and can optionally check query plans via EXPLAIN before executing queries. No Node.js or Python runtime is required. This is a work in progress and may not yet be ready for production.
How to use go-mcp-mysql?
Download the latest release binary and place it in your $PATH, or build from source with go install -v github.com/optimisticdur/go-mcp-mysql@latest. Configure it in your MCP client using either command‑line arguments (host, user, pass, port, db) or a DSN string. Optional flags include --read-only to restrict tools to read-only operations and --with-explain-check to disable the default EXPLAIN check for CRUD queries.
Features of go-mcp-mysql
- No Node.js or Python environment needed
- Supports both command‑line arguments and DSN configuration
- Read-only mode prevents surprise write operations
- Optional EXPLAIN query plan checking before execution
- Tools for listing databases and tables
- CRUD operations: read, write, update, delete queries
Use cases of go-mcp-mysql
- Managing MySQL databases through AI‑assisted chat interfaces
- Executing read‑only queries safely during development or auditing
- Creating, altering, and describing table schemas via natural language
- Performing automated database maintenance with write‑protected safeguards
FAQ from go-mcp-mysql
What is go-mcp-mysql and how does it differ from other database MCP servers?
It is a self‑contained MCP server for MySQL that does not require Node.js or Python, making it lighter and easier to deploy. It also offers a read‑only mode and built‑in EXPLAIN query plan checks for added safety.
What are the runtime dependencies?
The only dependency is the compiled binary itself (or a Go installation if building from source). No other language runtimes are needed.
How do I enable read-only mode?
Add the --read-only flag to the server arguments. In this mode, only tools starting with list, read_, and desc_ are available. Restart the MCP server after adding the flag.
What does the EXPLAIN check do?
By default, each CRUD query is first run through EXPLAIN ? to inspect the query plan. If the plan does not match expected patterns, the query may be rejected. Adding the --with-explain-check flag disables this check.
Can I use a DSN to connect to MySQL?
Yes. Use the --dsn flag with a standard MySQL DSN string. Refer to the MySQL driver documentation for DSN format options.