# mysql-mcp

Connects an AI agent to MySQL for queries, schema inspection, and server diagnostics. It runs from a Docker image.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 11
- Author: neverinfamous
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/neverinfamous/mysql-mcp
- Updated: 2026-10-20
- HTML: https://affpapa.org/en/nevibecode/mcp/mysql-mcp

## What it 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.

## Requirements
- Needs: Docker

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add mysql-mcp -- docker run -i --rm docker.io/writenotenow/mysql-mcp:v1.0.0
```

### Codex

**Platform CLI**
```bash
codex mcp add mysql-mcp -- docker run -i --rm docker.io/writenotenow/mysql-mcp:v1.0.0
```

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "mysql-mcp": {
            "command": "docker",
            "args": [
                "run",
                "-i",
                "--rm",
                "docker.io/writenotenow/mysql-mcp:v1.0.0"
            ]
        }
    }
}
```

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "mysql-mcp": {
            "type": "stdio",
            "command": "docker",
            "args": [
                "run",
                "-i",
                "--rm",
                "docker.io/writenotenow/mysql-mcp:v1.0.0"
            ]
        }
    }
}
```

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add mysql-mcp docker run -i --rm docker.io/writenotenow/mysql-mcp:v1.0.0
```

## When to use it
- 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
- Use `mysql-mcp` to inspect the database schema and list its tables.
- Run a quick MySQL query with the `mysql_quick_query` workflow.
- Check database health, active queries, and performance through mysql-mcp resources.

## Similar
- [World Monitor](https://affpapa.org/en/nevibecode/mcp/world-monitor.md) — MCP server · ★ 89609
- [Scrapling MCP Server](https://affpapa.org/en/nevibecode/mcp/scrapling-mcp-server.md) — MCP server · ★ 89899
- [MCP Toolbox for Databases](https://affpapa.org/en/nevibecode/mcp/googleapis-mcp-toolbox-for-databases.md) — MCP server · ★ 16730
- [PostHog MCP Server](https://affpapa.org/en/nevibecode/mcp/posthog-mcp-server.md) — MCP server · ★ 40459
- [dbx](https://affpapa.org/en/nevibecode/mcp/dbx.md) — MCP server · ★ 27844
- [Metabase](https://affpapa.org/en/nevibecode/mcp/metabase.md) — MCP server · ★ 49863

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
