queryLABSCO 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
Follow the published steps
USE CASES
Answering a data question safely
Run the SELECT through the read-only tool, in whatever output format you need next.
Changing rows without holding your breath
Dry-run the statement, check the affected count, then run it with the token it gave you.
Writing a query against a schema you do not know
List the tables, read the one you need, then write the query.
Working out why a query is slow
Read the plan, and run it with real statistics when the estimate is not enough.
Getting results into a document
Ask for markdown or CSV rather than reformatting a table by hand.
5 tools
Listed in project docs. Your client may show a different list.
executeschematablesexplainBEFORE YOU INSTALL
What to know first
Tools you get
5 tools named in the project's documentation.
Requires
- mysql-mcp-server on PATH (a prebuilt release binary)
- MySQL 5.7+ or 8.0+
- Go 1.21+ and Make only if you build it from source instead
- MYSQL_PASSWORD in your environment
- MYSQL_USER in your environment
Where it runs
All 3 documented clients run the server on your machine.
INSTALLATION
Connect your client
Server setup
# Linux (amd64)
curl -L https://github.com/koh-yoshimoto/mysql-mcp-server/releases/latest/download/mysql-mcp-server-linux-amd64.tar.gz | tar xz
chmod +x mysql-mcp-server
sudo mv mysql-mcp-server /usr/local/bin/
# macOS (Apple Silicon)
curl -L https://github.com/koh-yoshimoto/mysql-mcp-server/releases/latest/download/mysql-mcp-server-darwin-arm64.tar.gz | tar xz
chmod +x mysql-mcp-server
mv mysql-mcp-server /usr/local/bin/
# macOS (Intel)
curl -L https://github.com/koh-yoshimoto/mysql-mcp-server/releases/latest/download/mysql-mcp-server-darwin-amd64.tar.gz | tar xz
chmod +x mysql-mcp-server
mv mysql-mcp-server /usr/local/bin/
# Windows: download from https://github.com/koh-yoshimoto/mysql-mcp-server/releases/latest
# Extract mysql-mcp-server-windows-amd64.exe.zip
# Add to PATH or move mysql-mcp-server.exe to a directory in PATHMCP Clients
Claude Desktop
{
"mcpServers": {
"mysql": {
"command": "mysql-mcp-server",
"env": {
"MYSQL_HOST": "localhost",
"MYSQL_PORT": "3306",
"MYSQL_USER": "<YOUR_MYSQL_USER>",
"MYSQL_PASSWORD": "<YOUR_MYSQL_PASSWORD>",
"MYSQL_DATABASE": "<YOUR_MYSQL_DATABASE>"
}
}
}
}VS Code
{
"servers": {
"mysql": {
"command": "<YOUR_PATH_TO_MYSQL_MCP_SERVER>",
"env": {
"MYSQL_HOST": "localhost",
"MYSQL_USER": "root",
"MYSQL_PASSWORD": "password",
"MYSQL_DATABASE": "mydb"
}
}
}
}Cursor
{
"mcpServers": {
"mysql": {
"command": "<YOUR_PATH_TO_MYSQL_MCP_SERVER>",
"env": {
"MYSQL_HOST": "localhost",
"MYSQL_USER": "root",
"MYSQL_PASSWORD": "password",
"MYSQL_DATABASE": "mydb"
}
}
}
}