sequenceDiagram
participant U as User (depth=0)
participant A as Agent A (depth=1)
participant B as Agent B (depth=2)
participant C as Agent C (depth=3=limit)
U->>A: message
Note over A: RouterLoop → delegate_to_agent
A->>B: send(to=B, depth=1, chain_id=xyz)
Note over B: RouterLoop → delegate_to_agent
B->>C: send(to=C, depth=2, chain_id=xyz)
Note over C: depth=3 = max_hop_depth
C-->>B: result (chain_id=xyz)
B-->>A: result (chain_id=xyz)
A-->>U: final reply
Note over A,C: chain timeout = 60s
flowchart LR
subgraph SRV["MCP Server — implemented (reyn mcp serve)"]
direction TB
EXT["External LLM Client\nClaude Code · Cursor · OpenAI SDK"]
STDIO["stdio / JSON-RPC 2.0"]
TOOLS["list_agents() · send_to_agent()"]
AR["AgentRegistry → ChatSession"]
EXT --> STDIO --> TOOLS --> AR
end
subgraph CLI2["MCP Client — implemented (stdio · HTTP)"]
direction TB
PHASE["Reyn Phase (control_ir)"]
MCIROP["MCPIROp kind: mcp"]
MCLIENT["MCPClient\nstdio / HTTP transport"]
EXTMCP["External MCP Server"]
PHASE --> MCIROP --> MCLIENT --> EXTMCP
end