$git clone https://github.com/benborla/mcp-server-mysqlUsing mcp-server-mysql to let your AI query MySQL? **Bloome** brings that to your whole team — an AI-agent IM platform where AI agents are members of the chat. Connect your MCP tools and have agents inspect schemas, run queries, and answer
| 1 | # MCP Server for MySQL |
| 2 | |
| 3 | [](https://archestra.ai/mcp-catalog/benborla__mcp-server-mysql) |
| 4 | |
| 5 | ## Sponsor — Bloome |
| 6 | |
| 7 | [](https://bloome.im/login?ref=2x7GfeSw) |
| 8 | |
| 9 | Using mcp-server-mysql to let your AI query MySQL? [**Bloome**](https://bloome.im/login?ref=2x7GfeSw) brings that to your whole team — an AI-agent IM platform where AI agents are members of the chat. Connect your MCP tools and have agents inspect schemas, run queries, and answer data questions for everyone in one thread. Zero local setup, runs in the cloud, on web and mobile. |
| 10 | |
| 11 | --- |
| 12 | |
| 13 | MCP server that gives Claude and other LLMs access to MySQL — inspect schemas, run queries, and optionally write data, all through the Model Context Protocol. |
| 14 | |
| 15 | ## Key Features |
| 16 | |
| 17 | - **Read-only by default** — write operations opt-in via env flags |
| 18 | - **Claude Code integration** — optimized for Anthropic's Claude Code CLI |
| 19 | - **SSH tunnel support** — built-in support for remote databases |
| 20 | - **Multi-DB mode** — query across multiple databases without reconnecting |
| 21 | - **Schema-specific permissions** — per-database read/write control |
| 22 | - **PII redaction** — automatic masking of sensitive data in results |
| 23 | - **Remote mode** — HTTP transport with bearer token auth |
| 24 | - **SSL/TLS support** — encrypted connections with mTLS option |
| 25 | |
| 26 | ## Requirements |
| 27 | |
| 28 | - Node.js v20+ |
| 29 | - MySQL 5.7+ (8.0+ recommended) |
| 30 | - MySQL user with appropriate privileges |
| 31 | |
| 32 | ## Quick Install |
| 33 | |
| 34 | **Claude Code (simplest):** |
| 35 | |
| 36 | ```bash |
| 37 | claude mcp add mcp_server_mysql \ |
| 38 | -e MYSQL_HOST="127.0.0.1" \ |
| 39 | -e MYSQL_PORT="3306" \ |
| 40 | -e MYSQL_USER="root" \ |
| 41 | -e MYSQL_PASS="your_password" \ |
| 42 | -e MYSQL_DB="your_database" \ |
| 43 | -- npx @benborla29/mcp-server-mysql |
| 44 | ``` |
| 45 | |
| 46 | **Claude Desktop / other clients:** |
| 47 | |
| 48 | ```json |
| 49 | { |
| 50 | "mcpServers": { |
| 51 | "mcp_server_mysql": { |
| 52 | "command": "npx", |
| 53 | "args": ["-y", "@benborla29/mcp-server-mysql"], |
| 54 | "env": { |
| 55 | "MYSQL_HOST": "127.0.0.1", |
| 56 | "MYSQL_PORT": "3306", |
| 57 | "MYSQL_USER": "root", |
| 58 | "MYSQL_PASS": "your_password", |
| 59 | "MYSQL_DB": "your_database" |
| 60 | } |
| 61 | } |
| 62 | } |
| 63 | } |
| 64 | ``` |
| 65 | |
| 66 | All write operations are disabled by default. Enable with `ALLOW_INSERT_OPERATION=true`, `ALLOW_UPDATE_OPERATION=true`, `ALLOW_DELETE_OPERATION=true`. |
| 67 | |
| 68 | ## Documentation |
| 69 | |
| 70 | - [Installation Guide](docs/INSTALLATION.md) — Smithery, Cursor, Codex, Claude Code, local repo, remote mode |
| 71 | - [Configuration & Environment Variables](docs/CONFIGURATION.md) — all env vars, advanced config |
| 72 | - [Multi-DB Mode](README-MULTI-DB.md) — querying multiple databases |
| 73 | - [PII Redaction](docs/PII-REDACTION.md) — automatic data masking |
| 74 | - [Testing](docs/TESTING.md) — test setup and running |
| 75 | - [Troubleshooting](docs/TROUBLESHOOTING.md) — common issues and fixes |
| 76 | - [Changelog](CHANGELOG.md) |
| 77 | |
| 78 | ## Tools & Resources |
| 79 | |
| 80 | **Tool: `mysql_query`** |
| 81 | Execute SQL queries. Read-only by default. Write operations enabled per flag. |
| 82 | |
| 83 | **Resources: `mysql://tables`** |
| 84 | Lists all tables and column metadata for the connected database. |
| 85 | |
| 86 | ## Contributing |
| 87 | |
| 88 | PRs welcome at [github.com/benborla/mcp-server-mysql](https://github.com/benborla/mcp-server-mysql). |
| 89 | |
| 90 | ```bash |
| 91 | git clone https://github.com/benborla/mcp-server-mysql.git |
| 92 | pnpm install |
| 93 | pnpm run build |
| 94 | pnpm test |
| 95 | ``` |
| 96 | |
| 97 | [](https://github.com/benborla/mcp-server-mysql/graphs/contributors) |
| 98 | |
| 99 | ## License |
| 100 | |
| 101 | MIT — see [LICENSE](LICENSE) for details. |