Let Claude poke around your MySQL (safely)
An MCP server that lets LLMs inspect schemas and run read-only queries against MySQL databases, with an escape hatch for writes if you dare.

What it does
This is a Model Context Protocol server that bridges MySQL databases to LLM tools like Claude Code, Cursor, and Codex CLI. It exposes a mysql_query tool for executing SQL, inspects schemas, and can optionally allow INSERT, UPDATE, DELETE, or even DDL operations if you flip the right environment switches. It also supports multi-database mode, SSH tunneling to remote servers, and running as a remote HTTP service with Bearer token auth.
The interesting bit
The fork leans hard into Claude Code specifically — auto-managing SSH tunnels on start/stop, importing configs from Claude Desktop, and scoping credentials to local, user, or project level. It’s essentially a database client rewritten as an LLM-readable API, with the safety rails made configurable rather than mandatory.
Key highlights
- Read-only by default; write operations require explicit
ALLOW_INSERT_OPERATION,ALLOW_UPDATE_OPERATION, orALLOW_DELETE_OPERATIONflags - SSH tunnel support with auto-start/stop hooks for remote database access
- Multi-database mode by omitting
MYSQL_DBand togglingMULTI_DB_WRITE_MODE - Remote MCP mode via HTTP with
REMOTE_SECRET_KEYBearer auth - Connection pooling, query timeouts, rate limiting, and SSL support configurable via environment variables
Caveats
- The README is overwhelmingly setup instructions; actual behavior details are sparse beyond the tool schema
- DDL support requires disabling read-only transactions entirely (
MYSQL_DISABLE_READ_ONLY_TRANSACTIONS), which feels like a big hammer for a small nail - No mention of query result size limits or row-level security controls
Verdict
Worth a look if you want Claude Code to explore production databases without copy-pasting schemas. Skip it if you need fine-grained permission models or heavy analytics workloads — this is a convenience wrapper, not a database platform.
Frequently asked
- What is benborla/mcp-server-mysql?
- An MCP server that lets LLMs inspect schemas and run read-only queries against MySQL databases, with an escape hatch for writes if you dare.
- Is mcp-server-mysql open source?
- Yes — benborla/mcp-server-mysql is open source, released under the MIT license.
- What language is mcp-server-mysql written in?
- benborla/mcp-server-mysql is primarily written in JavaScript.
- How popular is mcp-server-mysql?
- benborla/mcp-server-mysql has 1.9k stars on GitHub.
- Where can I find mcp-server-mysql?
- benborla/mcp-server-mysql is on GitHub at https://github.com/benborla/mcp-server-mysql.