Agent Loop Detector

Agent Loop Detector MCP Connector for Claude

A+

Identifies infinite conversation cycles and deadlocks in agentic workflows.

3 tools Official Updated Oct 1, 2026 Official Vinkius Partner

This MCP server provides a deterministic analysis engine to identify infinite conversation cycles and deadlocks within agentic workflows. By analyzing the conversation state graph, it uses Tarjan's algorithm to find all strongly connected components (SCCs). It identifies loop entry points, calculates loop length, and estimates the iterations required to escape a cycle. It also flags critical deadlocks where no exit conditions exist and calculates potential resource exhaustion. Use analyze_conversation_cycles to find repeating patterns, calculate_deadlock_risk to assess the probability of getting stuck, and estimate_recovery_path to find the shortest way out of a loop.

graph-theorydeadlockagentic-workflowscycle-detectiontarjan-algorithm

3 tools expose this connector's capabilities to your AI agent.

analyze_conversation_cycles

Identifies all repeating patterns and cycles within the provided conversation state graph

calculate_deadlock_risk

Determines the mathematical probability and severity of a conversation becoming stuck

estimate_recovery_path

Predicts how many more steps are required to break a cycle if an exit condition is reachable

See how to talk to your AI agent using Agent Loop Detector.

Analyze this state graph for any infinite loops: [{'agentId': 'A', 'action': 'step', 'nextAgentId': 'B', 'condition': 'true'}, {'agentId': 'B', 'action': 'step', 'nextAgentId': 'A', 'condition': 'true'}] with max iterations 10 and current iteration 0.

A cycle was detected between agents A and B with a loop length of 2. This is a critical deadlock as no exit condition is present.

What is the deadlock risk if agent A and B are in a loop but agent B has an exit condition to agent C?

The deadlock risk is low because agent B possesses a valid exit condition to transition out of the cycle.

Find the shortest path to exit the loop from agent A to target agent C.

The shortest path to exit the loop is: A -> B -> C.

The tool uses Tarjan's algorithm to identify strongly connected components (SCCs) within the conversation state graph. Any SCC with more than one agent or a self-loop is identified as a cycle.

Related Connectors