agent-orchestrator
Enables multi-model leader-worker agent orchestration, workflow execution, and deterministic validation via structured MCP tools.
README
agent-orchestrator
English | 简体中文
agent-orchestrator is a TypeScript orchestration server for multi-model engineering workflows. It is designed for leader-worker execution, deterministic validation, and thin delivery layers through a CLI and MCP server.
What this is
- A TypeScript/Node.js monorepo for orchestrating leader and worker agents
- A CLI callable by humans or other coding agents through shell commands
- An MCP server exposing orchestration capabilities as structured tools
- A safe workflow engine that defaults to dry-run behavior
What this is not
- Not a Codex, OpenCode, Cursor, or Claude Code clone
- Not an interactive coding terminal or TUI
- Not a full chat interface
- Not a web UI product
Architecture diagram
Human / Coding Agent / CI / MCP Client
|
v
ao CLI / MCP
|
v
LangGraph Workflows
|
+---------+---------+
| |
v v
Leader Agent Deterministic Tools
|
v
Worker Agents
Monorepo layout
packages/
core/
models/
graph/
tools/
mcp-server/
cli/
apps/
playground/
examples/
leader-worker-basic/
docs/
Setup
pnpm install
pnpm typecheck
pnpm test
CLI usage
ao plan --goal "Generate TipTap nodes from S1000D proced.xsd"
ao run leader-worker-basic --goal "Generate tests for schema parser"
ao review --diff main...HEAD
ao fix --error ./tmp/tsc-error.log --scope packages/schema-codegen
ao models list
ao mcp serve
ao mcp list-tools
Worker onboarding
Workers are not treated as automatically qualified just because a model endpoint exists.
Use onboarding evaluation before assigning real work:
ao worker interview --provider litellm --model qwen3-coder
ao worker interview --provider litellm --model qwen3-coder --save
ao worker list
ao worker profile litellm:qwen3-coder
The interview workflow evaluates:
- instruction following
- structured JSON output
- summarization
- code understanding
- simple TypeScript code generation
- confidence calibration
Interview results produce a WorkerCapabilityProfile that affects routing:
active: worker can receive the task types it qualified forlimited: worker is restricted to low-risk tasks and requires leader reviewblocked: worker is excluded from production workflows and emits warnings
Example warning output:
Worker litellm:qwen3-coder failed onboarding evaluation.
Status: limited
Reasons:
- structured-output: Output failed schema validation.
- codegen: Generated code uses any.
- confidence-calibration: Worker reported high confidence on an ambiguous task.
Recommended action:
- Do not assign codegen tasks.
- Limit this worker to qualified low-risk tasks.
- Require leader review for every accepted output.
If the worker is significantly worse, the profile becomes blocked and production routing should treat it as unavailable.
Persisting worker profiles
Use --save if you want to persist the interview result:
ao worker interview --provider litellm --model qwen3-coder --save
Saved profiles are written to:
.ao/worker-profiles.json
You can inspect persisted profiles with:
ao worker list
ao worker profile litellm:qwen3-coder
Current behavior is conservative: if a workflow is started without an explicit profile object, the system can re-run the interview instead of blindly trusting an old capability record.
MCP server usage
Start the stdio server:
ao mcp serve
List exposed tool names:
ao mcp list-tools
Environment variables
See .env.example.
LEADER_MODEL_PROVIDERLEADER_MODEL_NAMELEADER_MODEL_BASE_URLLEADER_MODEL_API_KEYWORKER_MODEL_PROVIDERWORKER_MODEL_NAMEWORKER_MODEL_BASE_URLWORKER_MODEL_API_KEYLITELLM_BASE_URLLITELLM_API_KEYMCP_SERVER_NAMEMCP_SERVER_VERSIONLOG_LEVELAO_DRY_RUNAO_ALLOW_WRITEAO_ALLOWED_COMMANDS
Workflows
planning-workflow: builds a plan, worker assignment proposal, risk list, and validation strategyleader-worker-workflow: coordinates leader planning, worker execution, tool validation, and final reviewreview-workflow: summarizes diff impact, risks, missing tests, and follow-up itemsfix-error-workflow: analyzes error logs and proposes safe validation-oriented fix stepsworker-interview-workflow: evaluates a worker model before production routing and generates a capability profile
How to run the basic example
pnpm example:leader-worker-basic
How to add a new worker
- Add a worker class under
packages/graph/src/workers. - Give it a clear
WorkerCapabilitywith Zod-backed schemas. - Declare the worker's supported task types so routing can enforce capability limits.
- Route it from a workflow and keep its output reviewable.
- Make sure onboarding interview results can constrain how it is assigned.
- Add tests for the workflow path it affects.
How to add a new workflow
- Create a workflow file under
packages/graph/src/workflows. - Use LangGraph.js to model transitions explicitly.
- Reuse core contracts and leader review patterns.
- Expose it through the CLI or MCP only after tests exist.
How to add a new MCP tool
- Add a tool definition in
packages/mcp-server/src/tools. - Keep the handler thin and delegate to core workflow APIs.
- Register it in
packages/mcp-server/src/server.ts. - Add a registration test.
How to configure LiteLLM
Set LEADER_MODEL_PROVIDER=litellm or WORKER_MODEL_PROVIDER=litellm, then provide:
LITELLM_BASE_URLLITELLM_API_KEY
If you want different endpoints for leader and worker traffic, use the model-specific base URL variables instead.
Safety model
- Default mode is dry-run.
- File writes require explicit policy allowance.
- Shell execution is allowlisted.
- Worker outputs are not final until leader review completes.
- Workers must pass onboarding evaluation before they should receive production tasks.
- Workers that fail structured output or reliability checks are limited or blocked.
- Secrets are expected from environment variables and should never be logged.
Roadmap
- Expand workflow coverage and richer deterministic validations
- Add domain-specific orchestration packages later
- Add CI automation for checks and releases
- Keep the core focused on orchestration rather than UI
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.