mysql-mcp-pro
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": false
} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
| experimental | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| pingA | 测试 MySQL 数据库连接是否正常,返回服务器版本、当前库、连接池状态。 |
| get_server_statusA | 获取 MySQL 服务器关键状态指标(连接数、QPS、慢查询、流量、InnoDB 行操作等)。 |
| list_databasesA | 列出服务器上所有可访问的数据库(SCHEMAS),区分系统库与用户库。 |
| list_tablesB | 列出指定数据库中的所有表(含引擎、行数、大小、注释)。 |
| describe_tableA | 查看表结构:字段、主键、索引、外键、建表SQL。 |
| list_viewsC | 列出数据库中的所有视图。 |
| list_routinesC | 列出存储过程或函数。 Parameters: routine_type: PROCEDURE 或 FUNCTION |
| list_triggersC | 列出数据库中的所有触发器。 |
| er_graphB | 生成当前库的 ER 关系图数据(节点=表,边=外键关系)。 返回 nodes(表,含主键列)和 edges(外键关系)。 |
| execute_queryB | 执行 SQL(支持读/写/DDL,受安全策略限制)。 Parameters: sql: SQL 语句,参数用 %s 占位符 database: 目标数据库 params: 参数列表(防 SQL 注入) session_id: 若在事务中传入会话ID |
| execute_selectA | 执行只读 SELECT/SHOW/DESCRIBE/EXPLAIN(即使 ALLOW_DDL/READ_ONLY 配置有误也只允许读)。 Parameters: sql: SELECT 语句 database: 数据库 params: 参数列表 limit: 自定义结果行数限制(≤1000) |
| get_table_dataA | 快速获取表数据(封装 SELECT,避免手写 SQL)。 Parameters: table: 表名 columns: 列名,如 'id,name,email',默认 '*' where: WHERE 条件(不含 WHERE 关键字),如 'id > 10 AND status = 1' order_by: 排序,如 'id DESC' limit: 返回行数(≤1000) offset: 偏移量 |
| count_rowsC | 统计表的行数,支持可选 WHERE 条件。 |
| explain_queryC | 分析 SQL 执行计划,返回 EXPLAIN 结果并给出中文解读。 Parameters: sql: 要分析的 SELECT 语句 format: traditional / json |
| export_queryA | 执行查询并把结果导出为 CSV 或 JSON 文件,返回本地文件路径。 Parameters: sql: SELECT 语句 filename: 文件名(不含扩展名),自动加时间戳避免覆盖 format: csv / json database: 数据库 params: 参数列表 |
| show_processlistA | 查看当前 MySQL 进程列表(SHOW FULL PROCESSLIST)。 |
| kill_queryA | Kill 指定进程(需要 SUPER 权限)。管理员操作,会被审计。 Parameters: process_id: SHOW PROCESSLIST 里的 Id |
| list_query_historyA | 查看本会话最近执行过的 SQL 历史(时间、耗时、结果、错误)。 |
| begin_transactionA | 开启一个新事务,返回 session_id。后续在 execute_query 中传入 session_id 即可在同一事务里执行多语句。 记得在结束时调用 commit_transaction 或 rollback_transaction。 ⚠️ 事务会独占一条连接,请在操作完毕后及时 commit/rollback。 |
| commit_transactionC | 提交指定事务。 |
| rollback_transactionC | 回滚指定事务。 |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
| generate_query | 根据自然语言需求和相关表信息生成 SQL 查询。 Parameters: description: 要查询的问题描述(自然语言) tables: 相关表名,多个用逗号分隔 |
| optimize_sql | 优化现有 SQL 的性能。 Parameters: sql: 需要优化的 SQL 语句 |
| compare_schema | 对比两张表的结构差异,可用于数据迁移/合并场景。 Parameters: table_a: 表A table_b: 表B database: 数据库 |
| database_summary | 对数据库做一份整体概览报告(大小、行数、关系、健康度)。 Parameters: database: 数据库名,留空则使用当前数据库 |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
| resource_databases | 所有数据库列表 |
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/CCCT173/mysql-mcp-pro'
If you have feedback or need assistance with the MCP directory API, please join our Discord server