Labsco
MCP SERVER

MySQL MCP Server

by SagenKoder

Read-only MySQL access for an agent: browse schemas and tables, read column and index definitions, run SELECT-class queries with automatic row limits.

Relational SQL Databases
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 a key — docker pull ghcr.io/sagenkoder/go-mysql-mcp-server:latest, then supply credentials