# agent-guard-mcp [Health: Active]

**Category:** 💻 Developer Tools  
**Repository:** https://github.com/Kavachh/agent-guard-mcp  
**GitHub Stars:** 0  
**Views:** 1  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/agent-guard-mcp

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

## Tools
Capabilities this server exposes over MCP:

- **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.

## Claude Desktop Quick Installation
No generated config for this server: it installs through its own setup steps.

The project's own setup steps (from https://github.com/Kavachh/agent-guard-mcp), copied verbatim. Follow them in order; they are not an mcpServers config.

1. Install:

```sh
go build -o agent-guard-mcp .
```

2. Install:

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

3. Add to Claude Code:

```sh
claude mcp add agent-guard -- /path/to/agent-guard-mcp
```

## Documentation

## What agent-guard-mcp MCP server does

The agent-guard-mcp MCP server exposes file-deletion safeguards based on Git tracking state. Its policy is simple: paths remain deletable until Git considers them tracked. A tracked file is protected, and a directory is protected when it contains tracked files.

This is intended for AI agents that create build output, scratch files, generated artifacts, or temporary directories during development. Agents can remove those untracked paths through MCP, while deliberate changes to tracked source still require an explicit Git operation such as `git rm`.

## How it works

The server inspects the target paths against the Git repository and applies the protection rule before deletion. `safe_delete` can receive files or directories. It removes untracked targets, but refuses tracked files and directories that contain tracked content. The tool also accepts a `dry_run` option so an agent can preview the result without performing the deletion.

`check_protection` answers whether supplied paths are protected and reports the reason. `guard_status` provides a directory-level summary with counts for tracked, protected content and untracked, deletable content.

The agent-guard-mcp MCP server is a single Go binary. Git must be available on `PATH`; the compiled binary has no runtime dependencies. The repository describes testing for tracked, staged, ignored, nested-repository, symlink, and dry-run cases.

## Setup and configuration

Build the binary with Go 1.24 or newer:

```bash
go build -o agent-guard-mcp .
```

Alternatively, install it with:

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

MCP clients use a generic stdio configuration with the binary path as the command and no required arguments. Claude Code can register it with `claude mcp add`; GitHub Copilot CLI uses its `mcp-config.json` file. Cursor and other MCP clients can use the same stdio command configuration.

The project recommends instructing agents not to use shell `rm` and to call `safe_delete` instead. Client permission settings can then be configured around the MCP tools, while intentional deletion of tracked source remains outside this server's permitted operation.

## Tools and capabilities

- `safe_delete`: Deletes untracked files or directories, blocks tracked files and directories containing tracked files, and supports dry-run checks.
- `check_protection`: Explains whether each requested path is protected.
- `guard_status`: Counts tracked and untracked content within a directory.

The agent-guard-mcp MCP server focuses on deletion safety rather than general file editing. It does not replace deliberate Git commands for removing tracked files.

## Limitations and notes

Protection depends on Git tracking state and therefore requires `git` on `PATH`. Building requires Go 1.24 or newer, although the resulting binary does not require Go at runtime. The documented interface is stdio-based, and the supplied setup examples do not specify environment variables or command-line arguments.

_Full upstream README: https://allmcps.com/mcp/agent-guard-mcp/readme_

