dbmole

io.github.ed-smartass由 GitHub 帳號 ed-smartass 發布v0.2.0更新於 Oct 26, 2026

PostgreSQL and MySQL with connections managed at runtime by the agent, SSH tunnels, readonly.

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

概覽

AI 產生的概覽

本機 MCP 伺服器,讓助理管理 PostgreSQL 與 MySQL 連線並執行 SQL,支援選用的 SSH 通道與唯讀旗標。

可以做什麼
  • 列出、新增、修改、移除並測試 PostgreSQL/MySQL 連線,連線可存於全域使用者存放區或專案內的 .dbmole.json
  • 每次呼叫執行單一 SQL 語句,使用位置參數,SELECT 回傳欄位與資料列,DML 回傳影響列數
  • 列出資料庫及其大小,列出資料表與檢視表及概略列數
  • 描述資料表或檢視表:欄位、主鍵、索引與外鍵
適用情境
適合在開發過程中讓助理檢視或查詢 PostgreSQL、MySQL 資料庫,依專案保存連線設定,或透過 SSH 通道連線而不必另裝用戶端。
執行需求
以本機 stdio 程序執行,透過 npm 套件 dbmole-mcp 安裝,需要 Node.js。資料庫認證透過連線工具寫入而非環境變數;可為每個連線設定 SSH 通道與選用的 SSL 設定(含 CA)。
安裝前請注意
助理可以新增、修改與刪除已儲存的連線定義(含認證資訊),位置在使用者存放區或專案檔案。execute_sql 可執行任意單一語句,若連線未開啟唯讀旗標,寫入與刪除都可能發生。連線可能經 SSH 通道並使用 SSL,分享前請檢查已儲存的密鑰與專案檔案。

安裝

在 SourceWeft 中

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

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

其他 MCP 客戶端

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

README

該儲存庫沒有 README。

工具

9

list_connections

List database connections with the layer each comes from: project (.dbmole.json, found by walking up from the project dir) or global (user store). Also shows invalid entries and broken files. Secrets are omitted.

無需輸入參數。

add_connection

Add a named postgres/mysql connection. scope "global" (default) saves it to the user store; "project" saves it to .dbmole.json in the project root. Supports an optional ssh tunnel and a readonly flag. Optional ssl: true or { rejectUnauthorized, ca } (ca = PEM or file path).

輸入參數sshsslhost必填name必填porttype必填user必填scopedatabasepasswordreadonlyqueryTimeoutMs

update_connection

Patch a connection by name in the layer it lives in (project or global). Set a field to null to remove it (e.g. "ssh": null); an ssh object is merged field by field, e.g. { "ssh": { "hostKey": "SHA256:..." } }. queryTimeoutMs sets the per-statement timeout (null restores the 60 s default). ssl is replaced as a whole, not merged like ssh.

輸入參數name必填patch必填

remove_connection

Remove a connection by name from the layer it lives in (invalid entries too) and drop its cached pools/tunnel.

輸入參數name必填

test_connection

Verify a connection works end to end (including ssh tunnel if configured). Reports server version and connect+query latency.

輸入參數name必填

execute_sql

Execute a single SQL statement on a named connection. SELECT returns columns/rows; DML returns rowCount (and lastInsertId for mysql). Use positional params: $1.. for postgres, ? for mysql.

輸入參數sql必填paramsdatabaserowLimitconnection必填

list_databases

List databases on a connection with size in bytes. Hides postgres template databases and mysql system schemas.

輸入參數connection必填

list_tables

List tables and views (type: table | view) with approximate row counts. For postgres, optionally filter by schema; for mysql, schema is the database.

輸入參數schemadatabaseconnection必填

describe_table

Describe a table or view: columns (type, nullable, default), primary key, indexes and foreign keys.

輸入參數table必填schemadatabaseconnection必填

版本歷史

1
  1. v0.2.0最新Oct 25, 2026

評分

已滿足適用檢查項的 65%

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

  • 近 30 天內可連通25 分
  • 已宣告認證方式10 分

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

  • 已列出工具必需15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分

    請宣告包含 README 的 GitHub 儲存庫,或在 OAuth 受保護資源後設資料中提供 resource_documentation。

  • 授權條款10 分

    請在儲存庫或註冊中心條目中宣告授權條款。