Back to Browse

Agent Guard MCP Server

Developer ToolsModerate7.2MCP RegistryLocal
Free

Server data from the Official MCP Registry

Git-aware safe file ops for AI agents: delete anything except git-tracked source code.

About

Git-aware safe file ops for AI agents: delete anything except git-tracked source code.

Security Report

7.2
Moderate7.2Low Risk

This is a well-designed Go-based MCP server for safe file deletion that respects git-tracked files. The architecture is sound with clear separation of concerns, appropriate permission scoping, and comprehensive test coverage. No authentication is required (appropriate for a local tool), and no dangerous patterns detected. Minor code quality observations exist around error handling and logging, but these are not security issues. Supply chain analysis found 1 known vulnerability in dependencies (0 critical, 1 high severity).

3 files analyzed · 6 issues found

Security scores are indicators to help you make informed decisions, not guarantees. Always review permissions before connecting any MCP server.

Permissions Required

This plugin requests these system permissions. Most are normal for its category.

File System Read

Reads files on your machine. Normal for tools that analyze or process local data.

File System Write

Writes or modifies files on your machine. Check that this is expected for the tool.

Shell Command Execution

Runs commands on your machine. Be cautious — only use if you trust this plugin.

env_vars

Check that this permission is expected for this type of plugin.

How to Install

Add this to your MCP configuration file:

{
  "mcpServers": {
    "io-github-kavachh-agent-guard-mcp": {
      "args": [
        "-y",
        "agent-guard-mcp-tests"
      ],
      "command": "npx"
    }
  }
}

Documentation

View on GitHub

From the project's GitHub 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

Reviews

No reviews yet

Be the first to review this server!