# go-mcp-mysql

> go-mcp-mysql is an open-source MCP server for databases. MCP server giving AI clients CRUD and read-only access to MySQL databases, no runtime. It is available on CLI and Self-hosted.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** CLI, Self-hosted
- **Repository:** https://github.com/zhwt/go-mcp-mysql
- **GitHub stars:** 66
- **License:** MIT
- **Categories:** [databases](https://ai-powered.com/categories/databases)
- **Listing updated:** 2026-12-01

## About

Ships as a single Go binary, so it runs without a Node.js or Python install. Once connected, an AI client can list databases and tables, inspect table structure, run read queries, and perform inserts, updates and deletes against a MySQL server.

Connection can be set with individual host, user, password, port and database flags, or with a full MySQL DSN string when custom driver options are needed. A read-only switch limits the server to listing, describing and reading tables, which helps avoid accidental writes. An optional check runs EXPLAIN on generated statements before they execute.

The project is marked as a work in progress, so it suits developers experimenting with database-aware assistants on local or test databases more than production workloads.

## Features

- **Single binary deployment:** Runs as a compiled Go program with no Node.js or Python environment required.
- **Read-only mode:** A flag restricts the server to list, describe and read tools to block writes.
- **Query plan check:** Optionally runs EXPLAIN on queries before execution to confirm the expected plan.
- **Flexible connection options:** Accepts discrete host, user, password, port and database flags or a full DSN string.
- **Schema inspection tools:** Lists databases and tables by name pattern and describes table structure.
- **Full CRUD tools:** Provides separate tools for reading, writing, updating and deleting data.

## Good for

- Letting an AI assistant explore an unfamiliar MySQL schema before writing queries
- Answering ad hoc data questions from a database through a chat client
- Drafting and running insert, update or delete statements with a review step
- Running a safe read-only analytics session against a production-like replica
- Automating routine table maintenance such as creating or altering tables

## Tools

From the tool list in its README, going by the names, 1 of 9 tools deletes data and 3 change data; 2 names don't say. From the server's own tool labels and tool names; not verified by us.

- `list_database` (name suggests: reads): List all databases in the MySQL server.
- `list_table` (name suggests: reads): List tables, optionally filtered by name.
- `create_table` (name suggests: changes): Create a new table using a SQL query.
- `alter_table`: Alter an existing table using a SQL query.
- `desc_table`: Describe the structure of a table.
- `read_query` (name suggests: reads): Execute a read-only SQL query.
- `write_query` (name suggests: changes): Execute a write SQL query.
- `update_query` (name suggests: changes): Execute an update SQL query.
- `delete_query` (name suggests: deletes): Execute a delete SQL query.

## FAQ

### Do I need Node.js or Python to run go-mcp-mysql?

No. The server is distributed as a Go binary, and it can also be built from source with Go installed.

### How do I stop the assistant from modifying data?

Add the --read-only flag. Only tools beginning with list, read_ and desc_ are then available.

### How can I pass connection settings?

Use separate host, user, pass, port and db arguments, or supply a single MySQL DSN with the --dsn argument.

### Is go-mcp-mysql ready for production?

The project describes itself as a work in progress that may not yet be ready for production use.

### Is go-mcp-mysql free?

Yes. go-mcp-mysql is open source, so you can use and self-host it for free.

### What are the best alternatives to go-mcp-mysql?

The closest alternatives to go-mcp-mysql are mysql_mcp_server, db-mcp-server, mysql-mcp-server, mcp-server-mysql and mysql_mcp_server_pro.

## Where this comes from

- Description: written from the project's README.

## Alternatives

- [mysql_mcp_server](https://ai-powered.com/mcp/mysql-mcp-server-4): mysql_mcp_server is an open-source MCP server for databases.
- [db-mcp-server](https://ai-powered.com/mcp/db-mcp-server-2): db-mcp-server is an open-source MCP server for databases.
- [mysql-mcp-server](https://ai-powered.com/mcp/mysql-mcp-server-3): mysql-mcp-server is an open-source MCP server for databases.
- [mcp-server-mysql](https://ai-powered.com/mcp/mcp-server-mysql): mcp-server-mysql is an open-source MCP server for databases.
- [mysql_mcp_server_pro](https://ai-powered.com/mcp/mysql-mcp-server-pro): mysql_mcp_server_pro is an open-source MCP server for databases.
- [MySQL Ops MCP](https://ai-powered.com/mcp/mysql-ops-mcp): MySQL Ops MCP is an open-source MCP server for databases.
- [coremcp](https://ai-powered.com/mcp/coremcp): coremcp is an open-source MCP server for databases.
- [mcp-multi-db](https://ai-powered.com/mcp/mcp-multi-db): mcp-multi-db is an open-source MCP server for databases.

---
Source: https://ai-powered.com/mcp/go-mcp-mysql
