mysql-mcp — Claude Code MCP server: install and use
Connects an AI agent to MySQL for queries, schema inspection, and server diagnostics. It runs from a Docker image.
claude mcp add mysql-mcp -- docker run -i --rm docker.io/writenotenow/mysql-mcp:v1.0.0What mysql-mcp does
mysql-mcp exposes 106 tools for working with MySQL from an AI agent. It covers CRUD operations, JSON and spatial data, schema inspection, active queries, performance, replication, locks, and InnoDB status. MCP resources such as mysql://schema, mysql://health, and mysql://performance provide database and telemetry views.
The server includes guided workflows named mysql_quick_query, mysql_quick_schema, and mysql_setup_observability. It also offers Code Mode, stateless MCP HTTP deployment, connection pooling, OAuth 2.1, TLS/SSL, and integrations with MySQL Router, ProxySQL, and MySQL Shell. A MySQL server is required. The install command depends on Docker being available.
What it helps with
- inspect a MySQL database schema
- run a query through the agent
- check server health and query performance
- find active queries and lock contention
- review replication and InnoDB status
Example prompts for the agent
- Use
mysql-mcpto inspect the database schema and list its tables. - Run a quick MySQL query with the
mysql_quick_queryworkflow. - Check database health, active queries, and performance through mysql-mcp resources.
How to install mysql-mcp
Platform CLI
claude mcp add mysql-mcp -- docker run -i --rm docker.io/writenotenow/mysql-mcp:v1.0.0Platform CLI
codex mcp add mysql-mcp -- docker run -i --rm docker.io/writenotenow/mysql-mcp:v1.0.0Config file
{
"mcpServers": {
"mysql-mcp": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"docker.io/writenotenow/mysql-mcp:v1.0.0"
]
}
}
}Config file
{
"servers": {
"mysql-mcp": {
"type": "stdio",
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"docker.io/writenotenow/mysql-mcp:v1.0.0"
]
}
}
}Platform CLI
gemini mcp add mysql-mcp docker run -i --rm docker.io/writenotenow/mysql-mcp:v1.0.0Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about mysql-mcp
How do I install mysql-mcp in Claude Code?
Run claude mcp add mysql-mcp -- docker run -i --rm docker.io/writenotenow/mysql-mcp:v1.0.0.
What does mysql-mcp do?
It connects an AI agent to MySQL and provides tools for queries, schema work, diagnostics, replication checks, and database observability.
What does mysql-mcp need to run?
You need Docker and a MySQL server. The server also supports OAuth 2.1, TLS/SSL, and MCP HTTP transport.