mysql-diag-mcp
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| SSH_KEY | No | Path to private SSH key; if unset, uses ssh-agent or ~/.ssh/config. | |
| MCP_HOST | No | Bind address for network transports, e.g., 0.0.0.0. | |
| MCP_PORT | No | Port for network transports, default 8000. | 8000 |
| SSH_HOST | No | In ssh mode, the SSH target as 'user@host', or the bastion if MySQL is reached via a jump host. | |
| SSH_JUMP | No | Optional SSH jump host, e.g. 'user@bastion', used with `ssh -J`. | |
| MYSQL_HOST | No | MySQL hostname or IP; used when MYSQL_SOCKET is not set, or required in direct mode without a socket. | |
| MYSQL_PORT | No | MySQL port, default 3306. Used with MYSQL_HOST. | |
| MYSQL_USER | No | Dedicated MySQL diagnostic user (e.g., 'mcp_diag'). Required. | |
| MYSQL_SOCKET | No | Path to MySQL socket as seen from the DB host (preferred in ssh mode). Alternative to MYSQL_HOST/MYSQL_PORT. | |
| MYSQL_SSL_CA | No | Path to CA certificate for SSL verification. | |
| MCP_TRANSPORT | No | MCP transport: stdio (default), streamable-http (recommended), or sse. | stdio |
| MYSQL_SSL_KEY | No | Path to client key for SSL connections. | |
| MYSQL_MAX_ROWS | No | Maximum number of rows returned by diagnostic tools, default 200. | 200 |
| MYSQL_PASSWORD | No | MySQL password; optional if using socket peer-auth or .my.cnf. | |
| MYSQL_SSL_CERT | No | Path to client certificate for SSL connections. | |
| MYSQL_SSL_MODE | No | SSL mode for direct connections only: disabled (default), required, verify_ca, or verify_identity. | disabled |
| MCP_AUTH_TOKENS | No | Comma-separated 'token:label' pairs for bearer authentication. Required for non-stdio transports unless MCP_ALLOW_NO_AUTH=true. | |
| MYSQL_CONN_MODE | No | Connection mode: 'ssh' (default) or 'direct'. | ssh |
| MCP_ALLOWED_HOSTS | No | Comma-separated allowed hostnames for DNS-rebinding protection when binding to non-localhost. | |
| MCP_ALLOW_NO_AUTH | No | Set to 'true' to explicitly run network transports without token authentication. | |
| MYSQL_TIMEOUT_SEC | No | Timeout in seconds for MySQL operations, default 8. | 8 |
| MCP_ALLOWED_ORIGINS | No | Comma-separated allowed origins for browser-based clients when binding to non-localhost. |
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 |
|---|---|
| mysql_pingA | Check SSH + MySQL reachability; return version, hostname, and server time. |
| mysql_processlistA | SHOW FULL PROCESSLIST. Truncates Info. Use during a user-facing slowdown. |
| mysql_active_queriesA | Non-Sleep threads from information_schema.PROCESSLIST, longest first. |
| mysql_global_statusB | Curated SHOW GLOBAL STATUS keys (threads, tmp tables, InnoDB locks, QPS counters). |
| mysql_status_deltaC | Two GLOBAL STATUS samples; counters as per-second rates, gauges as t0/t1. |
| mysql_variablesA | Curated SHOW GLOBAL VARIABLES (buffer pool, connections, slow log, query cache if present). |
| mysql_innodb_statusA | Parsed SHOW ENGINE INNODB STATUS: history list, deadlocks, semaphores, buffer pool. |
| mysql_innodb_trxA | Open InnoDB transactions (age, thread, query). Long trx_age_sec pins locks/history. |
| mysql_lock_waitsB | Blocking chains: performance_schema.data_locks (8.0+) or innodb_locks (<8.0.18). Empty if nobody is waiting. |
| mysql_digest_topA | Top statement digests by wait time from performance_schema (no application table reads). |
| mysql_wait_eventsA | Top wait events. Often empty if wait instruments are disabled. |
| mysql_table_ioA | Hottest application tables by IO wait (excludes mysql/performance_schema/sys). |
| mysql_monitor_clientsA | Processlist grouped by user/host/command. Use to spot monitoring-agent connection storms. |
| mysql_replica_statusA | Replica lag, IO/SQL thread state, last IO/SQL error. SHOW REPLICA STATUS (8.0.22+) or SHOW SLAVE STATUS (older). Replication
channel metadata only, never binlog row contents. |
| mysql_replica_topologyA | Replicas connected to this server: SHOW REPLICAS (8.0.22+) or SHOW SLAVE HOSTS (older). |
| mysql_explainA | EXPLAIN a single SELECT or SHOW. Stacked queries and DML are rejected. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
| spike_runbook | Fixed order of diagnostic tools to call during a user-facing MySQL slowdown. |
TDQS
Scored across 16 tools
Most tools target clearly distinct diagnostic areas: connectivity, processlist, status, variables, InnoDB internals, replication, and explain. The only notable overlap is among mysql_processlist, mysql_active_queries, and mysql_monitor_clients, all of which read the processlist but with different filtering/grouping purposes.
All tools share the mysql_ prefix and use snake_case with descriptive resource names, making the set predictable. A minor deviation is that mysql_ping and mysql_explain use action-style names while the rest are noun-phrase resources, but this does not create real confusion.
16 tools is slightly above the typical 3-15 range, but the count is justified by the breadth of MySQL diagnostic concerns: processlist, status, InnoDB transactions, locks, wait events, table IO, and replication. Each tool covers a distinct diagnostic probe rather than duplicating existing functionality.
The toolkit provides strong coverage for diagnosing MySQL health, performance, locks, transactions, and replication with no obvious dead ends. Minor gaps exist, such as no ability to kill a query or inspect slow query logs, but these are operational actions rather than core diagnostic surface.