mysql2-mcp-server
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| MAX_ROWS | No | Maximum number of rows returned; result sets are truncated when exceeded. | 1000 |
| SSH_HOST | No | SSH server address. | |
| SSH_PORT | No | SSH server port. | 22 |
| READ_ONLY | No | Whether to enable read-only mode, which disables mysql_execute. | false |
| MYSQL_HOST | No | MySQL server address. | localhost |
| MYSQL_PORT | No | MySQL server port. | 3306 |
| MYSQL_USER | No | MySQL username. | root |
| SSH_ENABLED | No | Whether to enable the SSH tunnel. | false |
| SSH_PASSWORD | No | SSH password (alternative to SSH private key). | |
| SSH_USERNAME | No | SSH username. | |
| MYSQL_DATABASE | No | Default database (optional). | |
| MYSQL_PASSWORD | No | MySQL password. | |
| SSH_PASSPHRASE | No | SSH private key passphrase (optional). | |
| SSH_PRIVATE_KEY | No | SSH private key content (alternative to SSH password). | |
| SSH_REMOTE_HOST | No | Tunnel target MySQL host. | localhost |
| SSH_REMOTE_PORT | No | Tunnel target MySQL port. | 3306 |
| MYSQL_MCP_CONFIG_FILE | No | Path to the configuration file. | ~/.mysql-mcp/config.json |
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 | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| mysql_queryB | 执行 MySQL 查询,返回查询结果。可用环境: default(默认: default)。结果行数上限: default ≤ 1000 行,超出会被截断并在返回中标记 truncated;请用 WHERE/LIMIT 收窄范围或先执行 COUNT(*) 取总数 |
| mysql_executeB | 执行 MySQL 更新/删除/插入语句,返回受影响行数。可用环境: default(默认: default) |
| mysql_list_tablesB | 列出数据库中的所有表。可传 database 参数指定库;环境未配置默认库且未传参时返回数据库列表。可用环境: default(默认: default)。结果行数上限: default ≤ 1000 行,超出会被截断并在返回中标记 truncated;请用 WHERE/LIMIT 收窄范围或先执行 COUNT(*) 取总数 |
| mysql_describe_tableA | 查看指定表的结构(列名、类型、是否可空等)。可用环境: default(默认: default)。结果行数上限: default ≤ 1000 行,超出会被截断并在返回中标记 truncated;请用 WHERE/LIMIT 收窄范围或先执行 COUNT(*) 取总数 |
| mysql_beginA | 开始一个事务(仅直连模式支持)。可用环境: default(默认: default) |
| mysql_commitB | 提交当前事务。可用环境: default(默认: default) |
| mysql_rollbackC | 回滚当前事务。可用环境: default(默认: default) |
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 7 tools
Each tool has a clearly distinct role: transaction control (begin/commit/rollback), read queries via mysql_query, writes via mysql_execute, and schema inspection via list_tables/describe_table. The read/write split between query and execute is explicitly clarified in descriptions, leaving little room for misselection.
All tools follow a consistent mysql_ prefix with snake_case action-oriented names. The pattern is predictable across transaction, query, execution, and schema-introspection operations.
Seven tools is well-scoped for a MySQL server: transaction lifecycle, read/write execution, and schema discovery are all covered without redundant operations. No tool feels extraneous or missing at this level of granularity.
Core MySQL workflows are covered: querying, mutating data, transactions, and schema exploration. Minor gaps exist around explicit environment/connection management and convenience operations like EXPLAIN or database listing beyond the list_tables fallback, but these are largely workable through mysql_query/mysql_execute.