dsh-guard-mcp
by feely0208
README.md
# @deepwhale-cn/dsh-guard-mcp
把深鲸守护(guard-core)的安全审计能力暴露为标准 MCP 工具 —— 供 Claude Desktop / Cursor / 任意 MCP 客户端调用。
## 客户端配置
```json
{ "mcpServers": { "dsh-guard": { "command": "npx", "args": ["-y", "@deepwhale-cn/dsh-guard-mcp"] } } }
```
## 工具(3 个)
| 工具 | 作用 |
|---|---|
| `guard_list_packs` | 列出本机可用 guard 规则包 |
| `guard_scan` | 用规则包扫描目录 → findings(ruleId / severity / file / line / advice) |
| `guard_report` | 同 scan,输出人类可读文本报告 |
## 规则包来源(自动发现)
1. npm 安装的带 `rules/*.json` 的 `@deepwhale-cn/dsh-*` 插件(本地链 + 全局 root)
2. `~/.dsh/guard-rules/*`
3. `DSH_GUARD_PACKS` 环境变量(冒号分隔目录)
4. 调用时 `pack` 参数直接给路径
扫描引擎:[@deepwhale-cn/dsh-guard-core](https://www.npmjs.com/package/@deepwhale-cn/dsh-guard-core)(自动安装)。
## 直连 CLI(调试用)
```bash
dsh-guard-mcp --packs # 看本机发现了哪些规则包
dsh-guard-mcp --tools # 看工具 schema
```
## 验证
`tests/probe.mjs` 真实 spawn stdio 服务走完整 MCP 生命周期:initialize → tools/list → guard_list_packs → guard_scan(真实规则报违规)→ guard_report → 未知方法 -32601,8/8 通过(2026-11-19)。
## License
MIT © 温州深鲸智能科技有限公司
## 安装(DSH)
```bash
dsh plugin --profile web add @deepwhale-cn/dsh-guard-mcp
```
也可以 `npm i @deepwhale-cn/dsh-guard-mcp`,或从本仓库直接 `dsh plugin install ./`。
This server cannot be deployed
Maintenance
ActivityMaintained
ResponsivenessNo recent community issues