Skip to main content
Glama
lm203688

MySQL MCP Server

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
MYSQL_MCP_HOSTNoMySQL主机地址localhost
MYSQL_MCP_PORTNoMySQL端口3306
MYSQL_MCP_USERNoMySQL用户名root
MYSQL_MCP_DATABASENo默认数据库
MYSQL_MCP_MAX_ROWSNo查询结果最大行数100
MYSQL_MCP_PASSWORDNoMySQL密码
MYSQL_MCP_READ_ONLYNo只读模式true
MYSQL_MCP_QUERY_TIMEOUTNo查询超时(秒)30
MYSQL_MCP_BLOCKED_TABLESNo禁止访问的表列表
MYSQL_MCP_ALLOWED_DATABASESNo允许访问的数据库列表

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

CapabilityDetails
tools
{
  "listChanged": true
}
logging
{}
prompts
{
  "listChanged": false
}
resources
{
  "subscribe": false,
  "listChanged": false
}

Tools

Functions exposed to the LLM to take actions

NameDescription
list_databasesA

列出MySQL服务器上所有可访问的数据库

list_tablesA

列出指定数据库中的所有表

describe_tableA

获取表的详细结构信息,包括列定义、索引、建表语句

queryA

执行SQL查询(只读,仅支持SELECT/SHOW/DESCRIBE/EXPLAIN)

get_table_sampleA

获取表的样本数据(默认前5行),快速了解数据内容

get_table_statsA

获取表的统计信息,包括行数、数据大小、索引大小、列基数

explain_queryA

获取SQL查询的执行计划,用于分析查询性能

execute_writeA

执行写操作(INSERT/UPDATE/DELETE),需要关闭只读模式

⚠️ 此工具仅在只读模式关闭时可用(MYSQL_MCP_READ_ONLY=false)

Prompts

Interactive templates invoked by user choice

NameDescription
analyze_database生成数据库分析提示词,帮助AI全面了解数据库结构
optimize_query生成SQL优化提示词
compare_tables生成表对比提示词

Resources

Contextual data attached and managed by the client

NameDescription
get_databases_resource数据库列表资源

TDQS

A3.9/5.0

Scored across 8 tools

Disambiguation4/5

Most tools are clearly distinct in purpose, but `query` overlaps with several specialized tools since it can run SELECT/SHOW/DESCRIBE/EXPLAIN directly. The specialized tools have clear output formats and use cases, so an agent can usually pick correctly, but some boundary overlap exists.

Naming Consistency4/5

The naming pattern is mostly consistent with snake_case verb_noun names like `list_databases`, `describe_table`, and `explain_query`. The generic `query` tool breaks the pattern slightly, but the overall convention is predictable and readable.

Tool Count5/5

Eight tools is a well-scoped set for a MySQL MCP server. Each tool covers a meaningful area of database interaction—discovery, inspection, sampling, statistics, querying, performance analysis, and writes—without unnecessary redundancy or bloat.

Completeness4/5

The server provides solid coverage for read operations, schema inspection, query execution, performance analysis, and write operations. Missing DDL operations like creating or altering tables and databases are a minor gap, but for typical database exploration and data manipulation workflows the surface is largely complete.

Maintenance

ActivityInactive
ResponsivenessNo issues