Git-aware safe file ops for AI agents: delete anything except git-tracked source code.
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.
| Tool | Purpose |
|---|---|
safe_delete | Delete files/dirs; refuses git-tracked files or dirs containing them. Supports dry_run. |
check_protection | Report whether paths are protected and why. |
guard_status | Summarize a directory: tracked (protected) vs untracked (deletable) counts. |
Build the single static binary (no runtime dependencies):
go build -o agent-guard-mcp .
Or install directly:
go install github.com/kavachh/agent-guard-mcp@latest
claude mcp add agent-guard -- /path/to/agent-guard-mcp
In ~/.copilot/mcp-config.json:
{
"mcpServers": {
"agent-guard": { "command": "/path/to/agent-guard-mcp", "args": [] }
}
}
{ "command": "/path/to/agent-guard-mcp", "args": [] }
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.
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
git on PATH24-case edge suite (tracked/staged/ignored files, nested repos, symlinks, dry-run, …):
go build -o agent-guard-mcp . && npm test
This listing does not have a supported local package template. Use the maintainer’s documentation for its hosted endpoint, authentication, and client-specific setup. No install command has been inferred.
https://github.com/Kavachh/agent-guard-mcp/releases/download/v0.2.0/agent-guard-mcp_darwin_arm64otherio.github.Kavachh/agent-guard-mcp works with any MCP-compatible client. Copy the config snippet from the Configuration section above and add it to the file shown for your client, then restart the application.
~/Library/Application Support/Claude/claude_desktop_config.jsonRestart Claude Desktop completely for changes to take effect.~/.cursor/mcp.jsonRestart Cursor for changes to take effect..vscode/mcp.jsonReload VS Code window for changes to take effect.~/.codeium/windsurf/mcp_config.jsonRestart Windsurf for changes to take effect..mcp.jsonSave at the project root, then start Claude Code in that project and review the MCP server approval prompt. Keep real credentials out of shared files.