Integrations
Enables configuration of MySQL database connection settings (host, port, user, password, database) through environment variables stored in .env files.
Allows executing SQL queries against MySQL databases, supporting multiple SQL statements, table name/field querying based on comments, SQL execution plan analysis, and Chinese to pinyin field conversion.
mcp_mysql_server
Introduction
mcp_mysql_server_pro is not just about MySQL CRUD operations, but also includes database anomaly analysis capabilities and makes it easy for developers to extend with custom tools.
- Supports both STDIO and SSE modes
- Supports multiple SQL execution, separated by ";"
- Supports querying database table names and fields based on table comments
- Supports SQL execution plan analysis
- Supports Chinese field to pinyin conversion
- Supports table lock analysis
- Supports database health status analysis
- Supports permission control with three roles: readonly, writer, and adminCopy
- Supports prompt template invocation
Tool List
Tool Name | Description |
---|---|
execute_sql | SQL execution tool that can execute ["SELECT", "SHOW", "DESCRIBE", "EXPLAIN", "INSERT", "UPDATE", "DELETE", "CREATE", "ALTER", "DROP", "TRUNCATE"] commands based on permission configuration |
get_chinese_initials | Convert Chinese field names to pinyin initials |
get_db_health_running | Analyze MySQL health status (connection status, transaction status, running status, lock status detection) |
get_table_desc | Search for table structures in the database based on table names, supporting multi-table queries |
get_table_index | Search for table indexes in the database based on table names, supporting multi-table queries |
get_table_lock | Check if there are row-level locks or table-level locks in the current MySQL server |
get_table_name | Search for table names in the database based on table comments and descriptions |
get_db_health_index_usage | Get the index usage of the currently connected mysql database, including redundant index situations, poorly performing index situations, and the top 5 unused index situations with query times greater than 30 seconds |
Prompt List
Prompt Name | Description |
---|---|
analyzing-mysql-prompt | This is a prompt for analyzing MySQL-related issues |
query-table-data-prompt | This is a prompt for querying table data using tools. If description is empty, it will be initialized as a MySQL database query assistant |
Usage Instructions
SSE Mode
- Use uv to start the service
Add the following content to your mcp client tools, such as cursor, cline, etc.
mcp json as follows:
Modify the .env file content to update the database connection information with your database details:
Start commands:
STDIO Mode
Add the following content to your mcp client tools, such as cursor, cline, etc.
mcp json as follows:
Custom Tool Extensions
- Add a new tool class in the handles package, inherit from BaseHandler, and implement get_tool_description and run_tool methods
- Import the new tool in init.py to make it available in the server
Examples
- Create a new table and insert data, prompt format as follows:
- Query data based on table comments, prompt as follows:
- Analyze slow SQL, prompt as follows:
- Analyze SQL deadlock issues, prompt as follows:
- Analyze the health status prompt as follows
You must be authenticated.
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
Added support for STDIO mode and SSE mode Added support for multiple SQL execution, separated by ";" Added ability to query database table names and fields based on table comments Added SQL Execution Plan Analysis Added Chinese field to pinyin conversion
Related MCP Servers
- -securityAlicense-qualityFacilitates interaction with Microsoft SQL Server Express, supporting database operations such as querying, table management, and schema inspection via natural language MCP commands.Last updated -1PythonMIT License
- -securityFlicense-qualityA server that enables interaction with PostgreSQL, MySQL, MariaDB, or SQLite databases through Claude Desktop using natural language queries.Last updated -Python
- -securityFlicense-qualityA natural language interface that allows Claude to execute SQL queries on your local MySQL databases, enabling database interaction using natural language.Last updated -2Python
- -securityFlicense-qualityEnables secure interaction with MySQL databases, allowing AI assistants to list tables, read data, and execute SQL queries through a controlled interface.Last updated -Python