MySQL MCP Server Pro
mysql_mcp_server_pro
A MySQL MCP server that runs SQL under access roles, finds tables by comments and analyzes locks, indexes and query plans
- 249 ★ on the repository
- Last commit
- MIT
Broad access
Why this level
- The writer role permits INSERT, UPDATE and DELETE; admin also permits DROP and TRUNCATE when the MySQL account has those privileges
- The database password is kept in environment variables or a .env file
- In HTTP mode the server defaults to listening on 0.0.0.0 with OAuth checks disabled
Install
- Works in
In your terminal, with SkillFoxx CLI
npx skillfoxx add mcp/mysql-mcp-server-proDetects the agents on your machine, shows the access level and pins the version.
Other ways to install
Access and checks
How we reviewBroad accessThe tool can change data, run commands or handle secrets.
- The writer role permits INSERT, UPDATE and DELETE; admin also permits DROP and TRUNCATE when the MySQL account has those privileges
- The database password is kept in environment variables or a .env file
- In HTTP mode the server defaults to listening on 0.0.0.0 with OAuth checks disabled
This is third-party code. Review the repository files before installing.
What it does
The server gives an agent MCP tools for working with MySQL. It executes SQL, exposes schemas and helps investigate slow queries. Multiple statements are split on semicolons and executed sequentially, without a guaranteed atomic transaction for the entire string. Beyond running statements, the server helps understand a database. get_table_name finds tables by their comments and descriptions, get_table_desc and get_table_index show structure and indexes for several tables at once, and get_table_lock finds row and table locks. get_db_health_running assesses connections, transactions and locks, while get_db_health_index_usage looks for redundant and weak indexes. optimize_sql gives tuning advice based on the execution plan, structure, data volume and indexes. There is also get_chinese_initials, which converts Chinese field names to pinyin initials. Prompt templates for analyzing MySQL problems and querying data are built in. New tools are added as a subclass of BaseHandler in the handles package. OAuth 2.0 can be enabled for HTTP access.
Who it is for. For developers and database administrators who ask Claude Code, Cursor or Cline to explore a MySQL schema, find a slow-query bottleneck or the cause of a lock.
Good fit when
- Tables have abbreviated names and you need to find one by its comment: get_table_name does this
- A query is slow and you need the execution plan, index status and recommendations: optimize_sql handles that
- An UPDATE statement hangs and you need to find the row or table lock through get_table_lock
- You want an overview of database health: connections, transactions, locks and unused indexes
- You need to inspect a test database schema and data using a MySQL account with explicitly limited grants
Not a fit when
- You need another database engine: PostgreSQL, SQLite and others are not supported here
- You need to prevent writes but the MySQL account has broad grants: the application’s readonly role alone is insufficient
- You need a publicly exposed server: only OAuth 2.0 with a built-in password from the env file is described
- You run the server in production without network restrictions: the database credentials sit in environment variables
- You need an actively updated version: the last commit in the repository dates from August 2025
Example request
Using the MySQL MCP check the current database health and find locks, then suggest tuning for my query that joins two tablesMCP
- Transport
- stdio, http, sse
- Authentication
- not required
Environment variables
MYSQL_HOSTrequired- MySQL server address
MYSQL_PORT- MySQL port, usually 3306
MYSQL_USERrequired- Database user
MYSQL_PASSWORDrequired, secret- Database user password
MYSQL_DATABASErequired- Database name
MYSQL_ROLE- Access role: readonly, writer or admin, readonly by default
Limitations
Python 3.11 or later is required. The readonly, writer and admin roles filter queries by keywords inside the application. This is not a full SQL parser: enforce read-only access through the MySQL account itself. The server commits data changes automatically. The project has not been updated recently: last commit in August 2025.
Without explicit stdio mode it starts HTTP on all network interfaces, with OAuth disabled by default. Use the local configuration for an initial connection. A separate network deployment must replace built-in authentication secrets. SQL and results enter model context, and error logs can contain full query text.
How to disable. Remove the mysql or mysql_mcp_server_pro block from mcpServers in the client configuration and restart the client. pip uninstall mysql_mcp_server_pro removes the installed package, and revoke excess privileges from the MySQL user on the database side.
FAQ
How do I connect MySQL MCP Server Pro to Claude Code or Cursor?
Run without cloning: command uvx, arguments --from mysql_mcp_server_pro mysql_mcp_server_pro --mode stdio and the MYSQL_* variables in the client config's env block. Or install the package with pip install mysql_mcp_server_pro and run `mysql_mcp_server_pro --mode stdio --envfile /path/to/.env`, using your environment file.
What rights do readonly, writer and admin give?
Readonly: SELECT, SHOW, DESCRIBE and EXPLAIN. Writer: the same plus INSERT, UPDATE and DELETE. Admin: also CREATE, ALTER, DROP and TRUNCATE. The role is set by MYSQL_ROLE and readonly applies by default.
How do I find a table by its comment?
The agent calls get_table_name with a description and the server searches tables by their comments and descriptions. That helps when table names are codes, as in databases with abbreviations.
Can I expose the HTTP server immediately?
No. Network mode needs separate authentication, secret and port-access configuration. This card uses stdio for the initial setup, avoiding a network listener.
How do I add my own tool?
Create a class in the handles package, inherit it from BaseHandler and implement get_tool_description and run_tool, then import the class in __init__.py so the server picks it up.
Discussion
No questions or reviews yet.
Related
MCP serversA Python MCP server for MySQL: listing tables, reading data, running SQL and inspecting schema through a controlled interface
MCP server that gives an agent access to MySQL: schema inspection and queries, read-only by default, writes behind flags
A single-binary MCP server for MySQL, MariaDB, PostgreSQL and SQLite: read-only by default, with optional PII redaction
One MCP server for SQLite, SQL Server, PostgreSQL and MySQL: read and change data, edit schemas and export to CSV and JSON
A SQLite-based SQL engine with plugins for apps, databases and files: the anyquery mcp command exposes that data to Claude, Cursor and other MCP clients
Official MongoDB MCP server: queries and aggregations, index management, Atlas clusters and local deployments
Comparison with similar tools
Cards that share the main search query, and how they differ.
| Tool | Official | Authentication | Repository stars | Main difference |
|---|---|---|---|---|
| MySQL MCP Server Pro (this card) | no | not required | 249 | |
| MySQL MCP Server | no | not required | 1,408 | a basic Python MCP server for MySQL: tables, reading data and SQL, with no lock or index analysis |
| MCP Server for MySQL | no | not required | 2,209 | read-only by default with writes enabled by flags, while this server uses roles and has analysis tools |
README in short
The project uses MIT and its currently published package is version 0.2.1. Developers can add custom handlers in Python to extend its tools.