cli-orchestrator-mcp
Supports OpenAI Codex CLI as a worker provider, enabling async task dispatch with thread ID session resume, automatic git worktree isolation, and binary override via CODEX_BIN.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
cli-orchestrator-mcp
Let ANY MCP-compatible AI IDE act as the Lead, and orchestrate MULTIPLE local AI CLI coding agents in parallel.
cli-orchestrator-mcp is a vendor-neutral, zero-dependency, asynchronous task-based MCP server with a pluggable adapter architecture. Any IDE (Antigravity, Claude Code, Cursor, VS Code, Windsurf, Cline / Roo Code, Zed) can simultaneously dispatch tasks across 7 major local CLI agents (OpenCode, Antigravity CLI, Claude Code, Gemini CLI, OpenAI Codex, Cursor Agent CLI, and Aider) with automatic git worktree isolation and stateful session_id continuation.
Architecture • Supported CLIs • Benchmarks • Tools • Quick Start • Lead Skill
Architecture (Hub-and-Spoke Multi-IDE Control)
flowchart LR
Lead["Any Lead IDE\n(Antigravity / Cursor / Claude Code / VS Code / Windsurf)"]
MCP["cli-orchestrator-mcp\n(Async Task Registry + Git Worktree Manager)"]
OC["OpenCode CLI\n(warm service daemon)"]
AGY["Antigravity CLI (agy)\n(isolated worktree)"]
CC["Claude Code CLI\n(isolated worktree)"]
OTH["Gemini / Codex / Cursor / Aider\n(isolated worktree)"]
Lead <-->|"JSON-RPC 2.0 (stdio)\n~25 ms async dispatch"| MCP
MCP --> OC
MCP --> AGY
MCP --> CC
MCP --> OTH1 Lead → N Different Workers: Combine subscriptions on one machine (e.g., fast UI/boilerplate on one CLI, deep architecture on another, independent code review on a third) in a single parallel wave.
Universal
git worktreeIsolation: Providers with native worktree flags use them directly; for all other CLIs, the MCP server automatically creates and manages isolated git worktrees so concurrent edits never collide.100% Vendor-Neutral: Pure
worker_*tool surface with zero hardcoded providers or external npm dependencies.
Related MCP server: forge-orchestrator
Supported CLI Workers (7 Adapters)
Call worker_list_providers to auto-detect which CLIs are installed on your machine:
Provider ID | CLI Tool | Status | Session Resume | Model List | Worktree Isolation | Env Override |
| OpenCode CLI ( | Live Verified |
|
| Native |
|
| Antigravity CLI ( | Live Verified |
|
| Auto git worktree |
|
| Claude Code CLI ( | CLI Flags Verified |
| Hint/alias | Auto git worktree |
|
| Gemini CLI ( | CLI Flags Verified |
| Hint/alias | Auto git worktree |
|
| OpenAI Codex CLI ( | Beta (PRs welcome) | Thread ID | Hint/alias | Auto git worktree |
|
| Cursor Agent CLI ( | Beta (PRs welcome) |
| Hint/alias | Auto git worktree |
|
| Aider CLI ( | Beta (PRs welcome) | — | Hint/alias | Auto git worktree |
|
Benchmarks: Direct CLI vs cli-orchestrator-mcp
Measured live using npm run bench (benchmarks/run.mjs • raw data in benchmarks/latest-results.json).
Test Environment
Platform: Windows 11 (
win32 x64) • Node.js:v24.19.0Auto-Detected on Machine:
opencode(v2.4.1),antigravity(agy 1.4.12),claude-code(2.1.110),gemini-cli(0.46.0)Live-Authenticated Providers Benchmarked:
opencode(opencode-go/deepseek-v4.1-flash) +antigravity(agy)
1. Parallel Fan-Out & Lead Blocking (Same-Provider & Cross-IDE)
Benchmark Scenario | Direct CLI (Cold / Seq) | Direct CLI (Warm / Seq) |
| Lead Blocking (Dispatch) | Measured Speedup |
OpenCode: 3-Task Fan-Out | 12,063 ms | 5,762 ms | 2,013 ms | 135 ms | 5.99× vs cold / 2.86× vs warm seq |
Cross-IDE: 2× OpenCode + 1× Antigravity | — | 27,975 ms | 9,558 ms | 25 ms | 2.93× faster (1,119× less Lead blocking) |
Cross-IDE (2x OpenCode + 1x Antigravity):
Direct CLIs (sequential) ████████████████████████████████████████ 27,975 ms
MCP Parallel (all 3 at once) ██████████████ 9,558 ms (2.93x faster)
└─ OpenCode Worker #1 ██ 1,175 ms
└─ OpenCode Worker #2 ██ 1,319 ms
└─ Antigravity Worker #3 ██████████████ 9,532 ms
Lead dispatch blocking time ▏ 25 ms (non-blocking)2. Single-Task & Multi-Turn Session Continuation
Provider | Single Task (Direct CLI) | Single Task (MCP) | Session Turn 1 | Session Turn 2 ( | Turn 2 Prompt Cache Hit |
OpenCode ( | 3,547 ms (cold) / 1,409 ms (warm) | 2,291 ms | 1,772 ms | 1,208 ms | 7,552 cached vs 148 new (98.1% hit) |
Antigravity ( | 33,145 ms | 13,073 ms | 9,120 ms | 6,745 ms | 10,048 cached tokens |
Key Takeaways
Cross-IDE parallelism hides slow workers: In the
2× OpenCode + 1× Antigravitytest, both OpenCode workers completed in~1.2swhile Antigravity was still reasoning (9.5s), reducing total wall-clock time from27.98sto9.56s(2.93× faster) while blocking the Lead for only 25 ms.Same-provider scaling is nearly 6× faster than cold CLI:
12,063 ms(--standalonesequential) drops to2,013 msvia warm-service async MCP (5.99×).Stateful revisions stay fast across providers: Both OpenCode (
--session) and Antigravity (--conversation) preserved context accurately (17 × 3 = 51,12 × 4 = 48) with massive prompt-cache reuse (98.1%on OpenCode).
Reproduce on Your Machine
npm run bench
# Or target a specific OpenCode model:
BENCH_MODEL=opencode/claude-fable-5-2 npm run benchMCP Tool Reference
Tool | Description | Key Parameters |
| Auto-detects all 7 supported local AI CLIs (60s cached, |
|
| Checks/starts a provider's background daemon (if applicable). |
|
| Lists available models for a provider ( |
|
| Starts an async worker task with priority queuing, auto-retry, and worktree locking. |
|
| Executes a DAG Dependency Graph ( |
|
| Gets live status and per-node outputs of a running or completed DAG workflow. |
|
| Gets status, output, |
|
| Waits for multiple parallel tasks in one MCP call ( |
|
| Lists all worker tasks ( |
|
| Cleanly terminates a queued or running worker process tree. |
|
| Safely removes a temporary git worktree (blocked if an active task holds its lock). |
|
| Returns per-provider metrics: success rate, avg latency, retries, token usage, cost, and active queue state. | (none) |
Example: Multi-Agent DAG Workflow (worker_run_workflow)
{
"name": "feature-pipeline",
"wait_seconds": 30,
"tasks": [
{ "id": "backend", "provider": "claude-code", "worktree": "feat-api", "prompt": "Build POST /api/settings" },
{ "id": "frontend", "provider": "opencode", "model": "opencode-go/deepseek-v4.1-flash", "worktree": "feat-ui", "prompt": "Build SettingsModal UI" },
{ "id": "integration", "provider": "codex", "depends_on": ["backend", "frontend"], "prompt": "Wire UI to API. Backend: {{backend.output}} Frontend: {{frontend.output}}" },
{ "id": "review", "provider": "gemini-cli", "depends_on": ["integration"], "prompt": "Review integration: {{integration.output}}" }
]
}Built-in Performance & Orchestration Highlights
DAG pipelines (
worker_run_workflow): Run parallel stages withdepends_on,{{nodeId.output}}interpolation, cycle detection, and automatic downstream skip-on-failure.Priority concurrency queue & auto-retry: Cap concurrent workers via
CLI_ORCHESTRATOR_MAX_CONCURRENT, prioritize urgent tasks withpriority, and recover automatically withmax_retries.Batch collection (
worker_wait_tasks): Collect N parallel workers in 1 round-trip (mode: "all"or"any") instead of polling each task individually.Proactive daemon warm-up: Automatically warms up installed background daemons on MCP
initializeso the first task hits zero cold-start latency.Zero-reinstall worktrees (
link_deps: true): Automatically creates OS-native junctions/symlinks fornode_modules&.venv(while keeping.envfiles isolated unlesscopy_env: trueis opted in).Non-blocking I/O & caching: Async
fs.promisestask snapshots + 60s provider/model discovery caches keep the JSON-RPC loop unblocked.Lead context protection (
max_output_chars): Cap huge worker logs inline while returninglog_pathto inspect full output on demand.
Example: Dispatching Two Different IDEs in Parallel
// Call 1 — OpenCode worker on isolated worktree
{
"tool": "worker_start_task",
"arguments": {
"provider": "opencode",
"model": "opencode-go/deepseek-v4.1-flash",
"prompt": "Implement the responsive settings modal in src/components/SettingsModal.tsx",
"worktree": "feat-settings-ui",
"auto_approve": true,
"wait_seconds": 0
}
}
// Call 2 — Claude Code or Antigravity worker on another worktree (same turn!)
{
"tool": "worker_start_task",
"arguments": {
"provider": "claude-code",
"model": "sonnet",
"prompt": "Write integration tests for POST /api/settings in tests/settings.test.ts",
"worktree": "feat-settings-tests",
"auto_approve": true,
"wait_seconds": 0
}
}Quick Start (Zero-Clone via npx)
Check which local AI CLIs are installed and ready on your machine:
npx -y github:cancakmk/cli-orchestrator-mcp --doctorAntigravity / Cursor / Windsurf / Cline / Roo Code
Add to mcp_config.json (or .cursor/mcp.json):
{
"mcpServers": {
"cli-orchestrator": {
"command": "npx",
"args": ["-y", "github:cancakmk/cli-orchestrator-mcp"]
}
}
}Claude Code
claude mcp add cli-orchestrator -- npx -y github:cancakmk/cli-orchestrator-mcpVS Code (GitHub Copilot MCP)
Add to .vscode/mcp.json:
{
"servers": {
"cli-orchestrator": {
"type": "stdio",
"command": "npx",
"args": ["-y", "github:cancakmk/cli-orchestrator-mcp"]
}
}
}Local Clone (For Development / Offline Use)
git clone https://github.com/cancakmk/cli-orchestrator-mcp.git
cd cli-orchestrator-mcp
npm test
# Point your IDE MCP config to: node /absolute/path/to/cli-orchestrator-mcp/server/index.mjsLead Orchestration Skill (Optional)
No extra setup required: cli-orchestrator-mcp automatically sends core Lead orchestration instructions via the standard MCP initialize.instructions field as soon as your IDE connects.
For deeper customization, you can also copy skills/cli-orchestrator-lead/SKILL.md into your IDE's skills folder.
Configuration & Environment Variables
Variable | Default | Description |
|
| Directory where task JSON snapshots are persisted (falls back to |
|
| Maximum number of workers running simultaneously (extra tasks enter |
|
| In-memory |
|
| In-memory |
| (none) | Comma-separated provider IDs to disable (e.g. |
| (unrestricted) | Workspace allowlist ( |
| (none) | Comma-separated env variable names or |
| Auto-detected | Optional explicit host client ID override for the self-invocation guard. |
|
| Maximum nesting depth ( |
| Auto-detected | Optional explicit binary path override per CLI provider. |
|
| Model used by |
Security, Reliability & Recursion Guard
Zero credentials stored & secret isolation: Uses only your locally authenticated CLI sessions. New git worktrees link
node_modules/.venvby default but never copy.envfiles unlesscopy_env: trueis explicitly passed. Strip sensitive host variables from child processes viaCLI_ORCHESTRATOR_STRIP_ENV.Workspace allowlist (
CLI_ORCHESTRATOR_ALLOWED_ROOTS): Restricts all workercwdand cleanup operations to approved root directories (withrealpathtraversal protection).Safe worktree lifecycle & locking: Prevents two active workers from mutating the same
worktreesimultaneously, blocksworker_cleanup_worktreewhile a task owns it, and refuses to delete worktrees with uncommitted changes unlessforce: trueis passed.Process-tree termination & hard timeouts: Kills full process trees on both Windows (
taskkill /T /F) and POSIX (detached: true+process.kill(-pid)), with configurabletimeout_seconds(default300s, statustimed_out) and gracefulSIGINT/SIGTERMshutdown.Bounded memory & restart recovery: Caps in-memory
stdout(4 MB) andstderr(512 KB) to prevent OOM from noisy workers, while persisting task snapshots to disk for cross-restartworker_get_tasklookup.Automatic Self-Invocation & Recursion Guards: Detects the host MCP client (
clientInfo.name), blocks self-invocation unlessallow_self: true, supportsCLI_ORCHESTRATOR_EXCLUDE, and enforcesCLI_ORCHESTRATOR_DEPTHto make infinite loops impossible.
License
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
- aXDeprecatedio.github.ax-platform
Agent-native collaboration network: orchestrate a team of long-running agents from any MCP client.
Project management shared by people and AI agents, with persistent project state through MCP.
Persistent memory, knowledge graph, task management and more for AI agents via MCP.
Task management your AI agents can actually run. One line becomes a context-ready task over MCP.
Related MCP Servers
- AlicenseBqualityFmaintenanceEnables orchestrating multiple AI CLI agents (Claude Code, Codex, Gemini CLI, Copilot CLI) through a unified MCP interface for task delegation, cross-agent comparison, and specialized tools like code review and debugging.1415 npm13MIT

forge-orchestratorofficial
AlicenseNot gradedqualityAmaintenanceEnables orchestrating multiple AI coding tools (Claude Code, Codex CLI, Gemini CLI) on shared repositories with file locking, knowledge capture, task planning, and drift detection via an MCP server.168Apache 2.0- FlicenseNot gradedqualityAmaintenanceEnables a primary AI assistant to delegate tasks in parallel to specialized local CLI-based AI sub-agents, share project context, and synthesize their responses through a single MCP interface.-
- FlicenseNot gradedqualityAmaintenanceEnables a primary AI assistant in an IDE to delegate tasks to multiple specialized AI coding assistants via MCP, running them in parallel with shared project context and synthesizing a single response. It uses existing CLI tools and subscriptions, supporting Codex, Claude, Cursor, Gemini, and 26+ MCP-compatible clients.-