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.

已驗證STDIO僅桌面檔案與儲存開發者工具

概覽

AI 產生的概覽

一個本機 MCP 伺服器,讓助理刪除檔案與目錄,但拒絕刪除任何受 git 追蹤的內容。

可以做什麼
提供具備 git 感知能力的檔案刪除工具:safe_delete 可刪除檔案或目錄,但會阻擋受 git 追蹤的檔案或包含這類檔案的目錄,並支援 dry_run 模式。check_protection 會回報指定路徑是否受保護及原因,guard_status 則彙總某個目錄中受追蹤(受保護)與未追蹤(可刪除)項目的數量。其原則是:只要未被 git 儲存庫追蹤,任何內容都可刪除。
適用情境
適合想讓 AI 程式開發代理清理建置產物、暫存檔案與生成檔案,同時避免誤刪版本控制下原始碼的情境。也適用於授予代理較寬刪除權限的工作流程。
執行需求
以本機 stdio 程序執行,使用單一靜態二進位檔;PATH 中需要有 git。從原始碼建置需要 Go 1.24 或更新版本,編譯後的二進位檔沒有執行階段相依性。未宣告任何帳號、API 金鑰或環境變數。
安裝前請注意
此伺服器會在本機刪除檔案與目錄,刪除是真實的,且無法透過此工具復原。保護依賴 git 追蹤,因此未追蹤或被忽略的檔案(包括尚未提交的工作)可能被刪除。README 建議在用戶端權限設定中自動核准其工具,這會取消刪除前的確認步驟。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Agent Guard Mcp,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

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

ToolPurpose
safe_deleteDelete files/dirs; refuses git-tracked files or dirs containing them. Supports dry_run.
check_protectionReport whether paths are protected and why.
guard_statusSummarize a directory: tracked (protected) vs untracked (deletable) counts.

Install

Build the single static binary (no runtime dependencies):

bash
go build -o agent-guard-mcp .

Or install directly:

bash
go install github.com/kavachh/agent-guard-mcp@latest

Claude Code

bash
claude mcp add agent-guard -- /path/to/agent-guard-mcp

GitHub Copilot CLI

In ~/.copilot/mcp-config.json:

json
{  "mcpServers": {    "agent-guard": { "command": "/path/to/agent-guard-mcp", "args": [] }  }}

Any MCP client (generic stdio config)

json
{ "command": "/path/to/agent-guard-mcp", "args": [] }

Recommended agent instructions

Add to your CLAUDE.md / AGENTS.md / .github/copilot-instructions.md:

Never use rm in the shell. Always delete files with the safe_delete MCP 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

safe_delete { "paths": ["build/", "scratch.txt"] }→ deleted (untracked)
safe_delete { "paths": ["src/main/java/App.java"] }→ BLOCKED: git-tracked source file — use `git rm` deliberately if intended

Requirements

  • git on 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, …):

bash
go build -o agent-guard-mcp . && npm test

來源:README.md,提交 f19ee77

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v0.2.0最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分