lazymac2x avatar

Agent Loop Detector

lazymac2x/agent-loop-detector-api

Built to catch when AI agents get stuck in repetitive loops during task execution. This runs as a Cloudflare Worker and exposes both REST and MCP interfaces over streamable HTTP, so you can integrate loop detection into your agent workflows without spinning up your own infrastructure. Reach for this when you're building autonomous agents that might spiral into the same actions repeatedly and you want an external service to flag the pattern. The MCP interface means Claude can directly call it during conversations to check if it's repeating itself across tool calls or reasoning steps.

tools
3
transport
HTTP
last updated
May 16, 2026

Install

From registry metadata
$ npx add-mcp https://api.lazy-mac.com/agent-loop-detector/mcp --name agent-loop-detector

Run in your terminal. add-mcp asks which agents to add it to (Claude Code, Codex, Cursor and more). Add -g to install it for every project.

Review the command, arguments and environment values before installing. MCP servers run with your local permissions.

Other ways

Claude Code

$ claude mcp add --transport http agent-loop-detector https://api.lazy-mac.com/agent-loop-detector/mcp

Run in your terminal. Add --scope user to make it available in every project.

Tools

Verified live · 3 tools

Verified live against the running server on Nov 6, 2026.

analyze_traceFull diagnostic: loop detection, cost breakdown, stuck-state classification, and fix recommendations for an AI agent trace.2 params

Full diagnostic: loop detection, cost breakdown, stuck-state classification, and fix recommendations for an AI agent trace.

Parameters* required
pricingobject
trace*array
Ordered array of agent steps (role, tool, input, output, tokens, model)
detect_loopsDetect exact-call repeats, periodic tool-call cycles, and ping-pong patterns in an agent trace.1 params

Detect exact-call repeats, periodic tool-call cycles, and ping-pong patterns in an agent trace.

Parameters* required
trace*array
breakdown_costCalculate per-model token usage and USD cost from an agent trace. Supports custom pricing overrides.2 params

Calculate per-model token usage and USD cost from an agent trace. Supports custom pricing overrides.

Parameters* required
pricingobject
trace*array

Sponsors

Readme

agent-loop-detector-api

Cloudflare Workers MCP server: agent-loop-detector. REST + MCP (JSON-RPC 2.0). Live: api.lazy-mac.com/agent-loop-detector

Details

Repository
github.com/lazymac2x/agent-loop-detector-api
Categories
AI & LLM Tools, Cloud & Infrastructure
Transport
HTTP
Registry
MCP registry, active
Tools verified
Nov 6, 2026

More from lazymac2x

Related AI & LLM Tools MCP servers

View all
1lazymac2x avatarAgent Trace Auditorlazymac2x/agent-trace-auditor-apiCloudflare Workers MCP server: agent-trace-auditor0stars
2lazymac2x avatarAgent Workflow Enginelazymac2x/agent-workflow-engine-apiCloudflare Workers MCP server: agent-workflow-engine0stars
3lazymac2x avatarAi Agent Scratchpadlazymac2x/ai-agent-scratchpad-apiCloudflare Workers MCP server: ai-agent-scratchpad0stars
4pavelguzenfeld avatarGeminipavelguzenfeld/gemini-mcpMCP server that exposes Google Gemini as tools for Claude Code0stars
5pipeworx-io avatarGemini Cryptopipeworx-io/mcp-gemini-cryptoGemini Exchange MCP (public endpoints).0stars
6pipeworx-io avatarHuggingfacepipeworx-io/mcp-huggingfaceHugging Face Hub MCP — models, datasets, spaces0stars