MCP-MySQL-Ops
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| MYSQL_HOST | Yes | MySQL server hostname or IP address. Required by the MCPB installer; the server default is localhost. | |
| MYSQL_PORT | No | MySQL server port number. | 3306 |
| MYSQL_USER | No | MySQL connection username. | root |
| PYTHONPATH | No | Python module search path for MCP server imports, used for local module execution. | |
| FASTMCP_HOST | No | HTTP server bind address for streamable-http transport. | 127.0.0.1 |
| FASTMCP_PORT | No | HTTP server port for MCP communication. | 8000 |
| FASTMCP_TYPE | No | MCP transport protocol: stdio or streamable-http. | stdio |
| MCP_LOG_LEVEL | No | Server logging verbosity: DEBUG, INFO, WARNING, or ERROR. | INFO |
| MYSQL_DATABASE | No | Default target MySQL database when no specific database is specified. | mysql |
| MYSQL_PASSWORD | Yes | MySQL user password. Required by the MCPB installer; may be empty in some deployments. | |
| REMOTE_SECRET_KEY | No | Secret key for Bearer token authentication. Required when REMOTE_AUTH_ENABLE is true. | |
| REMOTE_AUTH_ENABLE | No | Enable Bearer token authentication for streamable-http mode. Accepts true/false, 1/0, yes/no, on/off. | false |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
MCP-MySQL-Ops inspects one MySQL server (5.7.9+ or 8.0+) through read-only SQL queries: server status and configuration, connections and sessions, users and privileges, databases, schemas, table and index sizes, slow queries, table I/O, and locks.
Scope and access
Every tool call runs a real query against the configured MySQL server with the configured MySQL user. Use the tools for facts; never guess, simulate, or invent results.
The server is read-only. It cannot change data, schemas, users, settings, or sessions. If the user asks for a change, say this server cannot do it; you may suggest the SQL for the user to review and run.
database_name selects the database for a call. When omitted, a tool uses the connection's default database or, for some tools, all databases. State which scope the answer covers.
Results depend on the MySQL user's privileges. Missing rows or access errors can mean missing privileges, not missing objects; say so.
Reporting results
Report what the tool returned. Never claim success or draw conclusions after an error, an empty result, or a partial result; quote the error.
Performance Schema tools (slow queries, table I/O, locks) need performance_schema=ON. If a tool says it is disabled or unavailable, report that; do not substitute guesses.
Never ask for the MySQL password in chat; connection settings come from the server environment, and connection info hides the password.
Missing input
If a required value is missing or ambiguous (for example, which table, or which of several databases), ask instead of picking one.
Numbers
Table rows and data/index sizes come from information_schema and are estimates for InnoDB, not exact counts or on-disk file sizes.
Performance Schema counters (statement digests, table I/O, wait times) are cumulative since server start or the last reset, not current rates. Status counters in get_server_status are also cumulative unless they are gauges such as Threads_connected.
Label each number as estimated, cumulative, current, or configured. Never present a configured limit as measured usage. If a value is not collected, say "not collected"; never estimate it.
Large results
Size, index, slow-query, and I/O tools return the top N rows (limit, default 20). Say when a result may be truncated, and raise limit or narrow by database_name only when the user needs more.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": true
} |
| logging | {} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
| extensions | {
"io.modelcontextprotocol/ui": {}
} |
| experimental | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| get_server_infoA | [Tool Purpose]: Get MySQL server version and basic information [Exact Functionality]:
[Required Use Cases]:
|
| get_active_connectionsA | [Tool Purpose]: Monitor active MySQL connections and processes [Exact Functionality]:
[Required Use Cases]:
|
| get_database_listA | [Tool Purpose]: List all databases in MySQL server [Exact Functionality]:
[Required Use Cases]:
|
| get_table_listA | [Tool Purpose]: List all tables in specified database or all databases [Exact Functionality]:
[Required Use Cases]:
|
| get_table_schema_infoA | [Tool Purpose]: Get detailed schema information for a specific table or entire database [Exact Functionality]:
[Required Use Cases]:
|
| get_mysql_configA | [Tool Purpose]: Get MySQL server configuration variables [Exact Functionality]:
[Required Use Cases]:
|
| get_user_listA | [Tool Purpose]: List all MySQL users and their privileges [Exact Functionality]:
[Required Use Cases]:
|
| get_server_statusA | [Tool Purpose]: Get MySQL server status variables and performance counters [Exact Functionality]:
[Required Use Cases]:
|
| get_table_size_infoA | [Tool Purpose]: Get table size information and storage analysis [Exact Functionality]:
[Required Use Cases]:
|
| get_database_size_infoA | [Tool Purpose]: Get database size information and storage distribution [Exact Functionality]:
[Required Use Cases]:
|
| get_index_usage_statsA | [Tool Purpose]: Get index usage statistics and efficiency analysis [Exact Functionality]:
[Required Use Cases]:
|
| get_connection_infoA | [Tool Purpose]: Get current connection and process information [Exact Functionality]:
[Required Use Cases]:
|
| get_slow_queriesA | [Tool Purpose]: Get slow queries from Performance Schema [Exact Functionality]:
[Required Use Cases]:
|
| get_table_io_statsA | [Tool Purpose]: Get table I/O statistics from Performance Schema [Exact Functionality]:
[Required Use Cases]:
|
| get_lock_monitoringA | [Tool Purpose]: Monitor current locks in MySQL [Exact Functionality]:
[Required Use Cases]:
|
| get_current_database_infoA | [Tool Purpose]: Get information about the currently connected or specified database [Exact Functionality]:
[Required Use Cases]:
|
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 16 tools
Most tools have distinct monitoring purposes, but get_active_connections and get_connection_info are nearly identical in scope, and get_table_list/get_table_schema_info plus get_database_list/get_current_database_info overlap at their boundaries. The descriptions help somewhat, but the duplicate connection tooling creates real selection ambiguity.
All 16 tools consistently use the get_ prefix followed by a descriptive noun phrase. There are no mixed naming conventions or vague verbs.
Sixteen tools is slightly above the ideal 3-15 range, but the breadth of MySQL monitoring areas justifies most of them. The set is broad without feeling excessive.
The read-only diagnostic surface covers server info, connections, databases, tables, schemas, users, sizes, indexes, slow queries, I/O, and locks comprehensively. Gaps remain around replication status and operational actions such as killing queries or executing SQL, but core monitoring workflows are well covered.