mcpField
A
agent-guard-mcp

agent-guard-mcp

Local
github.com/KavachhDeveloper Tools0Updated 14w ago

About agent-guard-mcp

agent-guard-mcp is a Go MCP server that protects Git-tracked files during AI agent file cleanup. Untracked files can be deleted, while tracked files and directories containing them are blocked.

Key features

  1. 01Delete untracked files and directories
  2. 02Protect Git-tracked content
  3. 03Check why paths are protected
  4. 04Count tracked and untracked items
  5. 05Preview deletions with dry-run

Use cases

  1. 01Clean up build outputs and temporary files
  2. 02Inspect protected files in a directory
  3. 03Let AI agents clean workspaces safely

MCP support

It exposes the safe_delete, check_protection, and guard_status tools to MCP clients. safe_delete blocks deletion of Git-tracked files and directories containing them.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

No install method listed yet

We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.

Repository
Packages
mcpbagent-guard-mcp_darwin_arm640.2.0

Tools

No tool list yet

Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.

Details

From the project 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):

go build -o agent-guard-mcp .

Or install directly:

go install github.com/kavachh/agent-guard-mcp@latest
Claude Code
claude mcp add agent-guard -- /path/to/agent-guard-mcp
GitHub Copilot CLI

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

{
  "mcpServers": {
    "agent-guard": { "command": "/path/to/agent-guard-mcp", "args": [] }
  }
}
Any MCP client (generic stdio config)
{ "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, …):

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

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.