MySQL MCP Server
Community-built MySQL integration with SSH tunnel support and safety-first read-only defaults — the best option in a fragmented landscape.
Client Compatibility
What It Does
Connects Claude to a MySQL database for querying, schema inspection, and optional write operations. The server is read-only by default — INSERT, UPDATE, and DELETE require explicit opt-in via environment variables. Supports SSH tunneling for remote databases.
What It Does Well
- Read-only by default is the correct security posture for database MCP servers. Write operations require setting ALLOW_INSERT_OPERATION, ALLOW_UPDATE_OPERATION, or ALLOW_DELETE_OPERATION to true. You won’t accidentally give Claude write access to production data by forgetting a flag.
- SSH tunnel support makes remote databases accessible without exposing ports. Configure SSH_HOST, SSH_PORT, SSH_USER, and SSH_PRIVATE_KEY_PATH to tunnel through a bastion host. Most database MCP servers assume localhost — this one handles the real-world scenario of databases behind firewalls.
- Claude Code optimized with one-line install. The npx setup just works without configuration gymnastics. Point it at your database, start querying.
What It Doesn’t Do Well
- No official MySQL MCP server exists, and this is a community project. Oracle hasn’t shipped an official MCP integration. The community has fragmented across at least four competing implementations (@benborla29, designcomputer, @neverinfamous, awslabs). If one maintainer walks away, you’re switching servers.
- The competing implementations create confusion about which to install. @neverinfamous/mysql-mcp has 192 tools and OAuth 2.1. designcomputer/mysql_mcp_server is Python-based. awslabs focuses on Aurora MySQL. None are obviously “the” MySQL MCP server. We recommend @benborla29 as the most balanced option, but the fragmentation itself is the con.
Setup Notes
You need a running MySQL server. The server connects via standard MySQL credentials — no API keys, no OAuth, just host/port/user/pass. If your MySQL is remote, the SSH tunnel feature saves you from exposing database ports. Setup took under 5 minutes with a local MySQL instance.
The read-only default means your first test will only let you SELECT. That’s intentional and correct. Enable write operations only after you’ve verified the server works with your schema.
Config
{
"mcpServers": {
"mysql": {
"command": "npx",
"args": ["-y", "@benborla29/mcp-server-mysql"],
"env": {
"MYSQL_HOST": "127.0.0.1",
"MYSQL_PORT": "3306",
"MYSQL_USER": "root",
"MYSQL_PASS": "your_password",
"MYSQL_DB": "your_database"
}
}
}
}
Tested With
- Claude Desktop on Windows 11
{
"mcpServers": {
"mysql-mcp": {
"command": "npx",
"args": [
"-y",
"@benborla29/mcp-server-mysql"
],
"env": {
"MYSQL_HOST": "127.0.0.1",
"MYSQL_PORT": "3306",
"MYSQL_USER": "root",
"MYSQL_PASS": "your_password",
"MYSQL_DB": "your_database"
}
}
}
} Environment Variables
MYSQL_HOST(required) — MySQL server hostnameMYSQL_PORT(required) — MySQL server port (default 3306)MYSQL_USER(required) — Database usernameMYSQL_PASS(required) — Database passwordMYSQL_DB(required) — Default database nameALLOW_INSERT_OPERATION— Enable INSERT queries (default false)ALLOW_UPDATE_OPERATION— Enable UPDATE queries (default false)ALLOW_DELETE_OPERATION— Enable DELETE queries (default false)
Prerequisites
- Node.js 18+
- Running MySQL server
View on GitHub · npx -y @benborla29/mcp-server-mysql
Reviewed by J-Dub · February 22, 2026