经 AI Skill Hub 精选评估,mysql_mcp_server — Claude MCP 必备工具中文教程 获评「强烈推荐」。已获得 1.3k 颗 GitHub Star,这款MCP工具在功能完整性、社区活跃度和易用性方面表现出色,AI 评分 8.2 分,适合有一定技术背景的用户使用。
基于模型上下文协议的MySQL数据库安全交互工具。为AI助手提供数据库访问能力,支持安全的SQL查询执行和数据操作。适合需要集成数据库功能的AI应用开发者和企业用户。
mysql_mcp_server — Claude MCP 必备工具中文教程 是一款遵循 MCP(Model Context Protocol)标准协议的 AI 工具扩展。通过 MCP 协议,它可以让 Claude、Cursor 等主流 AI 客户端直接访问和操作外部工具、数据源和服务,实现 AI 能力的无缝扩展。无论是文件操作、数据库查询还是 API 调用,都可以通过自然语言在 AI 对话中直接触发,极大提升生产效率。
基于模型上下文协议的MySQL数据库安全交互工具。为AI助手提供数据库访问能力,支持安全的SQL查询执行和数据操作。适合需要集成数据库功能的AI应用开发者和企业用户。
mysql_mcp_server — Claude MCP 必备工具中文教程 是一款遵循 MCP(Model Context Protocol)标准协议的 AI 工具扩展。通过 MCP 协议,它可以让 Claude、Cursor 等主流 AI 客户端直接访问和操作外部工具、数据源和服务,实现 AI 能力的无缝扩展。无论是文件操作、数据库查询还是 API 调用,都可以通过自然语言在 AI 对话中直接触发,极大提升生产效率。
# 方式一:通过 Claude Code CLI 一键安装
claude skill install https://github.com/designcomputer/mysql_mcp_server
# 方式二:手动配置 claude_desktop_config.json
{
"mcpServers": {
"mysql-mcp-server---claude-mcp---------": {
"command": "npx",
"args": ["-y", "mysql_mcp_server"]
}
}
}
# 配置文件位置
# macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
# Windows: %APPDATA%/Claude/claude_desktop_config.json
# 安装后在 Claude 对话中直接使用 # 示例: 用户: 请帮我用 mysql_mcp_server — Claude MCP 必备工具中文教程 执行以下任务... Claude: [自动调用 mysql_mcp_server — Claude MCP 必备工具中文教程 MCP 工具处理请求] # 查看可用工具列表 # 在 Claude 中输入:"列出所有可用的 MCP 工具"
// claude_desktop_config.json 配置示例
{
"mcpServers": {
"mysql_mcp_server___claude_mcp_________": {
"command": "npx",
"args": ["-y", "mysql_mcp_server"],
"env": {
// "API_KEY": "your-api-key-here"
}
}
}
}
// 保存后重启 Claude Desktop 生效
MYSQL_DATABASE)MCP_TRANSPORT=sse)pip install -r requirements.txt
pip install -r requirements-dev.txt
pip install mysql-mcp-server
To install MySQL MCP Server for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install designcomputer/mysql-mcp-server --client claude
claude mcp add --transport stdio designcomputer-mysql_mcp_server uvx mysql_mcp_server
cp .env.example .env
Fetches a representative sample of data. - Arguments: table_name (string), limit (optional integer, max 20) - Use Case: Quickly understand data formats and content without fetching large result sets. - Cross-database: Pass database.table to sample a table outside MYSQL_DATABASE; bare names use the configured database. - Identifier rules: Names must contain only alphanumeric characters, underscores, and $ (dots are allowed as a separator between database and table names).
Set the following environment variables: ```bash MYSQL_HOST=localhost # Database host MYSQL_PORT=3306 # Optional: Database port (defaults to 3306 if not specified) MYSQL_USER=your_username MYSQL_PASSWORD=your_password MYSQL_DATABASE=your_database # Optional: Omit for multi-database mode
MYSQL_SSL_MODE=DISABLED # DISABLED, REQUIRED, VERIFY_CA, VERIFY_IDENTITY MYSQL_CONNECT_TIMEOUT=10 # Timeout in seconds
MYSQL_SQL_MODE=TRADITIONAL # SQL mode applied to the connection (default: TRADITIONAL)
MYSQL_CHARSET=utf8mb4 MYSQL_COLLATION=utf8mb4_unicode_ci MYSQL_AUTH_PLUGIN= # e.g., mysql_native_password for older MySQL versions MYSQL_USE_PURE=false # Force the pure-Python connector (default: false) MYSQL_RAISE_ON_WARNINGS=false # Raise on SQL warnings (default: false)
MCP_TRANSPORT=stdio # stdio or sse MCP_SSE_HOST=0.0.0.0 # Listen on all interfaces (required for Docker/hosting) PORT=8000 # HTTP port (fallback for MCP_SSE_PORT) MCP_SSE_ALLOWED_HOSTS= # Comma-separated allowed Host headers (default: localhost:{port},127.0.0.1:{port})
MYSQL_SSH_ENABLE=false # Set to true to enable MYSQL_SSH_HOST= # SSH jump host MYSQL_SSH_PORT=22 # SSH port MYSQL_SSH_USER= # SSH username MYSQL_SSH_KEY_PATH= # Path to SSH private key MYSQL_SSH_REMOTE_HOST=localhost # Host from the perspective of the jump host MYSQL_SSH_REMOTE_PORT=3306 MYSQL_LOCAL_PORT=3330 ```
On startup the server automatically loads a .env file via python-dotenv, so for local use you can simply:
cp .env.example .env # then edit with your credentials
The file is read from the process working directory (and parent directories), which works when you run the server yourself from the project folder.
⚠️ Claude Code / Claude Desktop: these hosts launch the server from their own working directory, so the project's.envwill not be found and you'll seeMissing required database configuration. Put yourMYSQL_*values in theenvblock of the MCP config (shown in the Usage section below) rather than relying on.env.
python -m venv venv source venv/bin/activate # or venv\Scripts\activate on Windows
高质量的MCP实现,填补了AI与数据库交互的关键空白。代码成熟度高,安全考虑周全,是企业级AI应用的优选方案。
AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。
建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。
✅ MIT 协议 — 最宽松的开源协议之一,可自由商用、修改、分发,仅需保留版权声明。
AI Skill Hub 点评:mysql_mcp_server — Claude MCP 必备工具中文教程 的核心功能完整,质量优秀。对于Claude Desktop / Claude Code 用户来说,这是一个值得纳入个人工具库的选择。建议先在非生产环境试用,再逐步推广。
| 原始名称 | mysql_mcp_server |
| 原始描述 | A Model Context Protocol (MCP) server that enables secure interaction with MySQL databases |
| Topics | 数据库MySQLMCP协议AI集成安全交互 |
| GitHub | https://github.com/designcomputer/mysql_mcp_server |
| License | MIT |
| 语言 | Python |
收录时间:2026-05-22 · 更新时间:2026-05-30 · License:MIT · AI Skill Hub 不对第三方内容的准确性作法律背书。
选择 Agent 类型,复制安装指令后粘贴到对应客户端