safe-agent-mcp
by YYDW-1211
README.md
# safe-agent-mcp
基于 [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) 的安全多 Agent MCP 网关:把 DSH 的 agent 执行能力封装成标准 [MCP](https://modelcontextprotocol.io) 工具,让任何 MCP 客户端(Claude Desktop、Cursor 等)都能调用。
## 这个项目解决什么
- **DSH** 是多 Agent 框架,但能力只能在自己的界面里用;
- **MCP** 是标准协议,任何客户端都能接,但本身没有 agent 能力;
- **safe-agent-mcp** 是两者的桥:一个 MCP 服务器,对外提供标准工具,对内驱动 DSH 的 agent(含子 Agent、沙箱)。
## 特性
| 关键词 | 实现 |
|---|---|
| MCP | 标准 MCP 服务器(`@modelcontextprotocol/sdk`),任何 MCP 客户端即插即用 |
| 多 Agent | (规划中 v1.1)通过 `dsh --profile headless` 驱动 DSH 子 Agent 执行任务 |
| 沙箱/安全 | (规划中 v1.2)危险命令拦截、密钥脱敏、审计日志、超时与并发限制 |
## 快速开始
```bash
npm install
npm run smoke # 自动化冒烟测试(协议握手 + 工具调用)
npm run inspect # 打开 MCP Inspector 可视化调试
```
当前已实现工具:
- `run_command`:在沙箱中执行一条 shell 命令,返回 stdout / stderr / 退出码(Windows 下已处理 cmd 的 GBK 编码问题)。
## 目录结构
```
src/index.ts # MCP 服务器入口
tests/smoke.mjs # 冒烟测试
docs/DEVELOPMENT.md # 开发文档(架构、里程碑、开发日志)
```
## 里程碑
- [x] v1.0:MCP 服务器 + `run_command` 工具(冒烟测试全绿)
- [ ] v1.1:`run_agent_task` 多 Agent 接入(headless 桥接)
- [ ] v1.2:安全壳(危险命令拦截 + 密钥脱敏 + 审计日志)
- [ ] v1.3:Web 仪表盘(加分项)
详见 [docs/DEVELOPMENT.md](docs/DEVELOPMENT.md)。
## License
[MIT](LICENSE)
TDQS
A4.4/5.0
Scored across 1 tool
Disambiguation5/5
With only one tool, there is no possibility of confusion between tools. The name 'run_command' clearly describes its function, eliminating any ambiguity.
Naming Consistency5/5
The single tool follows a consistent verb_noun pattern ('run_command'). There are no other tools to create inconsistency, so the naming is perfectly consistent.
Tool Count3/5
The server has only one tool, which feels thin for a typical tool set. While it may cover the core purpose of safe command execution, the surface is minimal and could benefit from additional related tools.
Completeness5/5
The server's stated purpose is to execute shell commands in a sandbox, and 'run_command' fully covers this operation by returning stdout, stderr, and exit code. No obvious gaps exist for the intended scope.
Maintenance
ActivityMaintained
ResponsivenessNo issues