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 分

    请在仓库或注册中心条目中声明许可证。