Workforce Orchestrator MCP
Runs worker tasks through the direct OpenAI backend using either Chat Completions or the Responses API, with a tool loop and workspace-scoped file/shell tools (read_file, write_file, list_directory, run_shell). Supports configurable model, base URL (including local OpenAI-compatible gateways), temperature, output-token limits, and iteration caps, and can be selected per role such as reviewer.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Workforce Orchestrator MCPrun a two-task workflow to add tests and fix lint, with a 50k token budget"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Workforce Orchestrator MCP
A universal execution workforce for Codex and other MCP clients.
The orchestrator turns a planner (Codex, Claude, or any MCP-capable client) into a supervisor over pluggable worker backends: task DAGs, workflows, budgets, roles, presets, acceptance tracking, metrics, durable process supervision, git isolation, and an artifact cache.
The planner thinks. Workers execute. The orchestrator schedules. The supervisor owns state and Git. Humans retain final control.
Planner (Codex)
│
▼
Workforce Orchestrator
│
Backend Router
│
┌──────────────┬──────┴───────┬──────────────┐
▼ ▼ ▼ ▼
DeepSeek OpenCode OpenAI API Anthropic API
Harness CLI (direct) (direct)
│ │ │ │
└──────────────┴──────────────┴──────────────┘
│
isolated workspaces
artifacts · metrics · gitBackends
Backend id | Runtime | Session continuation | Durable reattach | Credentials |
| DeepSeek Harness CLI (headless profile) | yes | yes | owned by dsh ( |
| OpenCode CLI ( | yes | yes | owned by OpenCode ( |
| Direct OpenAI Chat Completions or Responses API | yes | no (in-process) |
|
| Direct Anthropic Messages API | yes | no (in-process) |
|
| Local test backend, no API calls | yes | no | none |
The registry is deterministic and never silently falls back. Selection order:
explicit
backendon the task/workflow taskrouting.roles.<role>from~/.workforce/config.jsonrouting.defaultdefault_backendWORKFORCE_DEFAULT_BACKENDWORKFORCE_BACKEND(unlessauto)first locally available backend in order
dsh → opencode → openai → anthropicdsh
auto is the default, so a fresh install uses whichever runtime is actually
available on the machine. An unavailable explicitly-selected backend is a clear
error — nothing is auto-installed or silently substituted.
Related MCP server: coding-agent-mcp
What's new in v5.1
DSH model selection. The DeepSeek Harness backend can now run a chosen model — per task (
spawn_task({ model: "k3-256k" })), per config (backends.dsh.model), or per environment (WORKFORCE_DSH_MODEL). The headless app has no--modelflag, so the backend applies selection with the launcher's documented--patchoverlay onagent-default-model(provider + model + reasoningEffort), based on facts read locally fromdsh --dump-config. No provider API is contacted to discover models.Model discovery. New
list_modelsMCP tool andnode dist/cli.js modelscommand list the models the runtime is configured to serve plus the current default.list_backends/get_backendincludemodels+default_model.Universal per-task model.
modelworks on every backend that advertisescapabilities.modelSelection(dsh, opencode, openai, anthropic). Backends that don't support it reject the parameter explicitly instead of ignoring it.Per-task model is persisted (schema v7), shown in results/status, honored by
continue_worker, included in cache keys, and aggregated inget_system_metrics().models.Backend failure errors now include a bounded, redacted stderr tail — e.g. invalid models surface the runtime's
UNKNOWN_MODELmessage directly.
Expanded backend support (part of v5.1)
Removed all vendor-specific naming. Environment variables, branches, state paths, package/bin names, and messages are now universal.
Added OpenCode as a first-class CLI backend with durable JSONL logs, session continuation, usage/tool events, and reattach support.
Added direct OpenAI backend: Chat Completions (
/chat/completions) or Responses (/responses), with a tool loop.Added direct Anthropic backend: Messages API with a tool loop.
Direct API backends expose
read_file,write_file,list_directory, andrun_shell, scoped to the task workspace.WORKFORCE_BACKEND=autoplus automatic local backend discovery.Workflow token budget is now
max_worker_tokens(vendor alias removed).
Quick start
npm install
npm run build
# Optional: see which backends are locally available, and their models
node dist/cli.js backends
node dist/cli.js models
# Start the MCP server on stdio
node dist/cli.js serve # or: npx workforce-mcp serveZero-config behavior depends on what is installed:
dshon PATH (or/usr/local/bin/dsh) → DeepSeek Harnessotherwise
opencodeon PATH → OpenCodeotherwise an OpenAI/Anthropic API key in the environment → direct API
otherwise the server starts and reports a clear availability error at spawn
Installation
Requirements:
macOS or Linux
Node.js ≥ 22 (uses built-in
node:sqlite; verified on Node 24)git
at least one worker backend:
DeepSeek Harness CLI, or
OpenCode CLI, or
an OpenAI-compatible API key, or
an Anthropic API key
npm install
npm run buildCodex MCP setup
[mcp_servers.workforce]
command = "node"
args = ["/absolute/path/to/workforce-orchestrator-mcp/dist/cli.js", "serve"]Each argv element must be its own TOML string. A single
"…/cli.js serve" string makes node look for a file literally named
cli.js serve.
Optional environment overrides:
[mcp_servers.workforce.env]
WORKFORCE_BACKEND = "auto"
WORKFORCE_MAX_CONCURRENT = "4"
WORKFORCE_ROOT = "~/.workforce/workers"
# Direct API backends:
# OPENAI_API_KEY = "..."
# ANTHROPIC_API_KEY = "..."Backend configuration (~/.workforce/config.json)
The orchestrator works with zero configuration. The optional config file is the single place to pin executables, choose models, and route roles.
First CLI start → if the file is absent, a minimal starter config is written automatically (
{"default_backend":"auto", ...}). It pins nothing, so local backend discovery still applies.Existing file → strict JSON (no comments, no YAML), read once at startup and never modified by the server.
WORKFORCE_CONFIG → override the config file location (useful for CI, tests, or per-project configs).
To start from the fully populated reference instead of the starter:
mkdir -p ~/.workforce cp config.example.json ~/.workforce/config.json node dist/cli.js backends
Schema
{
"default_backend": "auto",
"backends": {
"dsh": {
"command": "/usr/local/bin/dsh",
"profile": "headless",
"model": "k3", // default model for every dsh run
"provider": "kimi-coding", // provider that owns the model
"reasoning_effort": "max" // passed through as reasoningEffort
},
"opencode": {
"command": "opencode",
"model": "anthropic/claude-sonnet-4-5",
"agent": "build",
"auto_approve": true,
"args": []
},
"openai": {
"api_key_env": "OPENAI_API_KEY",
"base_url": "https://api.openai.com/v1",
"model": "gpt-4.1",
"api": "chat_completions", // or "responses"
"max_output_tokens": 8192,
"temperature": 0.2,
"max_iterations": 48
},
"anthropic": {
"api_key_env": "ANTHROPIC_API_KEY",
"base_url": "https://api.anthropic.com",
"model": "claude-sonnet-4-5",
"api_version": "2023-06-01",
"max_output_tokens": 8192,
"max_iterations": 48
}
},
"routing": {
"default": "dsh",
"roles": {
"reviewer": "openai",
"researcher": "anthropic"
}
}
}All fields are optional. Unknown keys are ignored for forward compatibility.
Backend ids referenced in default_backend / routing must be registered,
otherwise startup fails with an explicit error.
Credentials
Prefer environment variables over storing secrets in the config file:
Backend | Primary env | Alternate env |
OpenAI |
|
|
Anthropic |
|
|
api_key_env lets you name a different environment variable. A custom
base_url can point at a local OpenAI-compatible gateway that does not require
a key; in that case the backend is considered available even with an empty key.
dsh and opencode own their credentials (for example ~/.dsh/.env and
opencode auth); the orchestrator does not read or manage them.
Model selection
Every backend with capabilities.modelSelection accepts a per-task model:
{ "task": "...", "mode": "code", "model": "k3-256k" }Precedence (first hit wins), per backend:
modelon the task / workflow task /continue_workerbackends.<id>.modelin~/.workforce/config.json<BACKEND>_MODELenvironment variable (e.g.WORKFORCE_DSH_MODEL)The runtime's own default (for dsh:
agent-default-modelin the profile)
Discover what is available without spending quota (local config only):
node dist/cli.js models # default backend
node dist/cli.js models dsh # specific backendThe same data is exposed as the list_models MCP tool and inside
list_backends / get_backend (models, default_model).
How dsh applies it. The headless app takes no --model flag, so the
backend writes a small --patch overlay next to the task logs
(dsh-model.yml) that replaces the agent-default-model entry with
provider, model, and reasoningEffort. Base values are read from
dsh --dump-config --profile <profile> (a local command; never the network,
never credentials). An invalid model is not swallowed: the run fails and the
error carries the runtime message, e.g.
backend exited with code=1 …; stderr: dsh: UNKNOWN_MODEL: pi-ai provider "kimi-coding" has no configured model "…".
For the other backends the override flows through their native mechanism:
opencode --model, OpenAI model field, Anthropic model field.
Environment variables
Variable | Default | Meaning |
|
|
|
| — | Routing default (overrides |
|
| Config file path (created on first start if absent) |
|
| State root (worktrees, task workspaces, db) |
|
| SQLite database |
|
| Max parallel tasks |
|
| Default per-task timeout (s) |
|
| Timeout ceiling (s) |
|
|
|
|
| Full-diff cap |
|
| Final report text cap |
|
| SIGTERM→SIGKILL grace |
|
| dsh executable |
|
| dsh profile |
| profile default | Default dsh model (e.g. |
| profile default | Provider owning the dsh model |
| profile default | e.g. |
|
| OpenCode executable |
| OpenCode default |
|
| OpenCode default | Agent name |
|
| Pass |
| — | Extra CLI flags (space-separated) |
| — | OpenAI key |
|
| OpenAI base URL |
|
| OpenAI model |
|
|
|
| — | Anthropic key |
|
| Anthropic base URL |
|
| Anthropic model |
|
| API version header |
|
| Allow research/general subagent delegation |
|
| Subagent depth limit |
|
| Subagent count limit |
MCP tools
Orchestration
Tool | Purpose |
| Key-based task DAG; shared workspace; budgets; failure policy; cycles rejected. |
| Expand a built-in preset around a goal ( |
| Built-in presets and role templates. |
| Transparent plan and live status. |
| Event-driven wait for terminal state. |
| Cancel all non-terminal tasks; preserves workspaces/artifacts. |
| Compact aggregate: outcomes, artifacts, metrics, warnings. |
| Integrated diff vs base (stat by default). |
| Record acceptance ( |
| Objective counters and quality stats. |
Tasks
Tool | Purpose |
| Spawn any mode with any workspace, deliverables, capabilities, backend, model. |
| Batch-spawn up to 16 independent tasks. |
| Efficient event-driven waiting ( |
| Compact result: status, summary, artifacts, deliverables, usage. |
| Artifact metadata and capped content. |
| Tokens, steps, tool calls by tool, runs, duration. |
| Backend availability, capabilities, factual metadata, model catalog. |
| Models a backend serves + its default (local config only, no API call). |
Workers (legacy aliases, fully supported)
Tool | Purpose |
|
|
| Compact worker status. |
| Resume the task in the same workspace/backend session. |
| Graceful terminate; workspace and changes preserved. |
| Legacy git-focused compact result. |
| Redacted, capped diagnostics. |
Task modes
Mode | Purpose | Default workspace |
| Implement, fix, test, debug, commit in an isolated worktree | git_worktree |
| Investigate (web when available), synthesize, record | temporary |
| Analyze CSV/JSON/SQLite/logs; inputs read-only, outputs as files | directory (if path given) |
| README/architecture/migration docs | any |
| Batch organize/classify/rename/convert inside the workspace | directory/temporary |
| Logs/config/service diagnosis; proposals, no destructive changes | directory/temporary |
| Read-only code review; may run tests | git_worktree |
| Generic knowledge work with file deliverables | temporary |
Each mode has its own prompt template under src/prompts/.
Workspaces
git_worktree — isolated branch
workforce/worker/<id>and worktree under~/.workforce/workers/<repo>-<hash>/<id>/worktree. The orchestrator never merges, pushes, or touches your main branch.directory — existing caller directory, canonicalized; artifact indexing is scoped to it.
temporary — fresh per-task directory under the state root, kept after completion.
Workflows, DAGs, and git isolation
Workflows share one workspace; git workflows share one integration branch (
workforce/workflow/<wf-id>).Each git workflow task gets its own worktree and branch (
workforce/task/<id>), materialized from the current integration HEAD.Task commits are cherry-picked onto the integration branch through a per-workflow async mutex. Conflicts abort cleanly and are surfaced with the conflicting files/commits — never auto-resolved.
continue_workeron a conflicted task creates a fresh worktree from the latest integration HEAD (workforce/task/<id>-r<N>) and retries integration.Failure policies:
stop_dependents(default),continue,cancel_remaining.Budgets: per-task token/time/tool/iteration caps and per-workflow
max_worker_tokens,max_duration_seconds,max_concurrent_tasks,max_tasks. Breaches produce terminalbudget_exceeded.
Durable supervision
Child-process backends (
dsh,opencode) write stdout/stderr directly to durable log files, so a supervisor crash does not break the worker.On restart: a live PID with matching identity is reattached (log replay, counters, timeout, budgets); a dead PID with a durable terminal event is finalized normally; a dead PID with no terminal evidence becomes
interrupted. Exit codes are never fabricated.Graceful server shutdown detaches workers instead of killing them. Only
cancel_worker,cancel_workflow, timeout, or budget terminate them.Direct API backends (
openai,anthropic) run in-process and cannot be reattached; an in-flight request becomesinterruptedon restart, with the workspace and artifacts preserved.
Git ownership
Workers edit and test files. The supervisor verifies and commits successful changes on git worktrees:
commit message from a
suggested_commit_message:line in the final report, orworkforce/worker/<task-id>: apply delegated changes;worker-created commits are accepted, remaining dirty files are finalized in a follow-up commit;
cancelled / timed-out / failed runs are never auto-committed;
commit identity uses the repo's existing
user.name/user.email, with a fallback identity only when missing;supervisor git commands:
status,diff,add,commit,rev-parse,log,cherry-pick(+--abort),worktree,branch. Never push, merge, reset, clean, or rebase.
Waiting and compact context
Do not poll. wait_task / wait_tasks / wait_workflow are event-driven and
return as soon as terminal state is reached (or the wait budget expires). A wait
timeout never cancels a worker.
Compact results contain status, summary, artifact metadata, usage, and
warnings. Thinking, raw tool output, full logs, full datasets, and giant diffs
never enter context automatically. Fetch them explicitly with get_artifact,
get_worker_log, or get_worker_diff; all are capped and redacted.
Deliverables and artifacts
deliverables: ["report.md", ...] is written into the worker prompt as a hard
requirement and verified on disk at completion. Missing files are recorded as
deliverables_missing (the task can still be completed).
Every produced file is indexed in SQLite with path, mime type, size, and sha256. Artifacts must live inside the task workspace; arbitrary paths are rejected. Binary artifacts return metadata only.
Roles and presets
Built-in roles: implementer, tester, researcher, reviewer,
docs_writer, data_analyst, debugger, ops_analyst.
Built-in presets: bug_fix, feature_development, quality_audit,
research_report, data_analysis. Presets are transparent DAGs — inspect them
with list_presets / get_workflow, or dry-run with
run_workflow_preset({options:{dry_run:true}}).
CLI
node dist/cli.js serve
node dist/cli.js workers|tasks [--status S] [--limit N]
node dist/cli.js task <id>
node dist/cli.js inspect <id>
node dist/cli.js artifacts <id>
node dist/cli.js artifact <id> <path> [--max-bytes N]
node dist/cli.js usage <id>
node dist/cli.js logs <id> [--lines N]
node dist/cli.js diff <id> [--full]
node dist/cli.js cancel <id>
node dist/cli.js workflows
node dist/cli.js workflow <id>
node dist/cli.js workflow-wait <id> [--timeout S]
node dist/cli.js workflow-cancel <id>
node dist/cli.js review-task <id> <accepted|rejected|needs_revision> [--feedback "..."]
node dist/cli.js task-metrics <id> | workflow-metrics <id> | metrics
node dist/cli.js roles | presets | cache-stats
node dist/cli.js backends | backend <id>Development
npm run build
npm test # unit + integration (fake/local backends, temp repos)
npm run test:unit
npm run test:integrationSmoke / live E2E scripts:
node scripts/mcp-smoke.mjs /path/to/git/repo # MCP protocol smoke (fake backend)
node scripts/real-dsh-e2e.mjs # live dsh coding E2E
node scripts/research-e2e.mjs # live research E2E
node scripts/wait-e2e.mjs # live parallel wait E2E
node scripts/workflow-e2e.mjs # live 3-task DAG E2E
node scripts/parallel-e2e.mjs # live parallel git writers E2E
node scripts/reattach-e2e.mjs # live supervisor-restart reattach E2ESecurity
Subprocess backends: argv-array spawn only; prompts/session ids cannot inject shell commands.
Direct API backends: file tools resolve paths strictly inside the task workspace.
run_shellis an intentional agent capability and executes in that workspace; do not run untrusted models on machines you cannot afford to lose.Credentials: dsh/OpenCode credentials are never read. API keys are read only from the configured environment variables and are never emitted in results, logs, diffs, artifacts, or errors (all output passes a redaction filter).
Paths:
repo_path/workspace.pathare canonicalized and validated; all state lives under the worker root; artifact/deliverable/diff paths must be relative and traversal-free.Ops mode: prompt-level prohibition of sudo/destructive commands/SSH/system changes; proposals over direct modification. Advisory, not a hard sandbox.
Process ownership: PID-tracked with start-token identity; reconciliation never assumes liveness from a bare PID.
Known limitations
Direct API backends are in-process: no durable reattach across supervisor restarts, and their shell tool inherits the server's permissions.
Token budgets are best-effort, checked per backend event; a run can overshoot within one step.
Test pass/fail in compact results is heuristic (from the final report); git facts and deliverables are verified directly.
Directory-workspace artifact discovery is mtime-based.
Capabilities are advisory (prompt-level), not a security sandbox.
Artifact cache is opt-in and only for dependency-free tasks.
Subagent support is prompt/config only; the runtime manages subagents.
No automatic worktree/workspace garbage collection (manual, by design).
License
Licensed under the Apache License, Version 2.0. Copyright 2026 Frank Ruan.
This server cannot be deployed
Maintenance
Related MCP Connectors
Work management where AI agents are first-class members: tasks, projects, memory over hosted MCP
Hosted MCP server for task-first delegation to remote workstations and workers.
Control plane for autonomous software labor. Agents claim objectives over MCP with audit trail.
Task manager for AI agents. Orchestrate agents to achieve large goals in unified control plane.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceA local-first MCP orchestration server that uses Codex as lead planner and Antigravity as host to delegate and review bounded tasks with Git integration and persistent SQLite state.Apache 2.0
- AlicenseAqualityBmaintenanceEnables supervising and orchestrating local coding agents like Muse and AGY through a client-agnostic MCP interface, with isolated Git worktrees, safe execution, and deterministic verification.107 npmMIT
- AlicenseAqualityBmaintenanceA task-level STDIO MCP server that lets Codex or any other MCP client hand off scoped coding jobs to an asynchronous worker agent which reads the code, edits files, and runs tests, while the client keeps ownership of planning and acceptance. Exposes submit, wait, query, follow-up, and cancel tools so multiple clients can queue and monitor tasks against a chosen project root.51MIT
- AlicenseNot gradedqualityAmaintenanceEnables a primary agent to dispatch, wait on, and supervise multiple parallel Codex CLI workers, each running in its own isolated Git worktree with conflict-checked path ownership. Persists every worker's state, goals, and event stream to disk so work can be tracked, resumed, reconnected, searched, and cancelled across restarts.941 npm3MIT