MySQL MCP Server Pro
Provides comprehensive MySQL database management capabilities including CRUD operations, SQL execution with role-based permissions (readonly, writer, admin), database health analysis, table lock detection, index usage analysis, SQL performance optimization, and support for querying tables by comments with Chinese-to-pinyin conversion.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MySQL MCP Server Proanalyze the health of our production database and check for any table locks"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
mcp_mysql_server_pro
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 all Model Context Protocol (MCP) transfer modes (STDIO, SSE, Streamable Http)
Supports OAuth2.0
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 admin
"readonly": ["SELECT", "SHOW", "DESCRIBE", "EXPLAIN"], # Read-only permissions "writer": ["SELECT", "SHOW", "DESCRIBE", "EXPLAIN", "INSERT", "UPDATE", "DELETE"], # Read-write permissions "admin": ["SELECT", "SHOW", "DESCRIBE", "EXPLAIN", "INSERT", "UPDATE", "DELETE", "CREATE", "ALTER", "DROP", "TRUNCATE"] # Administrator permissionsSupports prompt template invocation
Related MCP server: MySQL MCP Server Pro
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 |
optimize_sql | Professional SQL performance optimization tool, providing expert optimization suggestions based on MySQL execution plans, table structure information, table data volume, and table indexes. |
use_prompt_queryTableData | Use built-in prompts to let the model construct a chain call of tools in mcp (not a commonly used fixed tool, you need to modify the code to enable it, see this class for details) |
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
Installation and Configuration
Install Package
pip install mysql_mcp_server_proConfigure Environment Variables Create a
.envfile with the following content:
# MySQL Database Configuration
MYSQL_HOST=localhost
MYSQL_PORT=3306
MYSQL_USER=your_username
MYSQL_PASSWORD=your_password
MYSQL_DATABASE=your_database
# Optional, default is 'readonly'. Available values: readonly, writer, admin
MYSQL_ROLE=readonlyRun Service
# SSE mode
mysql_mcp_server_pro --mode sse --envfile /path/to/.env
## Streamable Http mode (default)
mysql_mcp_server_pro --envfile /path/to/.env
# Streamable Http oauth Authentication
mysql_mcp_server_pro --oauth true
mcp client
go to see see "Use uv to start the service" ^_^
Note:
The
.envfile should be placed in the directory where you run the command or use --envfile parameter to specify the pathYou can also set these variables directly in your environment
Make sure the database configuration is correct and can connect
Run with uvx, Client Configuration
This method can be used directly in MCP-supported clients, no need to download the source code. For example, Tongyi Qianwen plugin, trae editor, etc.
{
"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"
}
}
}
}Local Development with Streamable Http 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:
{
"mcpServers": {
"mysql_mcp_server_pro": {
"name": "mysql_mcp_server_pro",
"type": "streamableHttp",
"description": "",
"isActive": true,
"url": "http://localhost:3000/mcp/"
}
}
}Modify the .env file content to update the database connection information with your database details:
# MySQL Database Configuration
MYSQL_HOST=192.168.xxx.xxx
MYSQL_PORT=3306
MYSQL_USER=root
MYSQL_PASSWORD=root
MYSQL_DATABASE=a_llm
MYSQL_ROLE=adminStart commands:
# Download dependencies
uv sync
# Start
uv run -m mysql_mcp_server_pro.server
# Custom env file location
uv run -m mysql_mcp_server_pro.server --envfile /path/to/.env
# oauth Authentication
uv run -m mysql_mcp_server_pro.server --oauth trueLocal Development with 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:
{
"mcpServers": {
"mysql_mcp_server_pro": {
"name": "mysql_mcp_server_pro",
"description": "",
"isActive": true,
"url": "http://localhost:9000/sse"
}
}
}Modify the .env file content to update the database connection information with your database details:
# MySQL Database Configuration
MYSQL_HOST=192.168.xxx.xxx
MYSQL_PORT=3306
MYSQL_USER=root
MYSQL_PASSWORD=root
MYSQL_DATABASE=a_llm
MYSQL_ROLE=adminStart commands:
# Download dependencies
uv sync
# Start
uv run -m mysql_mcp_server_pro.server --mode sse
# Custom env file location
uv run -m mysql_mcp_server_pro.server --mode sse --envfile /path/to/.envLocal Development with STDIO Mode
Add the following content to your mcp client tools, such as cursor, cline, etc.
mcp json as follows:
{
"mcpServers": {
"operateMysql": {
"isActive": true,
"name": "operateMysql",
"command": "uv",
"args": [
"--directory",
"/Volumes/mysql_mcp_server_pro/src/mysql_mcp_server_pro", # Replace this with your project path
"run",
"-m",
"mysql_mcp_server_pro.server",
"--mode",
"stdio"
],
"env": {
"MYSQL_HOST": "localhost",
"MYSQL_PORT": "3306",
"MYSQL_USER": "root",
"MYSQL_PASSWORD": "123456",
"MYSQL_DATABASE": "a_llm",
"MYSQL_ROLE": "admin"
}
}
}
} 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
OAuth2.0 Authentication
Start the authentication service. By default, it uses the built-in OAuth 2.0 password mode authentication. You can modify your own authentication service address in the env file.
uv run -m mysql_mcp_server_pro.server --oauth trueVisit the authentication service at http://localhost:3000/login. Default username and password are configured in the env file.
Copy the token and add it to the request headers, for example:
{
"mcpServers": {
"mysql_mcp_server_pro": {
"name": "mysql_mcp_server_pro",
"type": "streamableHttp",
"description": "",
"isActive": true,
"url": "http://localhost:3000/mcp/",
"headers": {
"authorization": "bearer TOKEN_VALUE"
}
}
}
}Examples
Create a new table and insert data, prompt format as follows:
# Task
Create an organizational structure table with the following structure: department name, department number, parent department, is valid.
# Requirements
- Table name: department
- Common fields need indexes
- Each field needs comments, table needs comment
- Generate 5 real data records after creation
Query data based on table comments, prompt as follows:
Search for data with Department name 'Executive Office' in Department organizational structure tableAnalyze slow SQL, prompt as follows:
select * from t_jcsjzx_hjkq_cd_xsz_sk xsz
left join t_jcsjzx_hjkq_jcd jcd on jcd.cddm = xsz.cddm
Based on current index situation, review execution plan and provide optimization suggestions in markdown format, including table index status, execution details, and optimization recommendationsAnalyze SQL deadlock issues, prompt as follows:
update t_admin_rms_zzjg set sfyx = '0' where xh = '1' is stuck, please analyze the causeAnalyze the health status prompt as follows
Check the current health status of MySQLAvailable Tools
9 toolsexecute_sqlC
在MySQL数据库上执行SQL (支持多条SQL语句,以分号分隔)
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | 要执行的SQL语句 |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided, so description carries full burden. It discloses multi-statement support (semicolon-separated), but critically omits: whether the tool returns result sets, error handling behavior, transaction semantics, timeout limits, or safety warnings appropriate for arbitrary SQL execution.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Extremely concise single sentence with main action front-loaded. The parenthetical addition '(支持多条SQL语句,以分号分隔)' efficiently conveys multi-statement capability without verbosity. No wasted words.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Inadequate for a high-complexity database execution tool with no output schema and no annotations. Missing critical context: return value format (result sets vs execution status), error handling, safety considerations for destructive operations, and whether it distinguishes between DDL/DML/DQL statements.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% with the 'query' parameter already described as '要执行的SQL语句'. The description adds context that multiple statements are supported (semicolon-separated), which applies to this parameter, but does not elaborate on SQL syntax requirements, injection risks, or result set limits.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Clearly states the tool executes SQL on MySQL databases with specific verb '执行' (execute) and resource 'SQL'. However, it does not explicitly differentiate from read-only siblings like 'get_table_desc' or 'get_table_index' that could be used for inspection instead.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Provides no explicit guidance on when to use this tool versus the specialized read-only alternatives (get_table_desc, get_table_index, etc.). While it notes multi-statement support in parentheses, it lacks warnings about write operations or prerequisites like permissions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_chinese_initialsB
创建表结构时,将中文字段名转换为拼音首字母字段
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | 要获取拼音首字母的汉字文本,以“,”分隔 |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, and the description fails to disclose critical behavioral traits such as whether this is a pure computation (likely) or has side effects, the return value format (string? array? separator used?), rate limits, or idempotency. It only describes the input transformation.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single efficient sentence that front-loads the context ('when creating table structures') and follows with the action. No redundant words; every clause earns its place by establishing either the timing or the transformation logic.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's simplicity (single string parameter, no nested objects), the description is minimally adequate. However, with no output schema provided, the description should have specified the return format (e.g., comma-separated initials, case format) which is currently missing.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
With 100% schema description coverage, the parameter 'text' is fully documented in the schema as comma-separated Chinese text. The description adds domain context by specifying these are 'field names' rather than arbitrary text, but does not add syntax details or examples beyond the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool converts Chinese field names to pinyin initials during table structure creation, using specific verbs ('convert') and resources ('Chinese field names', 'pinyin initials'). It distinguishes itself from database health/monitoring siblings by specifying the schema design context.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The phrase '创建表结构时' (when creating table structures) provides implied usage context, indicating this is for database schema design. However, it lacks explicit guidance on when not to use it, prerequisites, or alternatives to this approach.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
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)
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries full burden and successfully discloses specific behavioral limits (returns 'top 5' unused indexes, focuses on queries >30 seconds). However, it omits safety-critical details like whether the operation is read-only, expensive to run on large databases, or if it acquires locks.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Bilingual presentation is efficient for accessibility, with the core value proposition (database health diagnostics) presented immediately. The list of three specific check categories is appropriately detailed, though slightly verbose.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Without an output schema, the description adequately compensates by enumerating the three specific data categories returned (redundant, poor performance, unused top 5). Could be improved by indicating the return format (table, JSON array, etc.).
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Tool accepts zero parameters, meeting the baseline expectation. The description appropriately implies no filtering is needed by specifying 'currently connected mysql库,' indicating it operates on the active session context without additional inputs.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Description clearly states the specific diagnostic purpose (getting MySQL index usage) and distinguishes from sibling get_table_index by emphasizing database-level health metrics (redundant, poorly performing, unused indexes) rather than table schema listing.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Provides implied usage context (diagnostic/health check scenarios) by listing specific index problems it detects, but lacks explicit guidance on when to use versus alternatives like optimize_sql or get_db_health_running, and omits prerequisites like requiring an existing database connection.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_db_health_runningB
获取当前mysql的健康状态(Analyze MySQL health status )
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure but fails to explain what specific health metrics are returned (e.g., connections, uptime, performance metrics), whether the check is read-only, or if it impacts database performance. The term 'running' in the tool name suggests process status monitoring, but the description only mentions general health.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is extremely concise with a single bilingual phrase. While not wasteful, the brevity is insufficient given the lack of annotations and output schema. The structure is simple but front-loads the core concept effectively.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the absence of annotations, output schema, and parameters, the description should explain return values and specific health aspects checked. It fails to clarify what distinguishes this from 'get_db_health_index_usage' or what 'running' implies in the tool name. For a health monitoring tool, this leaves critical gaps in understanding.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema contains zero parameters, which per evaluation rules establishes a baseline score of 4. There are no parameters requiring semantic clarification beyond the schema definition.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly identifies the tool's purpose as retrieving/analyzing MySQL health status using specific verbs (获取/Analyze) and resource (MySQL health status). However, it does not distinguish from the sibling tool 'get_db_health_index_usage', which also deals with health but focuses specifically on indexes.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives like 'get_db_health_index_usage' or other database monitoring tools. It does not mention prerequisites, execution context, or conditions that would trigger its use.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_table_descB
根据表名搜索数据库中对应的表字段,支持多表查询(Search for table structures in the database based on table names, supporting multi-table queries)
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | 要搜索的表名 |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Without annotations, the description carries the full burden. It discloses multi-table query support (useful behavioral context) but fails to indicate read-only safety, return format details, or whether partial matching/wildcards are supported in the search.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The bilingual format (Chinese with English parenthetical) is efficient and front-loaded. The single sentence conveys both the core action and a key capability without redundancy, though the dual-language format slightly increases length.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a single-parameter tool, the description is minimally adequate but lacks return value documentation (critical since no output schema exists) and safety annotations. The multi-table mention helps, but more detail on output structure would improve completeness.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
With 100% schema coverage, the baseline is 3. The description implies multi-table capability ('supporting multi-table queries') which hints at how the 'text' parameter might be used, but doesn't explicitly document syntax (comma-separated, wildcards, etc.) beyond the schema's basic definition.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states it searches for 'table structures' and specifically 'table fields' (表字段) based on table names, distinguishing it from sibling get_table_name. However, it doesn't specify the exact schema metadata returned (e.g., data types, constraints, comments).
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
While it mentions 'supporting multi-table queries' as a capability, it provides no explicit guidance on when to use this tool versus alternatives like execute_sql (which could also retrieve schema) or get_table_name. No 'when-not-to-use' or prerequisites are provided.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_table_indexC
根据表名搜索数据库中对应的表索引,支持多表查询(Search for table indexes in the database based on table names, supporting multi-table queries)
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | 要搜索的表名 |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure but only states the basic search function. It fails to clarify whether the operation is read-only, what specific index metadata is returned, or whether the search supports wildcards/patterns.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is compact and front-loaded with the key action. The bilingual format (Chinese with English parenthetical) is slightly verbose but acceptable for clarity. No sentences are wasted.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a single-parameter tool without an output schema, the description is minimally adequate. However, it could be improved by specifying the return format (e.g., list of index names vs. detailed metadata) or clarifying search pattern support given the 'multi-table' capability claim.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
With 100% schema coverage (single parameter 'text' described as 'table name to search'), the baseline is met. The description adds value by mentioning 'multi-table query' support, hinting that the text parameter may accept multiple table identifiers, though it does not specify the format (e.g., comma-separated).
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool searches for table indexes based on table names and explicitly mentions multi-table query support. However, it does not explicitly differentiate from siblings like 'get_table_desc' or 'execute_sql' which could potentially retrieve similar information.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance is provided on when to use this tool versus alternatives such as 'execute_sql' (which could query indexes directly) or 'get_table_desc' (which might also return index information). There are no prerequisites or exclusion criteria mentioned.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_table_lockB
获取当前mysql服务器行级锁、表级锁情况(Check if there are row-level locks or table-level locks in the current MySQL server )
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries full disclosure burden. While it implies a read-only diagnostic operation, it fails to mention performance impact (does it block?), real-time vs cached data, or what specific lock metadata is returned.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The bilingual format (Chinese with English parenthetical) is efficient and accessible without redundancy. Information is front-loaded with the action verb immediately followed by the target resource.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
While adequate for a zero-parameter tool, the description lacks output format details (e.g., whether it returns thread IDs, lock modes, or blocked queries). Without an output schema, this omission creates a gap in contextual completeness.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema contains zero parameters, establishing a baseline of 4. The description correctly implies no filtering arguments are needed (server-wide check), consistent with the empty schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool checks for row-level and table-level locks in the current MySQL server. The specific resource (locks) and scope (current server) are explicit, and the function is distinct from siblings like get_table_desc or optimize_sql.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance provided on when to use this tool versus alternatives like execute_sql (which could query information_schema directly). Missing prerequisites such as required privileges (e.g., PROCESS) or scenarios like deadlock investigation.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_table_nameA
根据表中文名或表描述搜索数据库中对应的表名(Search for table names in the database based on table comments and descriptions )
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | 要搜索的表中文名、表描述,仅支持单个查询 |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden. It discloses that the search targets 'comments and descriptions' rather than exact table names, indicating a fuzzy-search behavior. However, it omits critical behavioral details: return format (single name vs list), matching logic (substring vs exact), and pagination behavior.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The bilingual description is efficiently front-loaded with no wasted words. The Chinese-English pairing serves a broad audience without redundancy, and the single sentence structure places the action verb ('Search') and resource ('table names') immediately.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the absence of an output schema, the description should ideally disclose what the tool returns (e.g., 'returns matching table name(s)'). While the tool name suggests it returns a table name, ambiguity remains regarding single vs. multiple results. The input side is fully covered, but the output side leaves gaps for an agent trying to chain this with get_table_desc.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
With 100% schema coverage, the baseline is 3. The description adds valuable semantics: it clarifies that 'text' refers to Chinese table names or descriptions (not English table names), and includes the crucial constraint '仅支持单个查询' (only supports single query), which warns against batch inputs not obvious from the schema alone.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool searches for table names using Chinese names or descriptions as the search key. It distinguishes itself from siblings like execute_sql (general SQL), get_table_desc (likely requires exact table name), and get_table_index/lock (performance/metadata tools) by specifying its unique fuzzy-search capability based on comments/descriptions.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage context by specifying the search mechanism (Chinese names/descriptions), suggesting when to use it (when exact table names are unknown). However, it lacks explicit comparisons with siblings like get_table_desc or execute_sql, and doesn't state 'when not to use' or prerequisites.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
optimize_sqlA
专业的SQL性能优化工具,基于MySQL执行计划、表结构信息、表数据量、表索引提供专家级优化建议。该工具能够分析SQL语句的执行效率,识别性能瓶颈,并提供具体的优化方案,包括索引优化、查询重写建议等,帮助提升数据库查询性能。
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | 要优化的sql |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, description carries full burden. It discloses analytical methodology (execution plans, table structure analysis) and advisory nature ('provides suggestions'), but fails to explicitly state read-only safety, whether it executes the SQL to gather stats, or what output format to expect.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two-sentence structure is appropriately sized. Some redundancy between sentences (both mention optimization/suggestions), but the second sentence successfully elaborates on specific capabilities (index optimization, query rewriting).
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Adequate for a single-parameter tool but missing critical details given no output schema: no description of return value structure (textual advice vs. JSON), no explicit safety guarantees (read-only assertion), and no mention of whether it requires database connection permissions beyond the SQL text itself.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema has 100% coverage with '要优化的sql'. Description mentions MySQL specifically, implying the SQL should be MySQL-compatible, but adds minimal semantic detail about expected format, length limits, or whether multiple statements are accepted.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Description clearly states the tool optimizes SQL performance using MySQL execution plans and table metadata. It effectively distinguishes from sibling execute_sql (execution vs. analysis) and from metadata tools like get_table_index (retrieval vs. optimization advice).
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Description implies usage context (when you need SQL optimization advice) but lacks explicit when-to-use guidance or explicit contrast with alternatives. No mention of prerequisites like requiring valid MySQL SQL syntax or when to prefer execute_sql for testing.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
TDQS
Most tools have distinct purposes, such as execute_sql for SQL execution, get_table_desc for table structures, and optimize_sql for performance optimization. However, some tools like get_db_health_index_usage and get_db_health_running could be confused as both relate to health monitoring, though their specific focuses differ slightly.
Tool names follow a consistent verb_noun pattern (e.g., execute_sql, get_table_desc, optimize_sql) with clear actions and targets. There are minor deviations like get_chinese_initials, which uses a different verb style, but overall the naming is predictable and readable.
With 9 tools, the count is well-scoped for a MySQL server, covering core operations like SQL execution, table and index queries, health monitoring, and optimization. Each tool serves a specific function without unnecessary duplication, making the set efficient and focused.
The toolset provides good coverage for MySQL database management, including querying, health analysis, and optimization. Minor gaps exist, such as the lack of tools for database creation, user management, or backup operations, but core workflows like SQL execution and performance tuning are well-supported.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
MySQL change tracking with instant row-level recovery and forensic attribution for compliance.
Safe, read-only Postgres and MySQL access for AI agents. Audit log + column-level controls.
Connect to PlanetScale databases, branches, schema, query insights, and execute SQL
Multi-tenant database orchestration: isolated Postgres, MySQL, MongoDB, Redis tenants on demand.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables comprehensive MySQL database operations including cross-database queries, performance analysis, health monitoring, and AI-assisted database management with role-based access control.
- AlicenseBqualityDmaintenanceProvides comprehensive MySQL database operations including CRUD, performance optimization, health analysis, and anomaly detection. Supports multiple connection modes, OAuth2.0 authentication, and role-based permissions for database management through natural language.91MIT
- AlicenseNot gradedqualityDmaintenanceEnables natural language database operations on MySQL databases with AI integration, supporting CRUD operations, schema inspection, and audit logging with built-in security features including SQL injection protection and permission controls.454MIT
- AlicenseNot gradedqualityDmaintenanceEnables comprehensive MySQL database management including CRUD operations, schema queries, and natural language to SQL conversion support through complete database structure analysis.4542MIT
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/lyuhaochen/mysql_mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server