
Agent Guard
Built to solve the infinite loop problem in agentic workflows. Wraps your AI agents with circuit breakers, pattern detection, and stuck-agent analysis. You register each agent with thresholds, log actions as they happen, and call detect_loop or check_circuit_breaker before executing tools. It tracks the last 50 actions per agent, calculates diversity ratios, and flags exact repeats or low-progress patterns. When something goes wrong, get_stuck_report gives you token waste estimates and recovery suggestions. Useful when you're chaining LLM calls and need automatic intervention before an agent burns through your budget repeating the same failed action. Runs via stdio, integrates with Claude Desktop in one config block.
- tools
- 7
- transport
- STDIO
- last updated
- Apr 24, 2026
Tools
7 toolsPublic tool metadata for what this MCP can expose to an agent.
register_agentRegister an agent for monitoring.
Register an agent for monitoring.
No parameter schema in public metadata yet.
log_actionLog an agent action for loop detection. Maintains a rolling window of the last 50 actions.
Log an agent action for loop detection. Maintains a rolling window of the last 50 actions.
No parameter schema in public metadata yet.
detect_loopCheck if an agent is stuck in an infinite loop.
Check if an agent is stuck in an infinite loop.
No parameter schema in public metadata yet.
set_circuit_breakerConfigure automatic intervention when action patterns repeat.
Configure automatic intervention when action patterns repeat.
No parameter schema in public metadata yet.
check_circuit_breakerPre-flight check before executing a tool. Call this BEFORE the actual tool call.
Pre-flight check before executing a tool. Call this BEFORE the actual tool call.
No parameter schema in public metadata yet.
get_stuck_reportDetailed analysis of why an agent is stuck.
Detailed analysis of why an agent is stuck.
No parameter schema in public metadata yet.
get_health_dashboardOverview of all monitored agents. No parameters.
Overview of all monitored agents. No parameters.
No parameter schema in public metadata yet.
Sponsors
Readme
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-mcp
Claude 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.js
Tools
register_agent
Register an agent for monitoring.
| Param | Type | Default | Description |
|---|---|---|---|
agent_id | string | required | Unique agent identifier |
max_iterations | number | 100 | Max iterations before forced stop |
progress_threshold | 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.
Details
- Repository
- github.com/mdfifty50-boop/agent-guard-mcp
- Category
- AI & LLM Tools
- Package
agent-guard-mcp- Transport
- STDIO
- Registry
- MCP registry, active