
MySQL Ops MCP
io.github.GT-dinuo由 GitHub 账号 GT-dinuo 发布v1.0.0更新于 Oct 24, 2026
MySQL MCP server: browse schema, query, CRUD. Delete/drop gated by user approval.
概览
本地 MCP 服务器,让 AI 助手浏览 MySQL 库表结构、执行 SELECT 查询和增删改操作,DELETE 与 DROP 需用户确认。
- 可以做什么
- 列出数据库和数据表,查看表的字段与类型
- 获取表的完整信息,包括索引、DDL 和统计信息
- 对任意数据库执行 SELECT 查询
- 创建表、插入和更新数据,每个工具只接受对应的 SQL 语句
- 删除数据或删除表,每次都需要客户端确认
- 通过通用 execute_sql 工具执行任意自定义 SQL
- 适用场景
- 适合在 Claude Code、Cursor、Codex 等桌面客户端中用自然语言探索和修改 MySQL 数据库,例如查看表结构、编写查询或做少量数据变更。
- 运行要求
- 通过 npx 以 stdio 在本地运行,需要 Node.js 18 或更高版本。需要可访问的 MySQL 服务器和凭据,通过环境变量 DB_HOST、DB_PORT、DB_USER、DB_PASSWORD、DB_DATABASE 提供;这些均为可选,默认 localhost、3306、root 且无默认数据库。
安装
在 SourceWeft 中
- 打开 控制台中的 MySQL Ops MCP,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
MySQL Ops MCP
English | 简体中文
[npm version] [License: MIT] [Node.js] [MCP] [GitHub stars]
A MySQL database MCP Server. Let AI tools like Claude Code / Cursor / Codex talk to your MySQL databases in natural language — browse databases and tables, inspect schemas, run queries, and perform CRUD operations, with destructive operations (DELETE / DROP) gated behind explicit user approval.
Features
- 🗄️ Schema browsing: list databases, list tables, describe table structure, full table info (indexes, DDL, stats)
- 🔍 Queries: run
SELECTqueries against any database - ✏️ CRUD: create tables, insert, update — with SQL-statement validation per tool
- 🔐 Approval-gated destructive ops:
delete_dataanddrop_tablealways require explicit user confirmation in the client - 🔌 Zero install: runs via
npx, configured entirely through environment variables
Installation
Requires Node.js 18+. No clone or build needed — npx fetches and runs the published npm package on first use (see the config below).
To build from source instead (e.g. for development):
Build output goes to dist/; the entry point is dist/index.js.
Configuration
In each project where you want to use this tool, create (or append to) .mcp.json:
If you built from source, point the command at the local build instead: "command": "node", "args": ["/absolute/path/to/mysql-ops-mcp/dist/index.js"].
Environment Variables
Usage
Once configured, just ask in natural language in your AI tool:
Destructive operations (delete_data, drop_table) are always confirmed by the MCP client before execution — nothing irreversible happens silently.
Tool List
Security
- Destructive operations require approval:
delete_dataanddrop_tableare gated by the MCP client's tool-call confirmation — approve or reject each one. - Statement validation: each write tool only accepts its own SQL verb (e.g.
queryrejects anything butSELECT). - Use a least-privilege account: don't connect as
rootin production — create a MySQL user scoped to the databases the AI may touch. - Never commit credentials:
.env/.mcp.jsonwith real passwords must stay out of version control (.gitignorealready covers.env).
Testing the Connection
After configuring .env (copy from env.example), you can verify connectivity before wiring up the client:
Development
License
MIT © 2026 mysql-ops-mcp
来源:README.md,提交 295b862
工具
0版本历史
1- v1.0.0最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分