Labsco
MCP SERVER

MySQL MCP Server

by koh-yoshimoto

MySQL access where reads and writes are different tools, and every write is previewed before it runs.

Relational SQL Databases
Summary
The confirmation token is the whole safety story.

Plenty of database servers hand a model an execute tool and hope the prompt holds. Here the first call cannot change anything — it reports that the update would touch a certain number of rows and returns a token. If that number is wrong, you find out before the write, not after. The output format choice is a smaller kindness: CSV or markdown back means the result is usable without reformatting.

What it is

A single Go binary that connects to one MySQL database. Reads go through a tool that only accepts SELECT; writes go through a separate one that first tells you how many rows would change and hands back a token you must pass to actually run it.

What you get
  • query — SELECT only, with results as a table, JSON, CSV or markdown
  • execute — INSERT, UPDATE and DELETE behind a two-step gate: a dry run reports the affected row count and returns a confirmation token, and nothing changes until you pass it back
  • schema for a table's definition, and tables for what exists in the database
  • explain for a query's execution plan, optionally running EXPLAIN ANALYZE for real timings and row counts
  • Prebuilt binaries for Linux, macOS on both architectures, and Windows
Requirements

MYSQL_HOST, MYSQL_PORT, MYSQL_USER, MYSQL_PASSWORD and MYSQL_DATABASE. MySQL 5.7 or 8.0. Download the binary for your platform or build it with Go. Note that EXPLAIN ANALYZE actually runs the query to collect its statistics, which is worth remembering on a slow one.

Setup effort

One command plus a key — curl -L https://github.com/koh/mysql-mcp-server/releases/latest/download/mysql-mcp-server-darwin-arm64.tar.gz | tar xz, then supply credentials