Database Mcp Mysql

io.github.arifulislamat由 GitHub 帳號 arifulislamat 發布v0.5.0更新於 Oct 24, 2026

MCP server for MySQL. Read-only by default, row caps, statement timeouts, secrets never logged.

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

概覽

AI 產生的概覽

針對 MySQL 的本機 MCP 伺服器,為 AI 助理提供兩個受保護的工具來執行 SQL 與檢視資料表結構,預設為唯讀。

可以做什麼
透過 execute_sql 對已設定的 MySQL 資料庫執行 SQL 語句,預設啟用唯讀模式、資料列上限與語句逾時。透過 search_objects 探索結構:不帶參數呼叫可列出資料表,傳入資料表名稱可取得欄位、索引與外鍵。連線資訊在啟動時透過命令列參數、YAML 設定檔或環境變數設定,從不透過工具呼叫傳入。
適用情境
適合助理需要在桌面上查詢或探索 MySQL 資料庫的情境,例如回答資料問題或檢視資料表結構,且希望使用只有兩個工具、具備保守防護的輕量介面,而非廣泛的資料庫存取權限。
執行需求
以本機程序透過 stdio 執行;可透過 npm、PyPI(uvx)或 Rust 二進位檔安裝。需要 MYSQL_HOST、MYSQL_DATABASE 與 MYSQL_USER,以及 MYSQL_PASSWORD 或掛載的密碼檔案。需要能連線至 MySQL 主機的網路。僅限桌面端。
安裝前請注意
伺服器持有資料庫憑證(MYSQL_PASSWORD),建議使用唯讀資料庫使用者。唯讀模式、資料列上限與逾時皆為預設值,依賴前請確認設定。語句仍會送至資料庫,設定不當可能導致寫入或高負載查詢。

安裝

在 SourceWeft 中

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

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

database-mcp

[CI] [License: MIT] [npm] [PyPI] [crates.io] [Node >= 22]

MCP servers that give AI clients safe, structured access to SQL databases.

One installable package per database engine, in TypeScript (npm), Python (PyPI), and Rust (crates.io). Every package exposes the same minimal two-tool surface, execute_sql and search_objects, with guardrails on by default: read-only mode, row caps, and statement timeouts.

Packages

All three lines are published and pass the same language-agnostic conformance suite against real databases in CI, so behavior is identical regardless of language. Every engine is also listed on the MCP Registry with all three install options: npm, PyPI, and cargo.

Rust crates are named database-mcp-rs-<engine> because the plain names are taken on crates.io; the command each one installs is still database-mcp-<engine>. Go is planned.

Design principles

  • Two tools, no more. A tiny tool surface keeps the model's context window clean. search_objects progressively discloses schema: call it with no arguments to list tables, with a table name to get columns, indexes, and foreign keys.
  • Safe by default. Read-only mode is enforced in two layers: a conservative SQL guard, plus a session-level read-only setting in the database itself. Rows are capped (default 1000) and statements time out (default 30s).
  • Configured at launch, never via chat. Connection details come from flags, a YAML config file, or environment variables. Credentials are never accepted through a tool call.
  • Secrets never appear in logs. Passwords live in non-printable secret types, DSNs are sanitized before logging, and a redaction filter guards the log boundary.

Quick start

Pick your engine's package; each README has the full config surface. SQLite via npm:

json
{  "mcpServers": {    "sqlite": {      "command": "npx",      "args": ["-y", "@database-mcp/sqlite", "--dsn", "/absolute/path/to/database.db"]    }  }}

Or via PyPI: use "command": "uvx" and "args": ["database-mcp-sqlite", "--dsn", "/absolute/path/to/database.db"].

Or as a native binary, with no Node or Python runtime: run cargo install database-mcp-rs-sqlite, then use "command": "database-mcp-sqlite" with the same args minus the package name.

Flags, environment variables, and YAML config are identical across all three lines.

Networked engines take credentials from the environment (MYSQL_*, MARIADB_*, POSTGRES_*/DATABASE_URL, LIBSQL_URL/LIBSQL_AUTH_TOKEN), *_FILE mounted secrets, or a YAML file via --config. Never from a chat prompt.

Contributing

See CONTRIBUTING.md. The short version: the conformance suite is the definition of done. A change is mergeable only when conformance/run.mjs passes against every affected server.

License

MIT

來源:README.md,提交 775af94

工具

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

版本歷史

2
  1. v0.5.0最新Oct 17, 2026
  2. v0.4.2Sep 16, 2026

評分

已滿足適用檢查項的 50%

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

  • 近 30 天內可連通25 分

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

  • 已宣告認證方式10 分

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

  • 已列出工具15 分

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

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