Loading...

MySQL MCP Server Pro provides a suite of tools for interacting with MySQL databases, including SQL execution, health analysis, and schema exploration, with role-based access control.
Boost this tool
Subscribe to listing upgrades or segmented pushes.
MySQL MCP Server Pro provides a suite of tools for interacting with MySQL databases, including SQL execution, health analysis, and schema exploration, with role-based access control.
This server offers a balance of functionality and security. It's safe for read-only operations and database analysis when configured with appropriate roles. However, caution is advised when granting write or admin privileges, and input validation is crucial to prevent SQL injection attacks.
Performance depends on the complexity of the SQL queries and the size of the database. Indexing is crucial for optimal performance.
Cost depends on the underlying MySQL database resources. There are no direct costs associated with the MCP server itself.
pip install mysql_mcp_server_pro{
"mcpServers": {
"mysql": {
"command": "uvx",
"args": [
"--from",
"mysql_mcp_server_pro",
"mysql_mcp_server_pro",
"--mode",
"stdio"
],
"env": {
"MYSQL_HOST": "192.168.x.xxx",
"MYSQL_PORT": "3306",
"MYSQL_USER": "root",
"MYSQL_PASSWORD": "root",
"MYSQL_DATABASE": "a_llm",
"MYSQL_ROLE": "admin"
}
}
}
}MYSQL_PORTMYSQL_PASSWORDexecute_sqlExecutes SQL queries against the MySQL database, subject to role-based permissions.
Can modify or delete data depending on the SQL command and user role.
get_chinese_initialsConverts Chinese field names to pinyin initials.
Read-only operation, no side effects.
get_db_health_runningAnalyzes MySQL health status, including connection, transaction, and lock status.
Read-only operation, retrieves database status information.
get_table_descRetrieves table structures based on table names.
Read-only operation, retrieves table metadata.
get_table_indexRetrieves table indexes based on table names.
Read-only operation, retrieves table index information.
get_table_lockChecks for row-level or table-level locks in the MySQL server.
Read-only operation, retrieves lock information.
get_table_nameSearches for table names based on table comments and descriptions.
Read-only operation, searches table metadata.
get_db_health_index_usageGets the index usage of the MySQL database, including redundant and unused indexes.
Read-only operation, retrieves index usage statistics.
optimize_sqlProvides expert optimization suggestions based on MySQL execution plans and table information.
Read-only operation, analyzes SQL and provides suggestions.
use_prompt_queryTableDataUses built-in prompts to construct a chain call of tools for querying table data.
Depends on the prompt and tools invoked, could potentially lead to data modification.
OAuth
hybrid
This server offers a balance of functionality and security. It's safe for read-only operations and database analysis when configured with appropriate roles. However, caution is advised when granting write or admin privileges, and input validation is crucial to prevent SQL injection attacks.
Autonomy depends on the configured role and the specific tool being used. Admin role grants full access, while readonly limits to safe operations.
Production Tip
Monitor database performance and resource usage to prevent overload when using health analysis tools.
OAuth2.0 is supported.
Database connection parameters are configured via environment variables or a .env file.
The available roles are readonly, writer, and admin, each with different levels of access.
Yes, you can add new tool classes in the handles package and import them into __init__.py.
Use the optimize_sql tool to get optimization suggestions based on the execution plan.
The documentation does not explicitly mention connection pooling, but it is recommended to implement it for production environments.
Always sanitize user inputs and use parameterized queries to prevent SQL injection.