codex-supervisor-mcp 0.7.1 → 0.7.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.en.md +106 -203
- package/README.md +80 -177
- package/package.json +3 -2
- package/skills/codex-supervisor/SKILL.md +53 -131
- package/src/landing.js +33 -1
package/README.en.md
CHANGED
|
@@ -8,31 +8,33 @@ English | [中文](README.md)
|
|
|
8
8
|
[](https://github.com/zriyox/codex-supervisor-mcp/actions/workflows/ci.yml)
|
|
9
9
|
[](package.json)
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
Website [codex-supervisor.zriyo.com](https://codex-supervisor.zriyo.com) · for models [llms.txt](https://codex-supervisor.zriyo.com/llms.txt)
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
Point several agents at one repository and they overwrite each other, nobody can say who changed what, and the main thread's context fills up with worker output.
|
|
14
|
+
|
|
15
|
+
**codex-supervisor-mcp** is a Codex MCP server that takes dispatch and bookkeeping out of the model's context and puts them on disk: one main thread (Claude Code, Codex, or any MCP client) runs several Codex CLI workers at once, one Git worktree per worker, state in SQLite, a web board on top.
|
|
14
16
|
|
|
15
|
-
|
|
17
|
+

|
|
16
18
|
|
|
17
|
-
|
|
19
|
+
*30 seconds, recorded live: `create_codex_worker` ×3, three workers in their own worktrees in parallel, the main thread collects three diffs and makes one commit.*
|
|
18
20
|
|
|
19
|
-
|
|
21
|
+
## What it solves
|
|
20
22
|
|
|
21
|
-
| Problem | What
|
|
23
|
+
| Problem | What it does |
|
|
22
24
|
|---|---|
|
|
23
|
-
| Workers
|
|
24
|
-
|
|
|
25
|
+
| Workers trample each other's files | One Git worktree per worker, `ownedPaths` checked for overlap before dispatch |
|
|
26
|
+
| Worker output floods the main thread | Events go to `data/runs/<taskId>.jsonl`; reads are gated by `limit` / `maxChars` / `kinds` |
|
|
25
27
|
| One status read fills the context | `get_orchestration_overview` fits every worker into 7000 bytes |
|
|
26
|
-
| Nobody knows who is still running after a restart | `supervisor.sqlite
|
|
27
|
-
| A new session cannot pick up an old worker | `resume_codex_worker` runs `codex exec resume <thread_id
|
|
28
|
-
| "
|
|
29
|
-
|
|
|
28
|
+
| Nobody knows who is still running after a restart | `supervisor.sqlite`, one row per work, with `thread_id` |
|
|
29
|
+
| A new session cannot pick up an old worker | `resume_codex_worker` runs `codex exec resume <thread_id>`: the same Codex conversation |
|
|
30
|
+
| "Failed" and "process gone" look alike | The state machine keeps `failed` and `lost` apart |
|
|
31
|
+
| No view of where a batch is | `codex-supervisor-web`, a board that shows every worker by session |
|
|
30
32
|
|
|
31
|
-
Workers
|
|
33
|
+
Workers run `codex exec` with `model` passed through: the main thread stays on Claude, workers can run DeepSeek or any model Codex has a provider for, and the bills stay separate.
|
|
32
34
|
|
|
33
35
|
## Five minutes to a running batch
|
|
34
36
|
|
|
35
|
-
|
|
37
|
+
Prerequisites: Node.js 22.13.0 or newer, `codex` on `PATH`. macOS, Linux and Windows.
|
|
36
38
|
|
|
37
39
|
### 1. Install
|
|
38
40
|
|
|
@@ -40,37 +42,30 @@ Requirements: Node.js 22.13.0 or newer, and the `codex` CLI on `PATH`. macOS, Li
|
|
|
40
42
|
npm install -g codex-supervisor-mcp
|
|
41
43
|
```
|
|
42
44
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
```bash
|
|
46
|
-
claude mcp list | grep codex-supervisor
|
|
47
|
-
codex mcp list | grep codex-supervisor
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
If it is missing (`npx`, `--ignore-scripts` and pnpm installs skip `postinstall`), add it by hand:
|
|
45
|
+
`postinstall` installs the skill and registers the MCP. If `claude mcp list` does not show it (`npx`, pnpm and `--ignore-scripts` skip `postinstall`), add it by hand:
|
|
51
46
|
|
|
52
47
|
```bash
|
|
53
48
|
claude mcp add -s user codex-supervisor -- npx -y codex-supervisor-mcp
|
|
54
49
|
codex mcp add codex-supervisor -- npx -y codex-supervisor-mcp
|
|
55
50
|
```
|
|
56
51
|
|
|
57
|
-
Restart Claude Code / Codex
|
|
52
|
+
Restart Claude Code / Codex. Updates take care of themselves from here; see "Updating". For the skill alone: `npx skills add zriyox/codex-supervisor-mcp`.
|
|
58
53
|
|
|
59
54
|
### 2. Dispatch a batch
|
|
60
55
|
|
|
61
|
-
|
|
56
|
+
Say it in plain words in Claude Code; the skill makes it follow the right steps:
|
|
62
57
|
|
|
63
|
-
> Fill in the unit tests for these three modules
|
|
58
|
+
> Fill in the unit tests for these three modules, three codex-supervisor workers in parallel, session "unit tests".
|
|
64
59
|
|
|
65
60
|
What the main thread does underneath (you can call the tools yourself):
|
|
66
61
|
|
|
67
62
|
```
|
|
68
63
|
create_codex_worker ×3 each with session_id, session_title, ownedPaths, goal
|
|
69
|
-
wait_codex_workers two
|
|
70
|
-
get_worker_result ×3
|
|
64
|
+
wait_codex_workers two minutes by default, then a snapshot, call again until done
|
|
65
|
+
get_worker_result ×3 each worker's full report and changed files
|
|
71
66
|
```
|
|
72
67
|
|
|
73
|
-
Each worker's changes sit on its own `codex/<taskId>` branch
|
|
68
|
+
Each worker's changes sit on its own `codex/<taskId>` branch; whether and how to merge is the main thread's call.
|
|
74
69
|
|
|
75
70
|
### 3. Open the board
|
|
76
71
|
|
|
@@ -80,17 +75,11 @@ codex-supervisor-web
|
|
|
80
75
|
npx -p codex-supervisor-mcp codex-supervisor-web
|
|
81
76
|
```
|
|
82
77
|
|
|
83
|
-
Open `http://127.0.0.1:7877`. The
|
|
84
|
-
|
|
85
|
-
Which store it opens: `SUPERVISOR_HOME` from the environment if set; otherwise the nearest `.mcp.json` above the current directory, if its `codex-supervisor` entry sets `SUPERVISOR_HOME`; otherwise the default `~/.codex-supervisor`. The startup line says which one and where it came from, so running it inside the project directory is enough.
|
|
86
|
-
|
|
87
|
-
`SUPERVISOR_WEB_PORT` changes the port. A taken port (usually a board that is already running) is reported in one line and the process exits. The board does not dispatch or cancel; the ask tab starts a read-only Codex side session, described below.
|
|
78
|
+
Open `http://127.0.0.1:7877`. The state directory is `SUPERVISOR_HOME`, else the nearest `.mcp.json`, else `~/.codex-supervisor`; `SUPERVISOR_WEB_PORT` changes the port. The board only shows; it never dispatches or cancels.
|
|
88
79
|
|
|
89
80
|
## How I use it
|
|
90
81
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
I run two Claude Code sessions. One writes documents, the other dispatches. A session that writes the design and watches the workers fills its context in two hours, and mixes the judgement that goes into code with the judgement that goes into dispatch.
|
|
82
|
+
Anything that speaks MCP can be the main thread; this is just my way. I run two Claude Code sessions, one for documents and one for dispatch: a session that writes the design and watches the workers fills its context in two hours.
|
|
94
83
|
|
|
95
84
|
| Who | Where | Does what |
|
|
96
85
|
|---|---|---|
|
|
@@ -99,7 +88,7 @@ I run two Claude Code sessions. One writes documents, the other dispatches. A se
|
|
|
99
88
|
| Main-brain session | A worktree of the code repository | Read the brief, dispatch Codex workers, check every worker's diff, write results back into the brief, report to me. Writes no business code |
|
|
100
89
|
| Codex workers | Their own worktrees | One worker per step, one commit per step, build and verify on a remote machine. No push, no merge |
|
|
101
90
|
|
|
102
|
-
|
|
91
|
+
One block of text passes between the two sessions, pasted into the main-brain session and handed over with `/goal`. Its shape is fixed:
|
|
103
92
|
|
|
104
93
|
```text
|
|
105
94
|
[Role] You are the main brain: read docs and code, dispatch workers, check results, update docs, report to me. You write no business code.
|
|
@@ -132,21 +121,19 @@ resume_codex_worker when it must change something, one follow-up, amended in
|
|
|
132
121
|
land_codex_worker checked, then landed on the integration branch
|
|
133
122
|
```
|
|
134
123
|
|
|
135
|
-
The last block was 25 steps
|
|
136
|
-
|
|
137
|
-
"One worker per step, one commit per step, checked before the next" came from trying it the other way. A worker returns, the main brain reads the diff and finds step 5 wrong: it sends one `resume_codex_worker` saying what is wrong and asking for `git commit --amend` into the same commit. Same Codex thread, full context, checked again before landing. A worker that did three steps cannot be fixed this way: when step 5 is wrong, the commits for steps 6 and 7 are already on top.
|
|
124
|
+
The last block was 25 steps; the main-brain session ran it end to end with nothing in its context but the brief and each worker's report. One worker per step came from trying it the other way: when a step is wrong, one `resume_codex_worker` asks for `--amend` into the same commit and the main brain checks again before landing; a worker that did three steps cannot be fixed that way, since steps 6 and 7 already sit on top of a wrong step 5.
|
|
138
125
|
|
|
139
126
|
## What the board shows
|
|
140
127
|
|
|
141
128
|
| Where | What |
|
|
142
129
|
|---|---|
|
|
143
|
-
| Left column | One
|
|
144
|
-
| Session page |
|
|
145
|
-
| Worker
|
|
146
|
-
| Worker drawer |
|
|
147
|
-
|
|
|
130
|
+
| Left column | One row per session: title, worker count, how many running, last activity. Version and update notice at the bottom |
|
|
131
|
+
| Session page | Counts (total / running / done / failed / lost); while workers run, the command each one is on |
|
|
132
|
+
| Worker table | One row per worker: status, title, current command or last report line, duration, files changed, commands run |
|
|
133
|
+
| Worker drawer | Seven tabs: overview, report, changes, commands, events, task, side chat |
|
|
134
|
+
| Side chat | Ask the worker a question, the way Codex's `/btw` works: its thread is forked into a read-only side session, the running work is untouched. Multi-turn, stoppable, and a page that leaves picks up where it was |
|
|
148
135
|
|
|
149
|
-
|
|
136
|
+
Light and dark follow the system. No external resources.
|
|
150
137
|
|
|
151
138
|
## Tools
|
|
152
139
|
|
|
@@ -154,78 +141,53 @@ Nineteen.
|
|
|
154
141
|
|
|
155
142
|
| Tool | Arguments | What it does |
|
|
156
143
|
|---|---|---|
|
|
157
|
-
| `create_codex_worker` | `task`, `cwd`, **`ownedPaths`**, **`goal`**, `session_id`, `session_title`, `session_note`, `dependsOn`, `baseRef`, `sandbox`, `model`, `reasoningEffort`, `title`, `skipGitRepoCheck` | Start a worker. `
|
|
144
|
+
| `create_codex_worker` | `task`, `cwd`, **`ownedPaths`**, **`goal`**, `session_id`, `session_title`, `session_note`, `dependsOn`, `baseRef`, `sandbox`, `model`, `reasoningEffort`, `title`, `skipGitRepoCheck` | Start a worker. `baseRef` picks the commit the worktree is cut from (default `HEAD`); pass another worker's `codex/<id>` to build on it |
|
|
158
145
|
| `create_codex_followup_worker` | `task_id`, `followup_prompt`, `session_id`, plus the above | A new session seeded with the old worker's prompt, status and recent events |
|
|
159
146
|
| `resume_codex_worker` | `task_id`, `prompt` | Continue the same Codex conversation; `thread_id` stays |
|
|
160
|
-
| `wait_codex_workers` | `task_ids`, `mode` (any/all), `timeoutMinutes`, `timeoutMs`, `compact`, `includeEvents`, `eventLimit`, `eventMaxChars`, `eventKinds` | Wait for terminal states. Two minutes by default, then a snapshot
|
|
147
|
+
| `wait_codex_workers` | `task_ids`, `mode` (any/all), `timeoutMinutes`, `timeoutMs`, `compact`, `includeEvents`, `eventLimit`, `eventMaxChars`, `eventKinds` | Wait for terminal states. Two minutes by default, then a snapshot while the workers keep running; `compact` returns one line per worker |
|
|
161
148
|
| `get_orchestration_overview` | `status`, `limit` | Every worker in one table, capped at 7000 bytes. Carries `version` and `update` |
|
|
162
|
-
| `get_worker_result` | `task_id`, `limit`, `maxChars` | The worker's own full report plus `status` / `exit_code` / `changed_files
|
|
163
|
-
| `get_worker_diff` | `task_id`, `maxChars`, `paths` | What the worker actually changed: patches from the worktree's
|
|
149
|
+
| `get_worker_result` | `task_id`, `limit`, `maxChars` | The worker's own full report plus `status` / `exit_code` / `changed_files` |
|
|
150
|
+
| `get_worker_diff` | `task_id`, `maxChars`, `paths` | What the worker actually changed: patches from the worktree's start to its working tree, committed or not. `maxChars` bounds the answer; files past it are listed without a patch |
|
|
164
151
|
| `ask_codex_worker` | `task_id`, `question`, `timeoutMs`, `maxChars`, `fresh`, `end` | Ask the worker on the side. Its thread is forked into a read-only session with no network and no MCP tools; the worker itself is untouched. A resumed worker gets a new fork by itself, `fresh` forces one, `end` deletes it |
|
|
165
|
-
| `land_codex_worker` | `task_id`, `onto`, `commitMessage` | Cherry-pick the worker's
|
|
152
|
+
| `land_codex_worker` | `task_id`, `onto`, `commitMessage` | Cherry-pick the worker's `codex/<id>` commits onto the current branch of the directory it was dispatched from. Clean target only, a conflict rolls back. `commitMessage` first commits the worker's uncommitted edits as one commit |
|
|
166
153
|
| `get_worker_summary` | `task_id` | One paragraph: goal, status, changes, last command and message |
|
|
167
|
-
| `get_codex_worker_status` | `task_id`, `includePrompt`, `promptMaxChars` | One worker in detail
|
|
154
|
+
| `get_codex_worker_status` | `task_id`, `includePrompt`, `promptMaxChars` | One worker in detail |
|
|
168
155
|
| `get_codex_worker_events` | `task_id`, `limit`, `maxChars`, `kinds` | The raw event stream |
|
|
169
156
|
| `get_worker_goal` | `task_id` | The goal recorded at dispatch plus the native Codex goal (tokens, time) |
|
|
170
157
|
| `list_codex_workers` | `status`, `includeHistory`, `includeDetails` | List workers, active ones by default |
|
|
171
|
-
| `get_session_works` | `session_id` | Every worker of one session
|
|
172
|
-
| `describe_session` | `session_id`, `title`, `note` | Record a title and note
|
|
158
|
+
| `get_session_works` | `session_id` | Every worker of one session. The way back after a main-thread restart |
|
|
159
|
+
| `describe_session` | `session_id`, `title`, `note` | Record a title and note for a session |
|
|
173
160
|
| `search_works` | `query`, `limit` | Substring search over title / goal / prompt / last_message, newest first |
|
|
174
|
-
| `check_for_update` | `force` | Ask the registry for a newer version
|
|
175
|
-
| `cancel_codex_worker` | `task_id` | Stop a worker. Falls back to the pid
|
|
176
|
-
|
|
177
|
-
### The three things to always pass
|
|
161
|
+
| `check_for_update` | `force` | Ask the registry for a newer version |
|
|
162
|
+
| `cancel_codex_worker` | `task_id` | Stop a worker. Falls back to the pid across processes, after confirming that pid runs codex |
|
|
178
163
|
|
|
179
|
-
|
|
180
|
-
- `goal.objective`: one line on what the worker is for. The worker creates a native Codex goal from it and marks it complete when done.
|
|
181
|
-
- `session_id`: not required by the schema, but without it nothing groups the batch and neither the board nor `get_session_works` can find it again. Same value for the whole batch, and `session_title` on the first dispatch.
|
|
182
|
-
|
|
183
|
-
### Reading results without filling the context
|
|
184
|
-
|
|
185
|
-
| Want | Use | Cost |
|
|
186
|
-
|---|---|---|
|
|
187
|
-
| Status of every worker | `get_orchestration_overview` | 7000 bytes, hard cap |
|
|
188
|
-
| One worker's conclusion | `get_worker_result` | The full report, tens of thousands of characters for a big job |
|
|
189
|
-
| Alive or finished | `get_worker_summary` | A paragraph |
|
|
190
|
-
| What it did | `get_codex_worker_events` | Filter with `kinds`, bound with `limit`, clip with `maxChars` |
|
|
191
|
-
| What it actually changed | `get_worker_diff` | Capped by `maxChars`; the file list is always complete |
|
|
192
|
-
| Why it did that | `ask_codex_worker` | One answer; the fork carries the worker's whole context |
|
|
193
|
-
|
|
194
|
-
The dispatch receipt is small and does not echo the task text. `wait_codex_workers` clips `last_message` to 400 characters and `current_action` to 300; the full text is behind `get_worker_result` and `get_codex_worker_events`. That clipping is what takes a five-worker wait from tens of KB to a few KB, which matters when a client backgrounds a timed-out call and replays the result as a notification.
|
|
164
|
+
Two are required: `ownedPaths` (checked against every running worker before dispatch, overlap refuses the call, dispatch-time only) and `goal.objective` (the worker turns it into a native Codex goal). Without `session_id` nothing groups the batch; use one value for the whole batch.
|
|
195
165
|
|
|
196
166
|
## How this differs from Claude Code subagents
|
|
197
167
|
|
|
198
|
-
File isolation is not the difference:
|
|
168
|
+
File isolation is not the difference: a subagent can open a worktree too. The difference is the model and the process.
|
|
199
169
|
|
|
200
170
|
| | Claude Code subagent | codex-supervisor worker |
|
|
201
171
|
|---|---|---|
|
|
202
|
-
|
|
|
172
|
+
| Model | Claude only | `model` passed to the Codex CLI; DeepSeek works |
|
|
203
173
|
| Who does the work | Claude Code itself | A separate `codex exec` process |
|
|
204
|
-
| Two
|
|
205
|
-
| Main
|
|
174
|
+
| Two writers on one file | Worktrees keep them apart, no path declaration | `ownedPaths` overlap is refused before dispatch |
|
|
175
|
+
| Main-thread process dies | Workers die with it | `thread_id` is in sqlite; `resume_codex_worker` picks the same conversation up |
|
|
206
176
|
| Who can drive it | Claude Code only | Any MCP client |
|
|
207
|
-
|
|
|
177
|
+
| Seeing the process | Only the returned conclusion | Raw JSONL and the web board |
|
|
208
178
|
|
|
209
179
|
## The state machine
|
|
210
180
|
|
|
211
|
-
`status`
|
|
212
|
-
|
|
213
|
-
| Value | Meaning |
|
|
181
|
+
| `status` | Meaning |
|
|
214
182
|
|---|---|
|
|
215
183
|
| `queued` | Dispatched, not started |
|
|
216
|
-
| `running` | Running |
|
|
217
|
-
| `completed` |
|
|
218
|
-
| `failed` | Non-zero exit, `turn.failed`,
|
|
184
|
+
| `running` | Running. `phase`: `starting → thinking → command → editing → reporting` |
|
|
185
|
+
| `completed` | Done |
|
|
186
|
+
| `failed` | Non-zero exit, `turn.failed`, spawn failure |
|
|
219
187
|
| `cancelled` | Stopped by `cancel_codex_worker` |
|
|
220
|
-
| `lost` | Killed by an outside signal,
|
|
221
|
-
|
|
222
|
-
`phase` has a value only while `running`: `starting → thinking → command → editing → reporting`.
|
|
188
|
+
| `lost` | Killed by an outside signal, MCP process gone, or a row whose process never started. `resume_codex_worker` picks it up |
|
|
223
189
|
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
Windows has no signals. An outside kill and the process calling `exit(1)` look the same to the parent, so there it reports `failed` with the exit code.
|
|
227
|
-
|
|
228
|
-
Native Codex goal states map like this: `active` / `paused` / `blocked` are `running` (the last two land in `needs_attention`), `usageLimited` / `budgetLimited` are `failed`, `complete` is `completed`.
|
|
190
|
+
A terminal state lands in two steps: `turn.completed` sets `completed`, the process exit writes `exit_code`; `wait_codex_workers` returns only after the exit code is in. Windows has no signals, so an outside kill reports as `failed` with an exit code. Native Codex goals: `paused` / `blocked` count as `running` and go to `needs_attention`, `usageLimited` / `budgetLimited` as `failed`.
|
|
229
191
|
|
|
230
192
|
## Where state lives
|
|
231
193
|
|
|
@@ -233,42 +195,31 @@ Native Codex goal states map like this: `active` / `paused` / `blocked` are `run
|
|
|
233
195
|
|
|
234
196
|
| File | Content |
|
|
235
197
|
|---|---|
|
|
236
|
-
| `data/supervisor.sqlite` | `tasks` (one row per work), `task_events`
|
|
237
|
-
| `data/runs/<taskId>.jsonl` |
|
|
238
|
-
| `data/update-check.json` |
|
|
239
|
-
| `worktrees/<taskId>/` |
|
|
240
|
-
|
|
241
|
-
`changed_files` has three sources: Codex's `file_change` events; `git status --porcelain` in the worktree (uncommitted); `git diff --name-only <base_commit> HEAD` (committed). The last two exist because a worker editing through the shell emits no `file_change` event, and once it commits `git status` is clean again. A real batch of five did exactly that and every read came back empty. `base_commit` is recorded at dispatch; older rows fall back to the oldest reflog entry of the branch. Every git read passes `core.quotePath=false`, so non-ASCII file names come back as written instead of octal-escaped.
|
|
242
|
-
|
|
243
|
-
A 0.1.x database migrates itself the first time it is opened, without losing a row.
|
|
244
|
-
|
|
245
|
-
## Update check
|
|
246
|
-
|
|
247
|
-
When the MCP process starts it asks the npm registry which version is `latest` and what that tarball's integrity is, then compares two things with the install:
|
|
198
|
+
| `data/supervisor.sqlite` | `tasks` (one row per work), `task_events`, `sessions`, `side_sessions` / `side_turns` (side chat) |
|
|
199
|
+
| `data/runs/<taskId>.jsonl` | Raw `codex --json` output |
|
|
200
|
+
| `data/update-check.json`, `auto-update.json` | Update check and background update records |
|
|
201
|
+
| `worktrees/<taskId>/` | The worker's Git worktree |
|
|
248
202
|
|
|
249
|
-
|
|
250
|
-
- The files. A global install records the unpacked tarball's integrity in `node_modules/.package-lock.json`; if it differs from the registry's value for that version, the files on disk are not the published build and the notice says to reinstall. A git checkout has no such value and reports its commit.
|
|
251
|
-
|
|
252
|
-
Cached an hour, re-checked every six while running. An unreachable registry is not an error; the result says `source: "offline"`. The board shows the same result in the lower left. `CODEX_SUPERVISOR_NO_UPDATE_CHECK=1` turns it off, `CODEX_SUPERVISOR_REGISTRY` points at a private registry.
|
|
203
|
+
`changed_files` is the worktree's real diff, so shell edits and the worker's own commits are both visible. Non-ASCII file names come back as written. Databases from older versions migrate on first open.
|
|
253
204
|
|
|
254
205
|
## Environment variables
|
|
255
206
|
|
|
256
207
|
| Variable | Default | Effect |
|
|
257
208
|
|---|---|---|
|
|
258
|
-
| `SUPERVISOR_HOME` | `~/.codex-supervisor` | State root. The MCP and the board must
|
|
259
|
-
| `CODEX_HOME` | `~/.codex` | Read-only
|
|
260
|
-
| `CODEX_BIN` | `codex` | Path to the Codex CLI. The Windows `.cmd` shim is bypassed
|
|
209
|
+
| `SUPERVISOR_HOME` | `~/.codex-supervisor` | State root. The MCP and the board must point at the same one |
|
|
210
|
+
| `CODEX_HOME` | `~/.codex` | Read-only: the native `goals_1.sqlite` and the MCP config |
|
|
211
|
+
| `CODEX_BIN` | `codex` | Path to the Codex CLI. The Windows `.cmd` shim is bypassed |
|
|
261
212
|
| `GIT_BIN` | `git` | Path to git |
|
|
262
|
-
| `SUPERVISOR_WEB_PORT` / `SUPERVISOR_WEB_HOST` | `7877` / `127.0.0.1` |
|
|
213
|
+
| `SUPERVISOR_WEB_PORT` / `SUPERVISOR_WEB_HOST` | `7877` / `127.0.0.1` | Board address |
|
|
263
214
|
| `CODEX_SUPERVISOR_NO_UPDATE_CHECK` | unset | `1` disables the update check |
|
|
264
|
-
| `CODEX_SUPERVISOR_REGISTRY` | `https://registry.npmjs.org` | Registry for the update check |
|
|
215
|
+
| `CODEX_SUPERVISOR_REGISTRY` | `https://registry.npmjs.org` | Registry for the update check and the auto-update |
|
|
265
216
|
| `CODEX_SUPERVISOR_UPDATE_TIMEOUT_MS` | `4000` | How long to wait for the registry |
|
|
266
|
-
| `CODEX_SUPERVISOR_SKIP_SETUP` | unset | `1` skips the `postinstall` setup |
|
|
267
217
|
| `CODEX_SUPERVISOR_NO_AUTO_UPDATE` | unset | `1` turns the background auto-update off (notify only) |
|
|
268
218
|
| `CODEX_SUPERVISOR_SKIP_SKILL_SYNC` | unset | `1` turns the skill sync at server start off |
|
|
269
|
-
| `
|
|
219
|
+
| `CODEX_SUPERVISOR_SKIP_SETUP` | unset | `1` skips the `postinstall` setup |
|
|
220
|
+
| `CODEX_SUPERVISOR_NPM` | unset | npm for the auto-update; default is the one shipped with the running node |
|
|
270
221
|
|
|
271
|
-
|
|
222
|
+
GUI clients (Claude Desktop, Cursor, Windsurf) do not run `postinstall`: add this to their MCP config file, and since their `PATH` often lacks `codex`, give `CODEX_BIN` explicitly:
|
|
272
223
|
|
|
273
224
|
```json
|
|
274
225
|
{
|
|
@@ -282,124 +233,76 @@ A process started by a GUI client often has no `codex` on `PATH`; set `CODEX_BIN
|
|
|
282
233
|
}
|
|
283
234
|
```
|
|
284
235
|
|
|
285
|
-
##
|
|
286
|
-
|
|
287
|
-
### GUI clients
|
|
288
|
-
|
|
289
|
-
GUI clients do not run `postinstall`; add the JSON above to the config file:
|
|
290
|
-
|
|
291
|
-
| Client | macOS | Windows | Linux |
|
|
292
|
-
|---|---|---|---|
|
|
293
|
-
| Claude Desktop | `~/Library/Application Support/Claude/claude_desktop_config.json` | `%APPDATA%\Claude\claude_desktop_config.json` | `~/.config/Claude/claude_desktop_config.json` |
|
|
294
|
-
| Cursor | `~/.cursor/mcp.json` | `%APPDATA%\Cursor\mcp.json` | `~/.config/cursor/mcp.json` |
|
|
295
|
-
| Windsurf | `~/.codeium/windsurf/mcp_config.json` | `%APPDATA%\Codeium\windsurf\mcp_config.json` | `~/.config/.codeium/windsurf/mcp_config.json` |
|
|
296
|
-
|
|
297
|
-
### Running the setup again
|
|
298
|
-
|
|
299
|
-
```bash
|
|
300
|
-
codex-supervisor-setup # detect clients, install the skill, register the MCP
|
|
301
|
-
codex-supervisor-setup --target claude,codex
|
|
302
|
-
codex-supervisor-setup --skill-only
|
|
303
|
-
codex-supervisor-setup --mcp-only
|
|
304
|
-
codex-supervisor-setup --dry-run # print the plan only
|
|
305
|
-
```
|
|
306
|
-
|
|
307
|
-
An existing skill with different content is backed up to `SKILL.md.bak-<timestamp>` before it is overwritten.
|
|
308
|
-
|
|
309
|
-
### Upgrading
|
|
236
|
+
## Updating
|
|
310
237
|
|
|
311
|
-
Nothing to do by hand.
|
|
238
|
+
Nothing to do by hand. At start the server asks the registry in the background; a newer version is installed by a detached `npm i -g` into the same global path, the running session is untouched and the next session starts on it. Only a copy that `npm i -g` installed is touched; a git checkout or an `npx` copy is left alone. The skill does the same: every start copies it into the existing skill directories, backing up an edited file as `SKILL.md.bak-<timestamp>`.
|
|
312
239
|
|
|
313
|
-
|
|
240
|
+
When the install fails (a global directory that needs sudo) the `update` field says why and `npm install -g codex-supervisor-mcp@latest` by hand still works. Versions up to 0.6.1 only notify; upgrade by hand once and it is automatic from then on. A Node version switch breaks the registered path: `claude mcp remove -s user codex-supervisor`, `codex mcp remove codex-supervisor`, reinstall. To run the setup again: `codex-supervisor-setup` (`--skill-only` / `--mcp-only` / `--dry-run`).
|
|
314
241
|
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
```bash
|
|
318
|
-
npm install -g codex-supervisor-mcp@latest
|
|
319
|
-
```
|
|
320
|
-
|
|
321
|
-
Versions up to 0.6.1 only notify and never install. Coming from one of those, upgrade by hand once; after that it is automatic. No re-registration needed.
|
|
322
|
-
|
|
323
|
-
Manual-update pitfalls:
|
|
324
|
-
|
|
325
|
-
- The registry takes a few minutes to move `latest` after a publish. If the version did not change, wait, or pin the version.
|
|
326
|
-
- Switching Node versions breaks the registered absolute path. Run `claude mcp remove -s user codex-supervisor` and `codex mcp remove codex-supervisor` first, then install.
|
|
327
|
-
- The skill takes care of itself: every server start copies the bundled skill into whichever of `~/.claude/skills/`, `~/.agents/skills/` and `~/.codex/skills/` already exist, backing up a differing file as `SKILL.md.bak-<timestamp>`. A session that already loaded the skill sees the new text only after loading it again. `CODEX_SUPERVISOR_SKIP_SKILL_SYNC=1` turns the sync off.
|
|
328
|
-
|
|
329
|
-
### Uninstall
|
|
242
|
+
Uninstall:
|
|
330
243
|
|
|
331
244
|
```bash
|
|
332
245
|
npm uninstall -g codex-supervisor-mcp
|
|
333
246
|
claude mcp remove -s user codex-supervisor
|
|
334
247
|
codex mcp remove codex-supervisor
|
|
335
|
-
rm -rf ~/.claude/skills/codex-supervisor ~/.agents/skills/codex-supervisor ~/.codex/skills/codex-supervisor
|
|
336
|
-
rm -rf ~/.codex-supervisor
|
|
248
|
+
rm -rf ~/.claude/skills/codex-supervisor ~/.agents/skills/codex-supervisor ~/.codex/skills/codex-supervisor ~/.codex-supervisor
|
|
337
249
|
```
|
|
338
250
|
|
|
339
|
-
|
|
251
|
+
## Windows
|
|
340
252
|
|
|
341
|
-
- The npm-installed CLI is `codex.cmd`,
|
|
342
|
-
- Cross-process cancel
|
|
343
|
-
-
|
|
253
|
+
- The npm-installed CLI is `codex.cmd`, which Node refuses to spawn directly. The runner steps over it to `node_modules/@openai/codex/bin/codex.js` and runs that with `node`; no `shell: true`, which would leave only the shell killable on cancel.
|
|
254
|
+
- Cross-process cancel uses `taskkill /PID <pid> /T /F` for the whole tree, after confirming that pid runs codex.
|
|
255
|
+
- Besides `PATH`, `%APPDATA%\npm`, `%LOCALAPPDATA%\pnpm`, `%LOCALAPPDATA%\Volta\bin` and `%ProgramFiles%\nodejs` are probed.
|
|
344
256
|
|
|
345
|
-
|
|
257
|
+
## Troubleshooting
|
|
346
258
|
|
|
347
259
|
| Symptom | Cause | Fix |
|
|
348
260
|
|---|---|---|
|
|
349
261
|
| Not in `claude mcp list` | The install method skipped `postinstall` | `codex-supervisor-setup`, or `claude mcp add` by hand |
|
|
350
262
|
| Dispatch says `codex only resolved to a shell shim` | Windows found only the `.cmd`; the package entry behind it is gone | Reinstall `@openai/codex`, or point `CODEX_BIN` at `codex.js` |
|
|
351
|
-
| Worker
|
|
263
|
+
| Worker `failed` at once with `spawn codex ENOENT` | No codex on the process `PATH` | Set `CODEX_BIN` in the config |
|
|
352
264
|
| `Cannot find module 'node:sqlite'` | Node older than 22.13.0 | Upgrade Node |
|
|
353
|
-
| Worker
|
|
265
|
+
| Worker `lost` | The MCP process was killed and took the worker with it | `resume_codex_worker` |
|
|
266
|
+
| Worker reports `git add` failing with `index.lock: Operation not permitted` | The default sandbox keeps `.git` read-only | `land_codex_worker` with `commitMessage`, or dispatch with `danger-full-access` |
|
|
354
267
|
| `ownedPaths overlap with active worker(s)` | Two workers claimed the same paths | Split differently, or cancel the one holding them |
|
|
355
|
-
| The board is empty | The board and the MCP use different `SUPERVISOR_HOME`s | Start it inside
|
|
356
|
-
| `port 7877 ... is already in use` | A board is already running | Open
|
|
268
|
+
| The board is empty | The board and the MCP use different `SUPERVISOR_HOME`s | Start it inside the project with the `.mcp.json`, or pass the same `SUPERVISOR_HOME` |
|
|
269
|
+
| `port 7877 ... is already in use` | A board is already running | Open it, or start another with `SUPERVISOR_WEB_PORT=8080` |
|
|
357
270
|
|
|
358
271
|
## Known limitations
|
|
359
272
|
|
|
360
|
-
- A worker is a child of the MCP process. Kill the MCP and the worker goes with it, settled as `lost
|
|
361
|
-
- In the default `workspace-write` sandbox a worker cannot commit
|
|
362
|
-
- The worktree is cut from a commit
|
|
363
|
-
- Only the working directory is isolated. Temp directories, databases and ports are shared
|
|
364
|
-
- `ownedPaths` is checked at dispatch only; it does not stop a worker from creating
|
|
365
|
-
- It
|
|
366
|
-
-
|
|
367
|
-
-
|
|
368
|
-
- `search_works` is substring matching. Fine at hundreds of rows; revisit at tens of thousands.
|
|
273
|
+
- A worker is a child of the MCP process. Kill the MCP and the worker goes with it, settled as `lost`; its worktree and `thread_id` survive and `resume_codex_worker` picks it up. Keeping it alive across that takes a resident daemon; see the Roadmap.
|
|
274
|
+
- In the default `workspace-write` sandbox a worker cannot commit (Codex keeps `.git` read-only). Either `land_codex_worker` with `commitMessage` commits for it, or dispatch with `danger-full-access`.
|
|
275
|
+
- The worktree is cut from a commit; uncommitted work in your checkout is not in it.
|
|
276
|
+
- Only the working directory is isolated. Temp directories, databases and ports are shared.
|
|
277
|
+
- `ownedPaths` is checked at dispatch only; it does not stop a worker from creating files outside its list. Read the diff.
|
|
278
|
+
- It knows "finished", not "correct". Acceptance is the main thread's job.
|
|
279
|
+
- One `wait_codex_workers` cannot wait to the end; the client's MCP tool timeout is a hard wall. Call it again.
|
|
280
|
+
- `search_works` is substring matching, fine for hundreds of works.
|
|
369
281
|
|
|
370
282
|
## Roadmap
|
|
371
283
|
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
6. ~~`session_id` + `get_session_works`~~ ✅
|
|
378
|
-
7. ~~`search_works`~~ ✅
|
|
379
|
-
8. ~~Native worker goals~~ ✅
|
|
380
|
-
9. ~~Windows~~ ✅
|
|
381
|
-
10. ~~Web board~~ ✅
|
|
382
|
-
11. ~~Session titles, update check, `baseRef`, committed changes visible~~ ✅
|
|
383
|
-
12. ~~Collecting work: `get_worker_diff` / `ask_codex_worker` / `land_codex_worker`; background auto-update~~ ✅
|
|
384
|
-
13. Resident daemon: move dispatch and process lifetime out of the MCP process
|
|
385
|
-
|
|
386
|
-
Not planned: vector search (substring matching is faster at this scale and costs nothing to maintain), `usage_count` ordering (2 of 80 real works were ever referenced again), a layered memory index (not enough data to need one).
|
|
284
|
+
Done: `CODEX_BIN` / `SUPERVISOR_HOME` / `GIT_BIN`; `status` and `phase` split; `ownedPaths` / `goal` / `dependsOn`; `thread_id` on disk + `resume_codex_worker`; concurrency and multi-process writes; `session_id`, `search_works`, native goals; Windows; the web board; `baseRef`; collecting work with `get_worker_diff` / `ask_codex_worker` / `land_codex_worker`; background auto-update.
|
|
285
|
+
|
|
286
|
+
Next: a resident daemon, moving dispatch and process lifetime out of the MCP process.
|
|
287
|
+
|
|
288
|
+
Not planned: vector search (substring matching is faster at this scale and costs nothing to maintain), `usage_count` ordering (2 of 80 real works were ever referenced again).
|
|
387
289
|
|
|
388
290
|
## Development
|
|
389
291
|
|
|
390
292
|
```bash
|
|
391
293
|
npm install
|
|
392
|
-
npm test #
|
|
393
|
-
npm run test:edge # test/edge only
|
|
394
|
-
npm run test:real # end to end
|
|
395
|
-
npm run
|
|
396
|
-
npm run
|
|
397
|
-
npm run web:install # board dependencies
|
|
398
|
-
npm run web:dev # board with hot reload, /api proxied to 7877
|
|
399
|
-
npm run web:build # bundle into web/dist; runs before publish
|
|
294
|
+
npm test # fake-codex replay, fast and deterministic
|
|
295
|
+
npm run test:edge # test/edge only
|
|
296
|
+
npm run test:real # end to end against the real codex CLI
|
|
297
|
+
npm run web:dev # board development, /api proxied to 7877
|
|
298
|
+
npm run web:build # bundle to web/dist, runs before npm publish
|
|
400
299
|
```
|
|
401
300
|
|
|
402
|
-
|
|
301
|
+
CI runs Ubuntu / macOS / Windows, plus a Node 22.13.0 job that pins the `engines` floor.
|
|
302
|
+
|
|
303
|
+
## Contributing
|
|
304
|
+
|
|
305
|
+
See [CONTRIBUTING.en.md](CONTRIBUTING.en.md). Security issues go through the [private advisory form](https://github.com/zriyox/codex-supervisor-mcp/security/advisories/new); see [SECURITY.md](SECURITY.md).
|
|
403
306
|
|
|
404
307
|
## License
|
|
405
308
|
|