MCP MySQL Server
@cnosuke
About MCP MySQL Server
MCP server that acts as a MySQL Client implemented in Go language
Config
Add this server to your MCP-compatible client using the configuration below.
{
"mcpServers": {
"mcp-mysql-cnosuke": {
"command": "docker",
"args": [
"pull",
"cnosuke/mcp-mysql:latest"
]
}
}
}Tools
No tools detected
We auto-extract tools from the README. The maintainer can list them under a ## Tools heading to populate this section.
Overview
What is MCP MySQL Server?
MCP MySQL Server is a Go-based MCP (Model Context Protocol) server implementation that provides MySQL database interaction functionality, allowing MCP clients such as Claude Desktop to perform database operations.
How to use MCP MySQL Server?
Run the server via Docker (docker pull cnosuke/mcp-mysql:latest and appropriate environment variables) or build and run the Go binary (./bin/mcp-mysql server --config=config.yml). Integrate with Claude Desktop by adding an entry to claude_desktop_config.json using either the Docker command or the Go binary path, and configure MySQL connection settings via environment variables or a YAML config file.
Key features of MCP MySQL Server
- JSON‑RPC based MCP-compliant interface.
- Supports querying, schema inspection, and data manipulation.
- Optional read‑only mode to prevent data modification.
- Optional EXPLAIN query plan verification.
- Accepts URL-style connection strings (
mysql://user:pass@host:port/dbname). - Minimal Docker image built with Google's distroless base.
Use cases of MCP MySQL Server
- Query a MySQL database through an AI assistant like Claude Desktop.
- Inspect database schemas and list tables without writing custom code.
- Safely explore production data using read‑only mode.
- Perform controlled data updates or inserts via an MCP client.
FAQ from MCP MySQL Server
How do I enable read‑only mode?
Set the environment variable MYSQL_READ_ONLY=true or set mysql.read_only: true in the configuration file. In read‑only mode, only tools starting with list_, read_, and desc_ are available.
What connection methods are supported?
You can provide connection details via tool parameter (dsn), DSN in config (mysql.dsn), or individual config parameters (host, user, password, port, database). The server uses URL-style or native MySQL DSN formats.
What runtime does the server require?
For Docker deployment no additional runtime is needed. For local development, Go 1.24 or later and a MySQL server are required.
Can I use environment variables for configuration?
Yes. Environment variables such as MYSQL_HOST, MYSQL_PORT, MYSQL_USER, MYSQL_PASSWORD, MYSQL_DATABASE, MYSQL_DSN, MYSQL_READ_ONLY, and MYSQL_EXPLAIN_CHECK override corresponding YAML settings.
Is the server available for MariaDB connections?
The server supports URL schemes mysql:// and mariadb://. The MySQL DSN format used is compatible with both MySQL and MariaDB servers.
Frequently asked questions
How do I enable read‑only mode?
Set the environment variable `MYSQL_READ_ONLY=true` or set `mysql.read_only: true` in the configuration file. In read‑only mode, only tools starting with `list_`, `read_`, and `desc_` are available.
What connection methods are supported?
You can provide connection details via tool parameter (`dsn`), DSN in config (`mysql.dsn`), or individual config parameters (host, user, password, port, database). The server uses URL-style or native MySQL DSN formats.
What runtime does the server require?
For Docker deployment no additional runtime is needed. For local development, Go 1.24 or later and a MySQL server are required.
Can I use environment variables for configuration?
Yes. Environment variables such as `MYSQL_HOST`, `MYSQL_PORT`, `MYSQL_USER`, `MYSQL_PASSWORD`, `MYSQL_DATABASE`, `MYSQL_DSN`, `MYSQL_READ_ONLY`, and `MYSQL_EXPLAIN_CHECK` override corresponding YAML settings.
Is the server available for MariaDB connections?
The server supports URL schemes `mysql://` and `mariadb://`. The MySQL DSN format used is compatible with both MySQL and MariaDB servers.
Basic information
More Databases MCP servers
MotherDuck's DuckDB MCP Server
motherduckdbLocal MCP server for DuckDB and MotherDuck
Redis MCP Server
redisThe official Redis MCP Server is a natural language interface designed for agentic applications to manage and search data in Redis efficiently
MCP Alchemy
runekaagaardA MCP (model context protocol) server that gives the LLM access to and knowledge about relational databases like SQLite, Postgresql, MySQL & MariaDB, Oracle, and MS-SQL.
MongoDB MCP Server
mongodb-jsA Model Context Protocol server to connect to MongoDB databases and MongoDB Atlas Clusters.
Chroma MCP Server
chroma-coreA Model Context Protocol (MCP) server implementation that provides database capabilities for Chroma
Comments