
mcp-server-mysql
MCP server giving Claude and other LLMs read, and optional write, access to MySQL
The repository was last updated 129 days ago and is published under MIT.
mcp-server-mysql is an open-source MCP server for databases. It is available on CLI, API, Self-hosted, Linux, macOS and Windows.
- Pricing
- Open source
- Platforms
- CLI, API, Self-hosted
- What it can do
- Read-only
- GitHub stars
- 2.2K
- Last commit
Similar MCP servers
About mcp-server-mysql
Connects an AI assistant to a MySQL database so it can inspect table structures, run SQL and pull answers from live data. Queries are read-only unless write flags are switched on per operation type, which keeps the default footprint small for analysts and developers exploring production-like data.
The server adds several safeguards on top of basic query access. Per-database permissions let you allow writes on some schemas while locking others, PII redaction masks sensitive values in results, and multi-DB mode lets one session query several databases without reconnecting. Connections can run through an SSH tunnel or use SSL/TLS, including mutual TLS.
It is aimed at developers who already use Claude Code or a similar MCP client and want the model to answer questions about their MySQL data directly. A remote HTTP mode with bearer token auth is available for shared setups.
Tools this server provides (1)
Taken from the project documentation; the running server may differ.
From the tool list in its README, going by the names, all 1 tool only read data.
From the server's own tool labels and tool names; not verified by us.
- mysql_queryName suggests: reads
- Execute SQL queries. Read-only by default. Write operations enabled per flag.
What it does
- Read-only by default
- Write operations stay disabled until insert, update or delete flags are explicitly enabled.
- Schema-level permissions
- Read and write control can be set separately for each database.
- PII redaction
- Sensitive values are masked automatically in query results.
- Multi-database mode
- Run queries across several databases without reconnecting.
- SSH tunnel support
- Reach remote MySQL instances through a built-in SSH tunnel.
- SSL and mTLS
- Encrypted connections with an optional mutual TLS configuration.
- Remote HTTP mode
- Serve the server over HTTP with bearer token authentication.
Good for
- Letting an AI assistant explore unfamiliar database schemas
- Answering ad hoc data questions from a local MySQL database
- Querying several databases in one session without reconnecting
- Running guarded updates through an assistant with explicit write permissions
Pricing
Open source
More servers for the same service
mcp-server-mysql FAQ
Can mcp-server-mysql modify data by default?
No. All write operations are disabled until the insert, update or delete flags are set to true.
Which MySQL versions are supported?
MySQL 5.7 and newer, with 8.0 or later recommended. It needs Node.js v20 or newer.
How is mcp-server-mysql installed?
It runs through npx with the @benborla29/mcp-server-mysql package, configured with the MySQL connection environment variables in Claude Code or another MCP client.
What is the license?
The project is released under the MIT license.
Is mcp-server-mysql free?
Yes. mcp-server-mysql is open source, so you can use and self-host it for free.
What are the best alternatives to mcp-server-mysql?
The closest alternatives to mcp-server-mysql are mysql_mcp_server, mysql-mcp-server, mcp-mysql-server, Read Only Local Mysql MCP Server and Db Access MCP.
Where this comes from
- Description: written from the project's README.


