@benborla29/mcp-server-mysql

中文文档
2.0.9发布于 2026/06/19MITES Module近 30 天下载 7.3万

MCP server for interacting with MySQL databases with write operations support

原始使用文档
文档目录9 节
  1. MCP Server for MySQL
  2. Sponsor — Bloome
  3. Key Features
  4. Requirements
  5. Quick Install
  6. Documentation
  7. Tools & Resources
  8. Contributing
  9. License

MCP Server for MySQL

Trust Score

Sponsor — Bloome

Bloome

Using mcp-server-mysql to let your AI query MySQL? Bloome brings that to your whole team — an AI-agent IM platform where AI agents are members of the chat. Connect your MCP tools and have agents inspect schemas, run queries, and answer data questions for everyone in one thread. Zero local setup, runs in the cloud, on web and mobile.


MCP server that gives Claude and other LLMs access to MySQL — inspect schemas, run queries, and optionally write data, all through the Model Context Protocol.

Key Features

  • Read-only by default — write operations opt-in via env flags
  • Claude Code integration — optimized for Anthropic's Claude Code CLI
  • SSH tunnel support — built-in support for remote databases
  • Multi-DB mode — query across multiple databases without reconnecting
  • Schema-specific permissions — per-database read/write control
  • PII redaction — automatic masking of sensitive data in results
  • Remote mode — HTTP transport with bearer token auth
  • SSL/TLS support — encrypted connections with mTLS option

Requirements

  • Node.js v20+
  • MySQL 5.7+ (8.0+ recommended)
  • MySQL user with appropriate privileges

Quick Install

Claude Code (simplest):

claude mcp add mcp_server_mysql \
  -e MYSQL_HOST="127.0.0.1" \
  -e MYSQL_PORT="3306" \
  -e MYSQL_USER="root" \
  -e MYSQL_PASS="your_password" \
  -e MYSQL_DB="your_database" \
  -- npx @benborla29/mcp-server-mysql

Claude Desktop / other clients:

{
  "mcpServers": {
    "mcp_server_mysql": {
      "command": "npx",
      "args": ["-y", "@benborla29/mcp-server-mysql"],
      "env": {
        "MYSQL_HOST": "127.0.0.1",
        "MYSQL_PORT": "3306",
        "MYSQL_USER": "root",
        "MYSQL_PASS": "your_password",
        "MYSQL_DB": "your_database"
      }
    }
  }
}

All write operations are disabled by default. Enable with ALLOW_INSERT_OPERATION=true, ALLOW_UPDATE_OPERATION=true, ALLOW_DELETE_OPERATION=true.

Documentation

Tools & Resources

Tool: mysql_query Execute SQL queries. Read-only by default. Write operations enabled per flag.

Resources: mysql://tables Lists all tables and column metadata for the connected database.

Contributing

PRs welcome at github.com/benborla/mcp-server-mysql.

git clone https://github.com/benborla/mcp-server-mysql.git
pnpm install
pnpm run build
pnpm test

Contributors

License

MIT — see LICENSE for details.

版本与发布记录

@benborla29/mcp-server-mysql 共发布 30 个版本,首次发布于 2024/12/10;过去 12 个月发布了 3 个版本。

版本发布日期距今
2.0.9latest2026/06/194 个月前
2.0.82026/01/279 个月前
2.0.72025/11/1811 个月前
2.0.52025/07/171.3 年前
2.0.32025/06/261.4 年前
2.0.22025/05/271.4 年前

关于 @benborla29/mcp-server-mysql 的常见问题

@benborla29/mcp-server-mysql 是什么?

MCP server for interacting with MySQL databases with write operations support

如何安装 @benborla29/mcp-server-mysql?

在项目目录运行 npm install @benborla29/mcp-server-mysql,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 mcp-server-mysql,可以用 npx mcp-server-mysql 直接运行。

@benborla29/mcp-server-mysql 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/benborla29__mcp-server-mysql 是否存在。

@benborla29/mcp-server-mysql 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@benborla29/mcp-server-mysql 可以商用吗?

@benborla29/mcp-server-mysql 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@benborla29/mcp-server-mysql 的下载量有多少?

根据 npm 官方下载统计,@benborla29/mcp-server-mysql 在 2026/10/08 – 2026/11/06 这 30 天内被下载 72,587 次,日均约 2,420 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@benborla29/mcp-server-mysql 还在维护吗?

最新版本 2.0.9 发布于 2026/06/19(4 个月前);至今共发布 30 个版本,其中过去 12 个月发布了 3 个;首次发布于 2024/12/10。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。