
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 分