
askdba/mysql-mcp-server 是从 https://github.com/askdba/mysql-mcp-server. 导入的 MCP 服务器候选
概览
askdba/mysql-mcp-server 是从 https://github.com/askdba/mysql-mcp-server. 导入的 MCP 服务器候选
概述(AI 翻译)
一个快速、只读的 MySQL 服务器,用于模型上下文协议(MCP),用 Go 编写。
该项目通过MCP向Claude Desktop展示安全的MySQL内省工具。Claude可以探索数据库、描述模式并执行受控的只读SQL查询——非常适合安全的开发协助、调试、分析和模式文档。
特色
- 完全只读(屏蔽所有非SELECT/SHOW/DEDESCRIPTION/EXPLAIN)
- 多DSN支持:连接多个MySQL或MariaDB实例,通过工具切换
- MariaDB 支持:原生兼容 MariaDB 10.x、11.x 和 12.x
- 向量搜索(MySQL 9.0+):向量列的相似性搜索
- MCP工具:
- list_databases,list_tables,describe_table
- run_query(安全且排位有限)
- ping,server_info
- list_connections,use_connection(多DSN)
- vector_search,vector_info(MySQL 9.0+)
- 支持 MySQL 8.0、8.4、9.x、26.x 以及 MariaDB 10.x、11.x、12.x(在 MySQL 8.0、8.4、9.7、26.10 和 MariaDB 11.4、12.3 上进行了CI测试)
- 查询超时、结构化日志、审计日志;可选的实时令牌指标和HTTP模式下的**
/status**仪表盘
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
MySQL MCP Server
A fast, read-only MySQL Server for the Model Context Protocol (MCP) written in Go.
This project exposes safe MySQL introspection tools to Claude Desktop via MCP. Claude can explore databases, describe schemas, and execute controlled read-only SQL queries — ideal for secure development assistance, debugging, analytics, and schema documentation.
Features
- Fully read-only (blocks all non-SELECT/SHOW/DESCRIBE/EXPLAIN)
- Multi-DSN Support: Connect to multiple MySQL or MariaDB instances, switch via tool
- MariaDB Support: Native compatibility with MariaDB 10.x, 11.x and 12.x
- Vector Search (MySQL 9.0+): Similarity search on vector columns
- MCP tools:
- list_databases, list_tables, describe_table
- run_query (safe and row-limited)
- ping, server_info
- list_connections, use_connection (multi-DSN)
- vector_search, vector_info (MySQL 9.0+)
- Supports MySQL 8.0, 8.4, 9.x, 26.x and MariaDB 10.x, 11.x, 12.x (CI-tested on MySQL 8.0, 8.4, 9.7, 26.10 and MariaDB 11.4, 12.3)
- Query timeouts, structured logging, audit logs; optional live token metrics and
/statusdashboard in HTTP mode - Performance: configurable pool/query timeouts, server-side row caps,
explain_queryplan warnings - Single Go binary
- Unit and integration tests (Testcontainers)
- Native integration with Claude Desktop MCP
Installation
Homebrew (macOS/Linux)
brew install askdba/tap/mysql-mcp-server
Update local installation (after a new release):
brew update && brew upgrade mysql-mcp-server
Apple Silicon — “Cannot install under Rosetta 2 in ARM default prefix (/opt/homebrew)”
Your shell is running Homebrew under Rosetta (Intel) while /opt/homebrew is ARM. They must match. Use one of:
- Run upgrades as ARM:
arch -arm64 brew upgrade mysql-mcp-server(orarch -arm64 /opt/homebrew/bin/brew upgrade mysql-mcp-server). - Terminal.app → Get Info → uncheck Open using Rosetta, then open a new terminal.
- Put
/opt/homebrew/binfirst inPATHso you use the ARMbrewand binary.
Claude Desktop: on Apple Silicon, point command at /opt/homebrew/bin/mysql-mcp-server. /usr/local/opt/mysql-mcp-server/... is normally Intel Homebrew and can stay on an old version.
Docker
docker pull ghcr.io/askdba/mysql-mcp-server:latest
Note: Docker image tags use the raw version number without a leading “v” (e.g.,
1.5.0, notv1.5.0).
Download Binary
安装
docker run -i --rm -e MYSQL_DSN=root:password@tcp(host.docker.internal:3306)/mydb?parseTime=true -e MYSQL_MCP_EXTENDED=1 ghcr.io/askdba/mysql-mcp-server:latest配置
{
"mcpServers": {
"mysql": {
"command": "mysql-mcp-server",
"env": {
"MYSQL_DSN": "user:password@tcp(127.0.0.1:3306)/mydb?parseTime=true",
"MYSQL_MAX_ROWS": "200",
"MYSQL_MCP_EXTENDED": "1"
}
}
}
}