list_schemasLABSCO SUMMARY
The write path is closed at the parser, not by prompt.
Statement filtering and automatic result limits are enforced in the server, so an agent cannot talk its way into an UPDATE or drag back a million rows. The interactive image is worth knowing about: it lets you prove the connection works before any client is involved, which is where most MySQL setups actually fail.
What it is
A Go MCP server that gives an assistant a guarded path into a MySQL database. Only SELECT, SHOW, DESCRIBE and EXPLAIN are allowed through, every result set is limited, and the container runs as a non-root user.
What you get
- Paginated listings of every schema on the server, and of the tables inside one schema with their metadata —
list_schemas,list_tables - Column definitions, types and indexes for a table, plus the original CREATE TABLE statement —
get_table_structure,get_table_create - Query execution restricted to SELECT, SHOW, DESCRIBE and EXPLAIN, with a row limit that defaults to 100 —
execute_query - A value search that scans every text column of a table at once, for when you know the string but not the field —
search_table
Requirements
MySQL credentials as environment variables: MYSQL_HOST, MYSQL_PORT, MYSQL_USER, MYSQL_PASSWORD (required) and MYSQL_DATABASE (optional). The published image is ghcr.io/sagenkoder/go-mysql-mcp-server, tagged stdio, http or interactive; the stdio tag is the one MCP clients want and needs docker run -i. Building from source needs Go 1.23 or later.
Setup effort
One command plus credentials — docker pull ghcr.io/sagenkoder/go-mysql-mcp-server:latest, then supply credentials
USE CASES
Finding your way around an unfamiliar database
List the schemas, then the tables in the one that looks right, then read the column types and indexes before writing any query.
Tracking down a record when you only know a value
Search every text column of the table for the string, then pull the matching rows with a limited SELECT.
Reconstructing a table definition
Read back the CREATE TABLE statement for a table so the schema can be copied into a migration or a staging environment.
Answering an ad-hoc question over production data safely
Run a SELECT with an explicit row limit against a read-only path, knowing the server rejects anything that would modify data.
6 tools
Listed in project docs. Your client may show a different list.
list_tablesget_table_structureget_table_createexecute_querysearch_tableBEFORE YOU INSTALL
What to know first
Tools you get
6 tools named in the project's documentation.
Requires
- docker on PATH
- mysql 8
- Go 1.23 or later (only to build the binary yourself)
- MYSQL_PASSWORD in your environment
- MYSQL_USER in your environment
INSTALLATION
Connect your client
Server setup
docker pull ghcr.io/sagenkoder/go-mysql-mcp-server:latestMCP Clients
Claude Desktop — Docker
{
"mcpServers": {
"mysql": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"--network",
"host",
"-e",
"MYSQL_HOST=localhost",
"-e",
"MYSQL_USER=<YOUR_MYSQL_USER>",
"-e",
"MYSQL_PASSWORD=<YOUR_MYSQL_PASSWORD>",
"-e",
"MYSQL_DATABASE=<YOUR_MYSQL_DATABASE>",
"ghcr.io/sagenkoder/go-mysql-mcp-server:stdio"
]
}
}
}Claude Desktop — binary
git clone https://github.com/sagenkoder/go-mysql-mcp-server.git
cd go-mysql-mcp-server
./build.sh{
"mcpServers": {
"mysql": {
"command": "<YOUR_PATH_TO_MYSQL_MCP_STDIO>",
"env": {
"MYSQL_HOST": "localhost",
"MYSQL_PORT": "3306",
"MYSQL_USER": "<YOUR_MYSQL_USER>",
"MYSQL_PASSWORD": "<YOUR_MYSQL_PASSWORD>",
"MYSQL_DATABASE": "<YOUR_MYSQL_DATABASE>"
}
}
}
}./build.sh needs Go 1.23 or later and creates the mysql-mcp-stdio binary; <YOUR_PATH_TO_MYSQL_MCP_STDIO> is its full path.