go -mysql
Zero burden, ready-to-use Model Context Protocol (MCP) server for interacting with MySQL and automation. No Node.js or Python environment needed.
claude mcp add --transport stdio zhwt-go-mcp-mysql go-mcp-mysql --host localhost --user root --pass password --port 3306 --db mydb
How to use
This MCP server provides a set of tools to interact with a MySQL server through a Model Context Protocol interface. It supports CRUD operations on databases and tables, as well as read-only mode to prevent unintended writes. You can optionally enable an explain check so that the server runs an EXPLAIN on each write operation to validate the generated query plan before executing it. Use the available schema tools to inspect and modify database schemas, and data tools to read or modify data in a controlled way. The server is designed to be lightweight and self-contained, requiring no Node.js or Python environment since it’s implemented in Go.
How to install
Prerequisites:
- Go or a pre-built binary is available in your environment.
- Access to the MySQL server you want to manage.
Installation steps:
- Release binary approach:
# Download the latest release and place it in a directory in your PATH
# Example path adjustment may be required for your OS
# After downloading, ensure the binary is executable and accessible via your shell
- Build from source (requires Go):
# Install the latest version from GitHub
go install -v github.com/Zhwt/go-mcp-mysql@latest
- Verify installation:
# Ensure the binary is available in PATH
which go-mcp-mysql
# Or check version/help
go-mcp-mysql --help
- Run with your desired configuration (example shown in the README):
# Using the example configuration from the README
# You can run the server directly or wire it into your MCP orchestration.
Additional notes
Notes and tips:
- The server supports a read-only mode via the --read-only flag. In read-only mode, only list, read_, and desc_ tools are available.
- By default, CRUD queries are executed with an EXPLAIN check for safety. Use --with-explain-check to disable this behavior.
- If you place the binary outside of your PATH, specify the full path to the executable in the command field, as shown in the README's example for a local path.
- You can choose between using command-line arguments or a DSN string to configure the connection to MySQL (see the DSN example in the README).
- Ensure network access and proper permissions for the user account to perform the desired operations on the MySQL server.
Related MCP Servers
mcp-language
mcp-language-server gives MCP enabled clients access semantic tools like get definition, references, rename, and diagnostics.
MCPJungle
Self-hosted MCP Gateway for AI agents
go
deprecated: use the official MCP sdk! (https://github.com/modelcontextprotocol/go-sdk) / ⚡ A type-safe, intuitive Go SDK for building MCP servers with ease and confidence
sandbox
A Model Context Protocol (MCP) server that enables LLMs to run ANY code safely in isolated Docker containers.
hop
Fast, elegant SSH connection manager with a TUI dashboard and MCP server
miro
MCP server for controlling Miro whiteboards with AI assistants