# codex-supervisor-mcp [Health: Active]

**Category:** 🤖 Coding Agents  
**Repository:** https://github.com/zriyox/codex-supervisor-mcp  
**GitHub Stars:** 5  
**npm Downloads (last month):** 2883  
**Views:** 4  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/codex-supervisor-mcp

## Description
Parallel Codex CLI workers from any MCP client: one git worktree each, state in SQLite, web board.

## Tools
Capabilities this server exposes over MCP:

- **overview_delta** — Return a small cursor-based orchestration view: active, needs_attention, ready_to_land, ready_to_clean and changed task summaries. It never returns full history, prompts, diffs, events or worker capsules.
- **check_workers** — Check newly settled runs, actionable failures and active threads crossing the handoff threshold; automatically resume a dead lost/no_work first run once, except approval, authentication, permission and quota waits. Handoff reminders occur once per run and never cancel, replace or resume a live worker. Unchanged state is quiet. Call from a host-scheduled loop; it cannot wake a closed host. Set a distinct CODEX_SUPERVISOR_OBSERVER_ID per main thread to retain its cursor across restarts.
- **check_acceptance** — Run explicitly supplied acceptance commands in the requested project before dispatch. This executes the commands with supervisor privileges and can have their side effects; it creates no worker and does not prove worker completion. Structured checks require fresh execution evidence, while failure-count greps are flagged as insufficient baseline evidence.
- **preflight_codex_worker** — Launch a short-lived Codex probe worker in the same base commit, sandbox, guard, network and writable-root configuration intended for a later write worker. The probe must run every requested command in the actual worker environment. Read get_worker_preflight after it settles, then pass its task_id as create_codex_worker.preflight_id; a changed runtime contract is refused.
- **get_worker_preflight** — Read whether a preflight probe ran every required command successfully in the tracked worker environment, plus the immutable runtime contract hash required by create_codex_worker.preflight_id.
- **create_codex_worker** — Launch a Codex CLI worker with codex exec --json and track its events. workspaceKind controls where it runs: Git work writes only in an isolated git_worktree; read_only_in_place cannot write or use network; scratch writes only under SUPERVISOR_HOME and never lands; in_place_write is only for an explicitly authorized non-Git directory with ownedPaths and acceptance. A non-Git worker may never write the user directory by default. ownedPaths reserves files a landable worker may write; reading is never exclusive. acceptance is the list of shell commands that decide whether the work is done: the supervisor runs them after Codex exits, and workers run the same contract with codex-supervisor-accept. In a Git package project, acceptance using local JavaScript tooling requires workspaceSetup so node_modules and generated prepare files exist before dispatch. The worker's sandbox may write its execution directory, the temp directory and the OS cache directory; a toolchain whose cache lives elsewhere needs writableRoots, a list of existing absolute directories.
- **create_codex_followup_worker** — Start a NEW Codex session seeded with the previous worker's prompt, status, and recent events. Unlanded parents contribute their current codex/<parent> checkpoint; landed parents use the current target HEAD. Explicit baseRef overrides either; uncommitted parent edits are not copied. To continue the same session instead, use resume_codex_worker.
- **resume_codex_worker** — Continue the SAME Codex session for an existing worker via `codex exec resume <thread_id>`. Works from a different MCP process or a fresh client session as long as the task recorded a thread_id. The worktree stays on the commit it was cut from unless rebaseOnto names a ref (resolved in the project directory, e.g. HEAD or main): uncommitted edits are stashed, the worker's own commits are replayed onto it, the stash comes back and base_commit moves, so the worker continues on current code. A conflict in either step puts the worktree back as it was, lists the files and does not start the worker. The receipt carries base_behind: how many commits the project's HEAD is past the worktree's base. acceptance replaces the worker's acceptance commands when the ones given at dispatch were wrong; the supervisor runs them again after this run.
- **list_codex_workers** — List tracked Codex workers. Defaults to active workers only.
- **get_orchestration_overview** — Compact status table for every worker, budgeted to stay under ~2k tokens. This is the default read for an orchestrating main thread; fetch details per worker only when needed.
- **wait_codex_workers** — Block until selected Codex workers reach a terminal status, then return summaries. Each call is capped at 60 seconds unless allowLongWait is explicitly true and the caller has verified its MCP timeout supports the requested budget. A spent wait budget returns a snapshot while workers continue; reuse the same task_ids or schedule check_workers for longer monitoring. compact: true returns one line per worker with status, phase, exit_code, changed_file_count, acceptance and liveness. command_running means a command may still be working despite a long idle interval.
- **get_session_works** — Every worker dispatched under one session_id, oldest first. This is the reconnect path: a main-thread session that died can list the whole batch it started without holding any of it in context.
- **check_for_update** — Ask the npm registry whether a newer codex-supervisor-mcp is published, and whether the installed files match the published tarball. Returns installed and latest version, integrity check, and the install command. The same check runs on startup; call this to force a fresh one.
- **describe_session** — Record what a session is about: a one-line title and an optional note. Readers of the store (the web view, get_session_works) show these instead of the bare session id. Fields you omit are kept.
- **search_works** — Substring search over title, goal, prompt and last message of every tracked worker, newest first. Use it to find an earlier work by keyword instead of paging through history.
- **get_codex_worker_status** — Read the latest normalized status for one Codex worker: lifecycle, phase, current action, changed files, goal, recent commands, and the task prompt (clipped by default). Set includePrompt to read the prompt in full, or use get_codex_worker_events for the raw stream.
- **get_codex_worker_events** — Read recent raw Codex JSONL events for one worker. limit, maxChars and kinds keep the read inside a context budget; maxChars truncates the middle of oversized strings the same way Codex truncates its own output.
- **get_context_snapshot_meta** — Read the latest worker-only context snapshot metadata for one task. Returns fact IDs, token estimate and excluded categories, never the capsule text or raw history.
- **get_fact** — Read one fact by ID for audit. Facts are never automatically expanded into the main thread's context.
- **get_artifact** — Read one supervisor-managed artifact by ID for audit. This is explicit evidence retrieval and never expands a worker context capsule into the main thread.
- **promote_worker_fact** — Explicitly promote one candidate fact after main-thread review. The worker cannot call this: promotion writes a new verified fact with an audit event; repo scope requires watched paths.
- **revoke_worker_fact** — Explicitly revoke one candidate or verified fact after audit. Revoked facts are excluded from search and worker capsules; the revocation is appended to the worker event log.
- **get_worker_evidence** — Return bounded event metadata and retained artifact IDs for one worker. It does not return raw history, prompts or a worker context capsule; use get_artifact or get_codex_worker_events for a selected item.
- **search_worker_facts** — Search only verified facts relevant to one task: its own work, explicit dependencies and path-matched repository facts. Returns compact summaries, coverage and a cursor; never raw events, reports, prompts or worker capsules.
- **create_independent_verifier** — Create a fresh read-only verifier for one settled worker. It receives the target objective and current worktree path, never the target report or candidate facts, has no network and cannot dispatch workers. The review relation is persisted for later finding and resolution.
- **record_independent_finding** — After a verifier settles, record its passes/fails/inconclusive verdict with a concise reason. The supervisor stores a retained finding artifact and appends an event to the reviewed worker; this does not change the reviewed worker's delivery state automatically.
- **resolve_independent_finding** — Record how a previously recorded independent finding was resolved. This is an audit transition only; it does not hide the finding or alter worker code.
- **get_independent_review** — Read the persisted subject/verifier/finding/resolution relation for a verifier task. Use get_artifact for the retained finding evidence.
- **get_worker_goal** — Read the goal recorded for a worker, plus the native Codex thread goal when the thread has one (status, tokens used, time used).
- **get_worker_summary** — One compact summary per worker: goal, status, changed files, last command, last message. Cheap enough for a main thread to read every worker at the end of a run.
- **get_worker_result** — Read a worker's own final report. The overview and the wait response clip the last message; this is the door for the actual conclusion. Returns the last N agent messages (each clipped past maxChars, default 6000 bytes, with truncated: true and the full size so you can re-read it whole), the status fields that tell a real finish from a crash, verification (the commands the worker ran, their exit codes and the tail of any failing output, to hold its report against), acceptance (the supervisor's own run of the dispatch-time acceptance commands, independent of the report: configured, passed, and each check's exit code and output tail; passed: false means resume the worker with that output instead of reading its report, passed: true against a report that says blocked or not done means trust the checks and read the diff), changed_file_count, and base_behind (how many commits the project's HEAD is past the worktree's base; resume with rebaseOnto when it is not 0). includeFiles: true adds the changed_files list; get_worker_diff is the ground truth for what changed.
- **get_worker_diff** — The worker's actual changes. By default this is a complete file/hunk index; request one file to page through hunks with pageSize or cursor. Supplying maxChars without file preserves the legacy bounded full-diff response. This is the ground truth to check a worker's report against.
- **ask_codex_worker** — Ask a finished or running worker a question without touching its thread: the worker's Codex thread is forked once into a read-only side session (like Codex's own /btw), the question is asked there, and later questions resume that fork. The fork carries everything the worker saw and did, so 'why did you change X' or 'where is Y handled' costs one short answer instead of a read of the event stream. The fork has no network and no MCP tools and is told so; it answers from its context and the worktree. Once the worker has been resumed, the next question automatically takes a new fork from the updated thread (refreshed: "worker_resumed"); fresh: true forces a new fork. Changes still go through resume_codex_worker. Without a question it returns the latest side turn (for an answer that outran timeoutMs). end: true deletes the fork.
- **land_codex_worker** — Cherry-pick the commits a worker made on its codex/<taskId> branch onto the current branch of the directory it was dispatched from. The target must be clean and is never switched to another branch; `onto` is a guard that names the branch you expect to be on. A conflict aborts the cherry-pick, lists the files, and leaves the target as it was. A worker in the workspace-write sandbox cannot commit (Codex keeps .git read-only there): pass commitMessage and its uncommitted edits are committed as one commit on its branch first, then landed. Without commitMessage uncommitted edits are reported, not landed. includeFollowupParents lands an unlanded followup chain root-first; commitMessages supplies a per-task checkpoint message when an ancestor has uncommitted edits. Check the work first with get_worker_result and get_worker_diff; land once it passes. A malformed report summary is attention, not a separate landing veto when the same run's acceptance passed and the reviewed diff is sound. Refuses with acceptance_failed while the worker's last acceptance run failed (and acceptance_not_run while one is running or was interrupted): resume it with the failing output, land once it passes. ignoreAcceptance: true lands anyway; use it only when the user said to land regardless.
- **verify_delivery_push** — Fetch a remote branch and prove the worker's landed_head is reachable from it. This never pushes or deploys. A passing check records push_verified; cleanup eligibility may depend on this evidence.
- **cleanup_plan** — Classify managed worktrees as safe, review or blocked. The plan is read-only, expires after 15 minutes, estimates reclaimable bytes and never deletes branches, task rows, events, JSONL logs or artifacts.
- **apply_cleanup** — Remove only selected SAFE worktrees from an unexpired cleanup plan after a second proof check. Uses git worktree remove and prune only; retains the branch, task row, event stream, JSONL log and artifacts.
- **cleanup_history** — Read cleanup plan decisions and applied worktree removals, including safe/review/blocked reasons. This is audit history, not a delete command.
- **cancel_codex_worker** — Terminate a running Codex worker. Uses the in-process handle when available, otherwise the pid recorded on disk so a different MCP session can still cancel it.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "codex-supervisor-mcp": {
    "command": "npx",
    "args": ["-y","codex-supervisor-mcp"]
  }
}
```

## Documentation

## What codex-supervisor-mcp does

codex-supervisor-mcp acts as an orchestration layer between an MCP client and the Codex CLI. A primary agent can dispatch several workers, keep their work isolated, inspect their evidence, and decide which changes should enter the main branch. Each Git-backed worker normally receives a separate `codex/<taskId>` branch and worktree; workers do not commit, push, or merge on their own.

The server also supports nonstandard workspace modes. `read_only_in_place` allows inspection without edits, `scratch` is intended for network research, and `in_place_write` requires explicit authorization and path controls. Non-Git locations are not written by default.

## How it works

A typical run begins with a preflight probe using the intended workspace, base revision, sandbox, command guard, and environment contract. Once the probe passes, the main agent creates workers with goals, owned paths, setup commands, acceptance commands, limits, and optional dependencies. Overlapping `ownedPaths` can be checked before dispatch so independent tasks can run concurrently while dependent or conflicting work remains ordered.

Worker events are written to JSONL files under the supervisor data directory. Persistent work records, including Codex `thread_id` values, are stored in SQLite, allowing the supervisor to distinguish completed, failed, and lost workers after a restart. A resumed worker continues the same Codex conversation; a follow-up worker can inherit the parent task context and an appropriate branch base.

After workers finish, the main agent can inspect reports, command evidence, diffs, and event history. Acceptance commands run inside the worker worktree, and a failed acceptance prevents landing. Approved work can be landed with a supplied commit message. Delivery verification can produce a cleanup plan, while explicit cleanup is required before worktrees are removed.

## Setup and configuration

Use Node.js 22.13.0 or newer and make the `codex` executable available on `PATH`. Install the package globally with npm:

```bash
npm install -g codex-supervisor-mcp
```

The package can register itself with detected Claude Code or Codex installations when npm install scripts are enabled. Manual registration is available through either client:

```bash
claude mcp add -s user codex-supervisor -- npx -y codex-supervisor-mcp
codex mcp add codex-supervisor -- npx -y codex-supervisor-mcp
```

Restart the MCP client after registration. The optional web board starts with `codex-supervisor-web` and listens at `http://127.0.0.1:7877` by default. `SUPERVISOR_WEB_PORT` changes the port, while `SUPERVISOR_HOME` influences where state is found. A separate stage CLI can report long-running gate progress; stage details should not contain credentials or connection strings.

## Tools and capabilities

The documented tool set includes:

- `preflight_codex_worker` and `get_worker_preflight` for environment probes and command evidence.
- `create_codex_worker` and `create_codex_followup_worker` for isolated or follow-up tasks.
- `wait_codex_workers`, `check_workers`, and `overview_delta` for polling progress without returning the entire history.
- `get_worker_result` and `get_worker_diff` for comparing reported work with actual commands and changes.
- `resume_codex_worker` for continuing an existing Codex thread, optionally rebasing its worktree.
- `check_acceptance` and worker-level acceptance commands for validation before landing.
- `land_codex_worker` for committing approved changes into the integration branch.

The web board is read-only for orchestration: it displays session and worker activity but does not dispatch or cancel work. Its worker view includes summaries, reports, changes, commands, events, task instructions, and read-only side questions through a forked Codex conversation.

## Limitations and notes

The worker process depends on the Codex CLI and its configured providers. Git worktree isolation is the normal mode, while non-Git writes require explicit workspace authorization, paths, and acceptance checks. The default wait budget is capped at 60 seconds unless the host confirms that a longer wait is allowed. Main-thread changes must be committed and pushed separately when delivery requires them; landing a worker only integrates the worker's approved changes.

_Full upstream README: https://allmcps.com/mcp/codex-supervisor-mcp/readme_

