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.

已驗證STDIO僅桌面資料庫開發者工具

概覽

AI 產生的概覽

本機 MCP 伺服器,讓 AI 助理瀏覽 MySQL 資料庫與資料表結構、執行 SELECT 查詢與 CRUD,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 且無預設資料庫。
安裝前請注意
伺服器需要 MySQL 密碼(DB_PASSWORD),該密碼以明文寫在用戶端設定檔中,請勿提交到版本控制。具備寫入能力:create_table、insert、update、delete_data、drop_table 與 execute_sql 都會變更資料,其中 execute_sql 可執行任意 SQL,不受各工具語句類型檢查的限制。刪除與刪表的確認取決於用戶端是否執行工具呼叫確認。建議使用最小權限帳號而非 root。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 MySQL Ops MCP,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

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 SELECT queries against any database
  • ✏️ CRUD: create tables, insert, update — with SQL-statement validation per tool
  • 🔐 Approval-gated destructive ops: delete_data and drop_table always 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):

bash
git clone https://github.com/GT-dinuo/mysql-ops-mcp.gitcd mysql-ops-mcpnpm installnpm run build

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:

json
{  "mcpServers": {    "mysql": {      "command": "npx",      "args": ["-y", "mysql-ops-mcp"],      "env": {        "DB_HOST": "localhost",        "DB_PORT": "3306",        "DB_USER": "root",        "DB_PASSWORD": "your_password",        "DB_DATABASE": "your_database"      }    }  }}

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

VariableRequiredDescription
DB_HOSTNoMySQL host, default localhost
DB_PORTNoMySQL port, default 3306
DB_USERNoMySQL user, default root
DB_PASSWORDNoMySQL password
DB_DATABASENoDefault database; if omitted, pass database per tool call

Usage

Once configured, just ask in natural language in your AI tool:

List all databasesShow the structure of the users tableQuery the 10 most recent ordersGet full info for the users table — indexes and DDL includedInsert a test record into the users tableDelete the test record you just inserted   ← the client will ask for your approval first

Destructive operations (delete_data, drop_table) are always confirmed by the MCP client before execution — nothing irreversible happens silently.

Tool List

ToolDescription
list_databasesList all databases
list_tablesList tables in a database
describe_tableShow table columns and types
get_table_infoFull table details: columns, indexes, DDL, stats
queryRun a SELECT query
create_tableCreate a table (CREATE TABLE only)
insertInsert rows (INSERT only)
updateUpdate rows (UPDATE only)
delete_dataDelete rows — requires user approval
drop_tableDrop a table — requires user approval
execute_sqlRun any custom SQL statement

Security

  1. Destructive operations require approval: delete_data and drop_table are gated by the MCP client's tool-call confirmation — approve or reject each one.
  2. Statement validation: each write tool only accepts its own SQL verb (e.g. query rejects anything but SELECT).
  3. Use a least-privilege account: don't connect as root in production — create a MySQL user scoped to the databases the AI may touch.
  4. Never commit credentials: .env / .mcp.json with real passwords must stay out of version control (.gitignore already covers .env).

Testing the Connection

After configuring .env (copy from env.example), you can verify connectivity before wiring up the client:

bash
cp env.example .env   # fill in real credentialsnpm run test-connection

Development

bash
npm run dev    # watch mode, recompiles on changenpm run build  # build to dist/npm start      # run the built Server

License

MIT © 2026 mysql-ops-mcp

來源:README.md,提交 295b862

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v1.0.0最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分