Available in
Marketplaces, most starred first
Tags
Add to README
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
By lzm04521v1.0.0MITIn 1 marketplace
Queries SQL Server, MySQL, Oracle and PostgreSQL from Claude Code through a local db-tools MCP service you install separately. Production environments are forced read-only; writes elsewhere need allowWrite set in config.
Trending plugins
7-day copy clicks
Claude loads one when your task matches it, or you run it by name.
Of the plugin's README
Chinese
1 marketplace, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
为支持 MCP(Model Context Protocol)的 Agent(Claude Code、Codex 等)提供安全数据库访问能力的本机工具服务。基于 .NET 8 + 官方 ModelContextProtocol SDK(无状态 Streamable HTTP),支持 SQL Server、MySQL、Oracle、PostgreSQL 四种数据库,内置 SQL 安全守卫、多项目多环境配置、审计日志与本机 Admin UI。
LIKE '%关键字%' 这类无法走索引的查询在执行前被拒,避免生产库全表扫描db_schema 一站式表清单/列/索引/外键/模糊搜索/列名反查,替代手写四方言 information_schema SQLMCP 客户端(Claude Code / Codex / …)
│ POST http://127.0.0.1:61123/mcp(无状态,服务重启不失效)
▼
MCP 工具层 db_list / db_query / db_schema / db_explain
│ 参数解析、limit/offset/dryRun/format
▼
SQL 安全守卫 SqlGuard:白名单 + 三层黑名单(只读/写池按环境二选一)
│ 生产环境后端兜底强制只读
▼
并发闸门 每 (project, environment) 独立限流,超限排队
▼
数据库 Provider SQL Server / MySQL / Oracle / PostgreSQL(连接池参数自动拼接)
│
▼
审计日志 Channel 异步串行落盘 SQLite(audit.db)
│
▼
返回 AI 友好结构(columns + TSV 分离、\N=NULL、状态行含行数/耗时/截断标记)
单进程同时承载:系统托盘 UI(WinForms)+ Admin Web(/admin)+ MCP HTTP(/mcp),仅监听 127.0.0.1。
dev / test / prod 等多环境,设置默认环境;项目级"需要 VPN"标记(连接失败提示分流,存量配置默认需要)allowWrite=true 时,允许 INSERT / UPDATE / DELETE / CREATE / ALTER / DROP INDEX / MERGE / REPLACE 等 DML/DDL,以及 COMMENT ON(补表/列注释)写操作,返回受影响行数;生产环境(isProduction=true)后端兜底强制只读,与 allowWrite 互斥(即便手改 config.json 也不生效)config.json 即时生效,无需重启(端口除外)(project, env) 独立并发闸门,避免高并发打满连接池db_query 可传 format="tsv"/"json"、db_list 可传 format="json" 回退结构化 JSONdb_query 支持 offset 分页(方言自动拼接、截断时状态行标 nextOffset 续翻)与 dryRun 预估(UPDATE/DELETE 变换 COUNT 只读查询返回 ~N affected (estimated),不执行写)db_schema 两级按需加载表清单/列/索引/外键(sample 可采样);table 含 % 模糊搜表名、column 按列名反查含该列的表db_explain 对只读语句返回执行计划(MySQL/PG EXPLAIN、SQL Server SHOWPLAN 不实际执行、Oracle DBMS_XPLAN)config.json,含测试连接、配置迁移、备份管理、审计查看、全局设置、系统设置与关于页一键更新Windows 用户(推荐):从 GitHub Releases 下载 McpDbTools-win-Setup-<版本号>.exe 双击安装(Velopack 安装包,self-contained,免装 .NET 运行时)。安装后常驻系统托盘,可在 Admin UI「系统设置」页开启开机自启。
源码构建 / 非 Windows:
git clone https://github.com/lzm04521/MCP-DB-Tools.git
cd MCP-DB-Tools
dotnet build
dotnet run --project src/McpDbTools.Server
编辑 src/McpDbTools.Server/config.json(安装版在 %ProgramData%\McpDbTools\config.json,建议直接用 Admin UI 维护),在 databases 下添加项目与环境:
{
"databases": {
"my-project": {
"displayName": "示例项目",
"defaultEnvironment": "test",
// 数据库是否需要 VPN 才能访问(仅影响连接失败提示文案;缺省视为 true)
"requiresVpn": true,
"environments": {
"test": {
"displayName": "测试环境",
"isProduction": false,
"type": "sqlserver",
"connectionString": "Server=.;Database=MyDb;Trusted_Connection=true;TrustServerCertificate=true;",
"maxRows": 1000,
"commandTimeout": 120,
// 非生产环境可开启写操作(生产环境即便设 true 也会被后端兜底强制只读)
"allowWrite": true,
"disabledKeywords": []
},
"prod": {
"displayName": "生产环境",
"isProduction": true,
"type": "sqlserver",
"connectionString": "Server=prod;Database=MyDb;User Id=readonly;Password=***;TrustServerCertificate=true;",
"maxRows": 500,
"commandTimeout": 120,
"blockFuzzyMatch": true, // 禁止全模糊匹配(默认 false)
"disabledKeywords": []
}
}
}
}
}
Built from public signals: copy clicks on this site, GitHub stars and activity, the README and the manifest. Not a security audit or an endorsement.
npx claudepluginhub lzm04521/mcp-db-tools --plugin db-toolsPlugins from other owners that cover similar ground