agent-guard-mcp
Allows AI agents using GitHub Copilot to safely delete untracked files while protecting git-tracked source code.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@agent-guard-mcpsafely delete the 'dist' folder and all its contents"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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
Tool | Purpose |
| Delete files/dirs; refuses git-tracked files or dirs containing them. Supports |
| Report whether paths are protected and why. |
| Summarize a directory: tracked (protected) vs untracked (deletable) counts. |
Related MCP server: File Operations MCP Server
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@latestClaude Code
claude mcp add agent-guard -- /path/to/agent-guard-mcpGitHub 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
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.
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 intendedRequirements
giton PATHGo ≥ 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 testThis server cannot be deployed
Maintenance
Related MCP Connectors
Securely search and manage workspace context files for AI agents and teams.
Git-backed platform for skills, tools, and context for AI agents
Read and write KukGit repositories, files, issues and pull requests from an AI assistant.
Plain-English git for agents: 22 tools to branch, commit, push and tag. Free tier.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceProvides secure file system operations for AI assistants including directory listing, file reading/writing, deletion, searching, and copying. Features safety controls like path validation, permission checks, and file size limits.-
- FlicenseNot gradedqualityDmaintenanceEnables AI assistants to safely interact with the file system through a set of tools for reading, writing, deleting, copying, moving files, and managing directories.-
- AlicenseNot gradedqualityAmaintenanceProvides AI clients with safe, structured access to local filesystem, Git repositories, and project contexts, featuring file operations, git status/diff, project management, and built-in code review/bug analysis prompts.3,446 npmMIT
- AlicenseNot gradedqualityBmaintenanceEnables ChatGPT or any MCP client to operate safely on a designated workspace by listing, reading, searching, writing, and trashing files, inspecting Git status/log/diff, and optionally running allowlisted executables without a shell.Apache 2.0