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
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。