How 71ashu/mcp-agent-orchestrator works
Switchboard is a multi-server MCP agent orchestrator: a user submits a goal, live server tools are discovered, Claude plans a validated dependency graph, and the executor runs it with data passing, write approval, and failure recovery before producing a cited answer and run metrics. Separate branches provide evaluation, task memory, an optional web interface, and optional tracing. The README documents these capabilities; unsampled modules are represented only where it identifies their role, so some internal links are omitted.
Main entry points: orchestrator.py Run orchestrator · mcp_client.py MCP client pool · executor.py Step executor · planner.py DAG planner
Components 25
Agent runtime
- Run orchestrator
src/orchestrator/orchestrator.py - DAG planner
src/orchestrator/planner.py - Anthropic client
src/orchestrator/llm.py - Step executor
src/orchestrator/executor.py - Step templating
src/orchestrator/templating.py - Failure recovery
src/orchestrator/recovery.py - Plan and run models
src/orchestrator/models.py
Tool capabilities
- Server configuration
src/orchestrator/config.py - MCP client pool
src/orchestrator/mcp_client.py - Tool registry
src/orchestrator/registry.py - Deployment MCP server
servers/deployment_server.py
Run operations
- Write approval
src/orchestrator/approval.py - Task memory
src/orchestrator/memory.py - Evaluation metrics
src/orchestrator/evaluation.py
User interfaces
- Command-line interface
src/orchestrator/cli.py - Web run API
src/orchestrator/web.py - Run and replay UI
web/src/App.tsx
Tracing
- Tracing seam
src/orchestrator/tracing.py - Trace recorder
switchboard-trace/src/switchboard_trace/tracer.py - Trace sanitizer
switchboard-trace/src/switchboard_trace/sanitize.py - Trace transport
switchboard-trace/src/switchboard_trace/transport.py
Other components
- Goal submitter
- Configured MCP servers
- Trace collector
- Cited answer and metrics
Connections 28
- Goal submitter → Run orchestrator: submits goal
README.md - Run orchestrator → MCP client pool: starts discovery
README.md - Server configuration → MCP client pool: configures servers
src/orchestrator/mcp_client.py - Configured MCP servers → MCP client pool: serves tools
README.md - Deployment MCP server → MCP client pool: serves tools
README.md - MCP client pool → Tool registry: provides discovered tools
README.md - Run orchestrator → DAG planner: requests plan
README.md - Tool registry → DAG planner: supplies catalog
README.md - DAG planner → Anthropic client: requests planning
src/orchestrator/planner.py - Run orchestrator → Step executor: runs plan
README.md - Step executor → Step templating: resolves step data
README.md - Step executor → MCP client pool: dispatches tool calls
src/orchestrator/executor.py - Step executor → Write approval: gates write steps
README.md - Step executor → Failure recovery: recovers failures
README.md - Failure recovery → Anthropic client: repairs arguments
src/orchestrator/recovery.py - Failure recovery → DAG planner: requests replan
README.md - Run orchestrator → Anthropic client: synthesizes answer
README.md - Run orchestrator → Task memory: uses task hints
README.md - Run orchestrator → Evaluation metrics: records run metrics
README.md - Run orchestrator → Cited answer and metrics: returns result
README.md - Command-line interface → Run orchestrator: starts runs
src/orchestrator/cli.py - Run and replay UI → Web run API: starts and replays runs
web/src/App.tsx - Web run API → Run orchestrator: runs goals
README.md - Command-line interface → Tracing seam: configures optional tracing
src/orchestrator/cli.py - Tracing seam → Trace recorder: records spans
README.md - Trace recorder → Trace sanitizer: sanitizes payloads
switchboard-trace/src/switchboard_trace/tracer.py - Trace recorder → Trace transport: sends trace events
switchboard-trace/src/switchboard_trace/tracer.py - Trace transport → Trace collector: ships traces
README.md