
Agent Guard Mcp
io.github.Kavachh由 GitHub 账号 Kavachh 发布v0.2.0更新于 Oct 24, 2026
Git-aware safe file ops for AI agents: delete anything except git-tracked source code.
概览
一个本地 MCP 服务器,让助手删除文件和目录,但拒绝删除任何被 git 跟踪的内容。
- 可以做什么
- 提供具备 git 感知能力的文件删除工具:safe_delete 可删除文件或目录,但会阻止删除被 git 跟踪的文件或包含此类文件的目录,并支持 dry_run 模式。check_protection 报告指定路径是否受保护及原因,guard_status 汇总某个目录中被跟踪(受保护)与未跟踪(可删除)条目的数量。其策略是:只要未被 git 仓库跟踪,任何内容都可删除。
- 适用场景
- 适合希望让 AI 编程代理清理构建产物、临时文件和生成文件,同时避免误删版本控制下源代码的场景。也适用于授予代理较宽删除权限的工作流。
- 运行要求
- 以本地 stdio 进程运行,使用单个静态二进制文件;PATH 中需要有 git。从源码构建需要 Go 1.24 或更高版本,编译后的二进制文件没有运行时依赖。未声明任何账户、API 密钥或环境变量。
安装
在 SourceWeft 中
- 打开 控制台中的 Agent Guard Mcp,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
agent-guard-mcp
MCP server (written in Go, single static binary) for git-aware safe file operations. Give your AI agents (Claude Code, GitHub Copilot CLI, Cursor, …) free rein to delete what they build — while making it impossible for them to delete your git-tracked source code.
Policy: anything is deletable until it's tracked by a git repository.
Tools
Install
Build the single static binary (no runtime dependencies):
Or install directly:
Claude Code
GitHub Copilot CLI
In ~/.copilot/mcp-config.json:
Any MCP client (generic stdio config)
Recommended agent instructions
Add to your CLAUDE.md / AGENTS.md / .github/copilot-instructions.md:
Never use
rmin the shell. Always delete files with thesafe_deleteMCP tool, which protects git-tracked source code.
Since safe_delete can never destroy tracked source, it is safe to auto-approve this server's tools in your client's permission settings.
Example
Requirements
giton PATH- Go ≥ 1.24 (build only — the binary itself has zero dependencies)
Testing
24-case edge suite (tracked/staged/ignored files, nested repos, symlinks, dry-run, …):
来源:README.md,提交 f19ee77
工具
0版本历史
1- v0.2.0最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分