Go MCP Mysql logo

Go MCP Mysql

by Zhwt

Connects AI agents to MySQL for schema inspection, SQL reads and writes, with optional read-only operation.

Install Go MCP Mysql

Run the project’s own setup commands, in order.

Setup steps from the project

Zhwt/go-mcp-mysql installs with its own steps rather than a config we can generate, so these are copied as-is. Follow them in order and run the commands in a terminal. Source: github.com

  1. 1. Install
    go install -v github.com/Zhwt/go-mcp-mysql@latest
    

Overview

Zhwt/go-mcp-mysql MCP server connects AI clients to a MySQL database through a standalone Go executable. It exposes schema tools for databases and tables, plus separate tools for reading, inserting, updating, deleting, creating, and altering data structures. Command-line flags or a MySQL DSN configure the connection, while read-only mode limits the available tools. Reach for it when an MCP client needs direct MySQL access without requiring a Node.js or Python runtime.

Use cases

  • Inspect MySQL databases and table structures
  • Run read-only SQL queries from an MCP client
  • Create and alter MySQL tables
  • Execute data updates and deletions through separate tools

Key features

  • MySQL access through a standalone Go binary
  • Schema inspection for databases and tables
  • Separate read, write, update, and delete tools
  • Configurable read-only mode
  • Optional EXPLAIN query-plan checks
  • Command-line or DSN connection configuration

Tools2

What Go MCP Mysql lets your agent do. Expand a tool for its parameters.

Self-reported~40 tokens of context

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked

Recent health check succeeded.

29/30 checks healthy over the last 111d

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars66Stargazers on the source repository.
Last commit10mo agoMost recent push to the default branch.
Tools exposed2Callable tools this server registers over MCP.
Directory activity5 viewsConfig copies, upvotes, and views on AllMCPs.

How Go MCP Mysql works

What Zhwt/go-mcp-mysql MCP server does

Zhwt/go-mcp-mysql MCP server gives an MCP client access to a MySQL database through a Go binary. It covers database and table discovery, table descriptions, read queries, and data-changing SQL operations. Schema operations include creating and altering tables, while data operations are split into read, write, update, and delete tools.

The project belongs in the 🗄️ Databases category. It is intended for database interaction and automation, but the README identifies it as a work in progress and cautions that it may not be ready for production use.

How it works

The server runs as a local MCP process and connects to MySQL using either individual connection arguments or a DSN. The connection can specify a host, port, username, password, and database. A DSN also allows MySQL driver options such as parseTime and loc.

Schema discovery is handled by list_database, list_table, and desc_table. list_table can return every table or filter names using behavior equivalent to SHOW TABLES LIKE '%name%'. read_query executes read-only SQL and returns its result. write_query, update_query, and delete_query execute their respective mutation types and report affected rows; writes also return the last insert ID.

By default, CRUD queries are checked with an EXPLAIN statement before execution. The --with-explain-check flag disables that behavior. The --read-only flag restricts the exposed tools to those beginning with list, read_, and desc_.

Setup and configuration

Install a released binary from the project’s GitHub releases and place it on the executable path, or build it with:

sh
go install -v github.com/Zhwt/go-mcp-mysql@latest

An MCP client can launch the binary with connection arguments such as --host, --user, --pass, --port, and --db. Alternatively, pass a complete connection string through --dsn, for example:

text
username:password@tcp(localhost:3306)/mydb?parseTime=true&loc=Local

If the executable is not on PATH, configure the client with its full filesystem path. Add --read-only for restricted access, or --with-explain-check to turn off the default query-plan check. Restart or refresh the MCP server after changing read-only configuration.

Tools and capabilities

  • list_database: lists databases on the MySQL server.
  • list_table: lists all tables or filters table names.
  • create_table: runs a supplied table-creation statement.
  • alter_table: alters an existing table; the LLM is informed not to drop existing tables or columns.
  • desc_table: returns a table’s structure.
  • read_query: runs a read-only SQL query.
  • write_query: runs a write query and returns affected rows and the last insert ID.
  • update_query: runs an update query and returns affected rows.
  • delete_query: runs a delete query and returns affected rows.

Limitations and notes

Zhwt/go-mcp-mysql is configured with command-line arguments or a DSN rather than environment variables. Read-only mode depends on restricting the exposed tool set, so connection credentials and database permissions should still be managed appropriately. The project’s README describes the implementation as work in progress, so evaluate it carefully before using it in production.

Written by AllMCPs with AI assistance from the project’s README and listing data. How we build listings

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Go MCP Mysql

Zhwt/go-mcp-mysql is an MCP server that connects AI clients to MySQL through a Go executable. Its main tools list databases and tables, describe schemas, run read queries, and perform write, update, delete, create-table, and alter-table operations, with an optional read-only mode.

Install a released binary or build it with `go install -v github.com/Zhwt/go-mcp-mysql@latest`. Put the executable on your `PATH`, or configure your MCP client with its full path.

Configure it with command-line flags such as `--host`, `--user`, `--pass`, `--port`, and `--db`, or provide a complete MySQL connection string with `--dsn`. The DSN supports driver options such as `parseTime=true` and `loc=Local`.

Yes, add the `--read-only` flag to restrict the exposed tools to database and table listing, reads, and table descriptions. Restart or refresh the MCP server after changing this setting.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewGo MCP Mysql AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/zhwt-go-mcp-mysql?style=directory)](https://allmcps.com/mcp/zhwt-go-mcp-mysql)
HTML Embed
<a href="https://allmcps.com/mcp/zhwt-go-mcp-mysql"><img src="https://allmcps.com/api/badge/zhwt-go-mcp-mysql?style=directory" alt="Go MCP Mysql on AllMCPs" /></a>