Request/Response Flow
Dispatch Sequence
Claude Code Invokes MCP Tool
User asks Claude a question. Claude decides to consult an external AI and calls dispatch_to_reviewboard with a prompt and target.
MCP Server Receives Request
The MCP code-executor server (localhost:9091) receives the request via stdio transport and parses the JSON parameters.
HTTP POST to Swarm Node
MCP server sends HTTP POST to the target container via Docker's internal DNS (mcp-net network).
FastAPI Adapter Executes CLI
The FastAPI adapter inside the container spawns the CLI tool (gemini/codex/claude) with the prompt and captures output.
AI Reads Files & Responds
The AI model reads files from /workspace (if requested), processes the prompt, and generates a response. The adapter captures the output.
JSON Response Returned
The response flows back through the chain: Adapter -> MCP Server -> Claude Code CLI. Claude presents the result to the user.
MCP API Endpoints
Dispatch a prompt to an AI Board node for execution.
Check health status of all swarm nodes.