# mysql_mcp_server_pro

> mysql_mcp_server_pro is an open-source MCP server for databases. MCP server giving AI clients MySQL access with role-based permissions and health analysis. It is available on CLI, API, Self-hosted, Linux, macOS and Windows.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** CLI, API, Self-hosted, Linux, macOS, Windows
- **Repository:** https://github.com/wenb1n-dev/mysql_mcp_server_pro
- **GitHub stars:** 249
- **License:** MIT
- **Categories:** [databases](https://ai-powered.com/categories/databases)
- **Listing updated:** 2026-12-01

## About

Beyond basic create, read, update and delete, this server adds diagnostics that an assistant can call: execution plan review, table lock checks, index usage reports and an overall database health check. It runs over stdio, SSE or streamable HTTP, and can be placed behind OAuth 2.0 when served over HTTP.

Access is governed by a role setting with three levels. A readonly role allows only SELECT, SHOW, DESCRIBE and EXPLAIN; writer adds INSERT, UPDATE and DELETE; admin also permits CREATE, ALTER, DROP and TRUNCATE. Several statements can be sent in one call, separated by semicolons. Lookup tools can find tables and fields from their comments, and a helper converts Chinese field names to pinyin initials.

The project is aimed at developers and data teams who want an assistant to query, explain or tune a MySQL database. Developers can add their own tools by subclassing a base handler class and registering it.

## Features

- **Role-based SQL permissions:** Readonly, writer and admin roles restrict which statement types the assistant may run.
- **Execution plan analysis:** Reviews query plans alongside table structure, indexes and row counts to suggest optimizations.
- **Database health checks:** Reports connection, transaction, running and lock status for the connected MySQL server.
- **Lock and index diagnostics:** Detects row and table locks and flags redundant, poorly performing or unused indexes.
- **Comment-based table lookup:** Finds tables and their structures by searching table comments and descriptions.
- **Custom tool extensions:** New tools can be added by subclassing a base handler and importing it into the server.

## Good for

- Diagnosing why a slow query is slow and getting index recommendations
- Investigating a stuck UPDATE or suspected deadlock on a MySQL server
- Letting a non-expert query a database with read-only access
- Finding the right tables in a large schema by describing what they hold
- Running a quick health check on a MySQL instance from an AI client

## Tools

From the tool list in its README, going by the names, 1 of 10 tools changes data; 1 name doesn't say. From the server's own tool labels and tool names; not verified by us.

- `execute_sql` (name suggests: changes): Runs SQL statements permitted by the configured role.
- `get_chinese_initials` (name suggests: reads): Converts Chinese field names to pinyin initials.
- `get_db_health_running` (name suggests: reads): Analyzes connection, transaction, running and lock status.
- `get_table_desc` (name suggests: reads): Returns table structures for one or more table names.
- `get_table_index` (name suggests: reads): Returns indexes for one or more tables.
- `get_table_lock` (name suggests: reads): Checks for row-level or table-level locks on the server.
- `get_table_name` (name suggests: reads): Searches table names by comments and descriptions.
- `get_db_health_index_usage` (name suggests: reads): Reports index usage, redundant indexes and unused indexes.
- `optimize_sql`: Suggests SQL optimizations from execution plans and table data.
- `use_prompt_queryTableData` (name suggests: reads): Lets the model chain tool calls using a built-in prompt; disabled by default.

## FAQ

### What transport modes does mysql_mcp_server_pro support?

It supports STDIO, SSE and streamable HTTP transports.

### How are database permissions controlled?

A MYSQL_ROLE setting chooses readonly, writer or admin, and each role allows a fixed set of SQL statement types. The default is readonly.

### Can I run several SQL statements at once?

Yes, multiple statements can be executed in one request when separated by semicolons.

### How do I install mysql_mcp_server_pro?

It can be installed with pip as mysql_mcp_server_pro, or run directly with uvx by adding the server to an MCP client configuration.

### Is mysql_mcp_server_pro free?

Yes. mysql_mcp_server_pro is open source, so you can use and self-host it for free.

### What are the best alternatives to mysql_mcp_server_pro?

The closest alternatives to mysql_mcp_server_pro are mysql_mcp_server, postgres-mcp, mcp-server-mysql, MySQL MCP Server and Mysql MCP.

## Where this comes from

- Description: written from the project's README.

## Alternatives

- [mysql_mcp_server](https://ai-powered.com/mcp/mysql-mcp-server-4): mysql_mcp_server is an open-source MCP server for databases.
- [postgres-mcp](https://ai-powered.com/mcp/postgres-mcp-4): postgres-mcp is an open-source MCP server for databases.
- [mcp-server-mysql](https://ai-powered.com/mcp/mcp-server-mysql): mcp-server-mysql is an open-source MCP server for databases.
- [MySQL MCP Server](https://ai-powered.com/mcp/mysql-mcp-server): MySQL MCP Server is an open-source MCP server for databases.
- [Mysql MCP](https://ai-powered.com/mcp/mysql-mcp-2): Mysql MCP is an open-source MCP server for databases.
- [MCP Mysql Connector](https://ai-powered.com/mcp/mcp-mysql-connector): MCP Mysql Connector is an open-source MCP server for databases.
- [go-mcp-mysql](https://ai-powered.com/mcp/go-mcp-mysql): go-mcp-mysql is an open-source MCP server for databases.
- [Mysql](https://ai-powered.com/mcp/mysql): Mysql is an open-source MCP server for databases.

---
Source: https://ai-powered.com/mcp/mysql-mcp-server-pro
