agent-guard-mcp
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-mcpCheck if my agent is stuck in a loop"
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 that detects and prevents infinite agent loops — the #1 reliability problem in agentic systems.
Provides circuit breakers, pattern detection, stuck-agent analysis, and recovery recommendations via the Model Context Protocol.
Install
npx agent-guard-mcpClaude Desktop
Add to claude_desktop_config.json:
{
"mcpServers": {
"agent-guard": {
"command": "npx",
"args": ["agent-guard-mcp"]
}
}
}From source
git clone https://github.com/mdfifty50-boop/agent-guard-mcp.git
cd agent-guard-mcp
npm install
node src/index.jsRelated MCP server: Unloop MCP
Tools
register_agent
Register an agent for monitoring.
Param | Type | Default | Description |
| string | required | Unique agent identifier |
| number | 100 | Max iterations before forced stop |
| number | 0.3 | Min unique/total action ratio to be "making progress" |
log_action
Log an agent action for loop detection. Maintains a rolling window of the last 50 actions.
Param | Type | Default | Description |
| string | required | Agent identifier |
| string | required | Tool being called |
| object | required | Arguments passed |
| string |
| Brief result preview (max 200 chars) |
Returns early warnings when repeated patterns are detected.
detect_loop
Check if an agent is stuck in an infinite loop.
Param | Type | Description |
| string | Agent to check |
Returns:
is_stuck— booleanconfidence— 0.0 to 1.0pattern—healthy,exact_repeat,low_diversity, orexact_repeat_and_low_diversitysuggestion— human-readable recovery advicerepeated_actions— list of repeated signatures with counts
set_circuit_breaker
Configure automatic intervention when action patterns repeat.
Param | Type | Default | Description |
| string | required | Agent identifier |
| number | 3 | Trigger after N identical actions |
| string |
|
|
check_circuit_breaker
Pre-flight check before executing a tool. Call this BEFORE the actual tool call.
Param | Type | Description |
| string | Agent identifier |
| string | Tool about to be called |
| object | Arguments about to be passed |
Returns proceed: false when the circuit breaker fires (block mode only).
get_stuck_report
Detailed analysis of why an agent is stuck.
Param | Type | Description |
| string | Agent to analyze |
Returns: action history, pattern analysis, token waste estimate, diversity ratio, top repeated patterns, and recovery recommendations.
get_health_dashboard
Overview of all monitored agents. No parameters.
Returns all agents sorted by risk score with their status (STUCK/HEALTHY), action counts, and circuit breaker config.
Resources
URI | Description |
| All monitored agents with current status |
Usage Pattern
1. register_agent — at agent startup
2. Before each tool call:
a. check_circuit_breaker — should this action proceed?
b. Execute the tool
c. log_action — record what happened
3. Periodically:
- detect_loop — am I stuck?
- get_health_dashboard — how are all agents doing?
4. On stuck detection:
- get_stuck_report — what went wrong and how to recoverTests
npm testLicense
MIT
This server cannot be deployed
Maintenance
Related MCP Connectors
MCP enforcement layer that intercepts AI agent actions and blocks rule violations before execution.
Deterministic runtime safety for AI agents: scan PII, gate tool actions, verify LLM output.
The WAF for agents. Pattern-based + heuristic firewall scans prompts, RAG documents, tool argume...
Watchdog for unattended AI agents: alerts, evidence checks and a verifiable proof per run.
Related MCP Servers
- AlicenseAqualityBmaintenanceA Model Context Protocol server that empowers AI agents with metacognitive monitoring to detect reasoning loops and provide intelligent recovery using case-based reasoning and statistical analysis.950 npm9MIT
- AlicenseNot gradedqualityDmaintenanceDetects and breaks repetitive fix loops in AI coding assistants by tracking attempts and providing escalating intervention strategies. It utilizes error fingerprinting and similarity analysis to redirect the AI toward new approaches when it gets stuck on the same error.4 npm4MIT
- AlicenseAqualityAmaintenanceAgentGuard47 is runtime safety infrastructure for AI agents. It adds budget caps, loop detection, retry limits, timeouts, local traces, and incident reports so agents can stop bad runs while they are happening, not just explain them afterward.74MIT
- AlicenseBqualityDmaintenanceAn MCP server for detecting retry loops and analyzing iteration patterns in agentic coding workflows, providing structured debugging intelligence to improve repair attempts.164MIT