MySQL MCP Server Pro
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| MYSQL_HOST | No | MySQL database host address | localhost |
| MYSQL_PORT | No | MySQL database port | 3306 |
| MYSQL_ROLE | No | MySQL role for permission control. Available values: readonly, writer, admin | readonly |
| MYSQL_USER | Yes | MySQL database username | |
| MYSQL_DATABASE | Yes | MySQL database name | |
| MYSQL_PASSWORD | Yes | MySQL database password |
Capabilities
Features and capabilities supported by this server
| Capability | Details |
|---|---|
| tools | {
"listChanged": false
} |
| prompts | {
"listChanged": false
} |
| experimental | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| execute_sqlC | 在MySQL数据库上执行SQL (支持多条SQL语句,以分号分隔) |
| get_chinese_initialsB | 创建表结构时,将中文字段名转换为拼音首字母字段 |
| get_table_descB | 根据表名搜索数据库中对应的表字段,支持多表查询(Search for table structures in the database based on table names, supporting multi-table queries) |
| get_table_indexC | 根据表名搜索数据库中对应的表索引,支持多表查询(Search for table indexes in the database based on table names, supporting multi-table queries) |
| get_table_lockB | 获取当前mysql服务器行级锁、表级锁情况(Check if there are row-level locks or table-level locks in the current MySQL server ) |
| get_table_nameA | 根据表中文名或表描述搜索数据库中对应的表名(Search for table names in the database based on table comments and descriptions ) |
| get_db_health_runningB | 获取当前mysql的健康状态(Analyze MySQL health status ) |
| get_db_health_index_usageA | 获取当前连接的mysql库的索引使用情况,包含冗余索引情况、性能较差的索引情况、未使用索引且查询时间大于30秒top5情况(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) |
| optimize_sqlA | 专业的SQL性能优化工具,基于MySQL执行计划、表结构信息、表数据量、表索引提供专家级优化建议。该工具能够分析SQL语句的执行效率,识别性能瓶颈,并提供具体的优化方案,包括索引优化、查询重写建议等,帮助提升数据库查询性能。 |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
| analyzing-mysql-prompt | 这是分析mysql相关问题的提示词 |
| query-table-data-prompt | 这是通过调用工具查询表数据的提示词 |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/Ustinianslife/mysql_mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server