codex-supervisor
The codex-supervisor is a local Model Context Protocol (MCP) bridge that lets a compatible host manage, monitor, and control Codex app-server tasks within allowed local repositories.
Start and resume tasks:
codex_startlaunches a new thread with configurable sandbox, network access, and approval policy.codex_sendresumes an existing thread with a new turn when none is active.Steer in-flight turns:
codex_steerappends guidance to an active turn without creating a new one.Monitor progress:
codex_statusreads thread state, events, diffs, and pending requests.codex_waitlong-polls until completion, failure, interruption, or approval.codex_interruptcancels an active turn.Inspect threads:
codex_list_threadsbrowses persisted threads within allowed roots (with pagination/search).codex_read_threadretrieves full details including turn history.Handle approvals:
codex_list_approvalsinspects pending command-execution and file-change requests.codex_resolve_approvalaccepts, declines, accepts-for-session, or cancels requests.Security: Enforces allowed repository roots, blocks symlink escapes, restricts network access unless explicitly enabled, and offers read-only or workspace-write sandbox modes.
Remote access: Includes an optional Hostinger-compatible relay for ChatGPT desktop or IDE extensions with OAuth authentication.
Supports Auth0 as an external identity provider to validate RS256 OAuth access tokens on the public /mcp endpoint.
Adds a Hostinger-compatible remote relay that exposes the MCP server through a public /mcp endpoint, enabling ChatGPT remote MCP access via queued jobs and an outbound Windows local agent.
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., "@codex-supervisor Use codex_start in /home/user/project to implement the feature, then wait and approve."
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.
Codex Supervisor MCP
A local Model Context Protocol (MCP) bridge that lets a compatible host start, monitor, steer, interrupt, resume, and approve Codex app-server work.
It wraps codex app-server; it does not automate a terminal UI or scrape an IDE.
Capabilities
The server exposes these MCP tools:
Tool | Purpose |
| Start a new Codex thread and turn in an allowed repository. |
| Send a new instruction after the active turn is idle. |
| Append guidance to the active turn. |
| Read thread state, recent events, the latest agent message, diff, and pending requests. |
| Long-poll until completion, failure, interruption, or an approval request. |
| Interrupt an active turn. |
| List persisted threads inside configured roots. |
| Read a persisted authorized thread. |
| Inspect pending app-server requests. |
| Accept, decline, or cancel command-execution and file-change approvals. |
Related MCP server: Codex Bridge MCP
Requirements
Node.js 22 or newer.
A current Codex CLI available as
codex.Codex CLI authentication already configured.
One or more explicit local repository roots.
This project has no npm runtime dependencies.
Verify the package
npm testThe test suite uses a protocol-compatible mock app-server. It does not make model requests or require Codex authentication.
Install with the Codex CLI
Use the MCP server name codex-supervisor. The name must match
CODEX_SUPERVISOR_MCP_NAME; the bridge uses it to prevent the child
app-server from loading this same MCP server recursively.
macOS or Linux
codex mcp add codex-supervisor \
--env CODEX_ALLOWED_ROOTS="/Users/you/code:/Users/you/work" \
--env CODEX_SUPERVISOR_MCP_NAME="codex-supervisor" \
-- node "/absolute/path/to/codex-supervisor-mcp/src/index.mjs"Use the platform path-list delimiter between roots. On macOS and Linux it is
a colon (:).
Windows PowerShell
codex mcp add codex-supervisor `
--env CODEX_ALLOWED_ROOTS="C:\src;D:\work" `
--env CODEX_SUPERVISOR_MCP_NAME="codex-supervisor" `
-- node "C:\absolute\path\to\codex-supervisor-mcp\src\index.mjs"On Windows the path-list delimiter is a semicolon (;).
Confirm the registration:
codex mcp listIn Codex, type /mcp to inspect the connected server.
Install with config.toml
Copy and adapt examples/config.toml, then place its contents in
~/.codex/config.toml or a trusted project's .codex/config.toml.
Use absolute paths. Keep the server id and
CODEX_SUPERVISOR_MCP_NAME identical.
ChatGPT desktop or the Codex IDE extension
Open Settings → MCP servers → Add server.
Set the name to
codex-supervisor.Select STDIO.
Set the command to
node.Add the absolute path to
src/index.mjsas the only argument.Add
CODEX_ALLOWED_ROOTSandCODEX_SUPERVISOR_MCP_NAME=codex-supervisor.Save and restart the host.
Type
/mcpto verify the tools.
Local STDIO MCP servers are not loaded by ordinary ChatGPT web chats. Using this bridge from the web requires a separately deployed, authenticated remote MCP service or hosted plugin.
Typical workflow
Ask the MCP host to:
Use codex_start in /absolute/path/to/repository to implement the requested
change. Use workspaceWrite, keep network access disabled, wait for progress,
show me every approval request before resolving it, and report the final diff
and test result.The host should follow this sequence:
codex_start -> codex_wait
approval request -> inspect -> codex_resolve_approval -> codex_wait
active correction -> codex_steer -> codex_wait
completed -> codex_status
later follow-up -> codex_send -> codex_waitEvery start/send/steer/interrupt call returns an eventCursor. Pass it as
afterSequence to codex_wait or codex_status to avoid replaying older
events.
approvalPolicy accepts the current app-server wire values on-request
(default) and untrusted. The legacy values onRequest and unlessTrusted
are accepted by the bridge and normalized before the app-server request.
The public approval API accepts decline even when a Codex app-server release
advertises only cancel for the request. In that case the bridge uses the safe
app-server cancellation response and reports both the requested and effective
decisions.
Configuration
Variable | Default | Meaning |
| Required | Repository roots separated by the platform path-list delimiter. |
|
| Native Codex executable path. Windows |
|
| MCP config id disabled in the nested app-server to prevent recursion. |
|
| Set to |
|
| In-memory event count, clamped to 100–10,000. |
|
| Set to |
| Internal safe default | Advanced JSON array replacing every argument passed to |
The default app-server arguments are equivalent to:
-c mcp_servers.<CODEX_SUPERVISOR_MCP_NAME>.enabled=false app-serverOverriding CODEX_APP_SERVER_ARGS removes that recursion guard. Include an
equivalent disable override yourself.
Security model
CODEX_ALLOWED_ROOTSis mandatory.Paths are canonicalized with
realpath; symlink escapes are rejected.Codex receives restricted read access to the selected repository and platform defaults.
workspaceWritelimits writable roots to the selected repository.dangerFullAccessis not exposed.Network access requires both
CODEX_ALLOW_NETWORK=1andnetworkAccess: trueon a task.The bridge has no generic, unsandboxed shell tool.
Command and file-change approvals must be resolved explicitly.
Threads outside allowed roots are denied or filtered.
Event payloads are size-bounded before storage.
Stored thread paths are re-canonicalized at use time; deleted or replaced repository paths fail closed.
Same-thread mutations, approval responses, and retried remote calls are serialized or deduplicated rather than executed twice.
Transport errors are recursively redacted and size-bounded before they cross STDIO or HTTP boundaries.
Relay and remote-server credentials (
BIOTELE_*andCODEX_REMOTE_*) are removed from the child Codex environment.Remote result submissions are HMAC-authenticated, base64url encoded, split into bounded chunks, and verified by length and SHA-256 before use. Encoding protects the transport from content filters; it is not encryption.
The child app-server still inherits non-relay process settings and your broader Codex configuration. Audit other environment secrets, apps, skills, hooks, and configured MCP servers before using it with untrusted code. Environment stripping is not an operating-system security boundary: a child running as the same Windows user can deliberately query user-scoped settings. Use a dedicated Windows account if that threat is in scope.
Supported approval requests
This release resolves:
item/commandExecution/requestApprovalitem/fileChange/requestApproval
Other app-server requests remain visible through codex_status and
codex_list_approvals, but the bridge refuses to answer them. This prevents
a generic response endpoint from silently granting permissions or supplying
sensitive user input.
Persistence and monitoring
Codex owns persisted thread history. The bridge keeps streamed event buffers,
latest deltas, and pending request state in memory. Restarting the MCP server
clears that transient state, but codex_list_threads and
codex_read_thread can recover authorized persisted threads.
Development
npm test
node --check src/index.mjsProject layout:
src/app-server-client.mjs Codex app-server JSONL client
src/approval-policy.mjs Approval-policy validation and legacy normalization
src/event-store.mjs Bounded event, turn, and approval state
src/security.mjs Repository-root policy
src/supervisor-service.mjs Codex lifecycle orchestration
src/tool-registry.mjs MCP tool schemas and validation
src/mcp-server.mjs Dual-era MCP STDIO transport
src/index.mjs Entrypoint
test/ Unit and integration testsLicense
MIT
Codex App Server compatibility
Version 1.0.3 removes the deprecated readOnly.access and
workspaceWrite.readOnlyAccess fields from turn/start. Current Codex App
Server releases use permission profiles when a client needs custom restricted
read scopes. The supervisor continues to restrict writable roots to the selected
repository and validates every task directory against CODEX_ALLOWED_ROOTS.
Hostinger remote relay
Version 1.2.5 provides a Hostinger-compatible relay for ChatGPT remote MCP access:
ChatGPT -> OAuth bearer JWT -> Hostinger /mcp -> namespace-routed queue
codex_* -> outbound Windows local-agent -> Codex app-server
reeves_* -> outbound Reeves Android agent -> accessibility serviceThe public /mcp endpoint validates RS256 OAuth access tokens from an external
identity provider. The Windows and Reeves agents use independent HMAC
credentials only for outbound polling, status, lease acquisition, and result
submission. The
Hostinger relay never starts Codex and never reads local repositories.
The hosted relay keeps all existing codex_* tools and additionally exposes
reeves_status, reeves_tap, reeves_swipe, reeves_type, reeves_back,
reeves_home, reeves_recents, reeves_sequence, and reeves_screenshot. The local STDIO Codex
registry remains Codex-only. Agent claims are filtered by authenticated key ID;
client-supplied routing fields are ignored.
reeves_screenshot returns Android pixels as a standard MCP image content
block (image/png with base64 data) together with width, height, capture
timestamp, agent id, and byte-length metadata. The Android agent uses the
relay-advertised chunked result protocol, so no unusable Android-local path is
exposed and each signed HTTP request remains within the relay body limit.
reeves_sequence sends 1 through 50 ordered device actions in one routed job.
Android executes tap, swipe, type, Back, Home, Recents, wait, and screenshot
actions locally, stops on the first error by default, and returns one final MCP
image by default. Results include indexed action outcomes and additive,
secret-free relay/Android stage timings. The existing 25-second agent request
is a wake-on-enqueue long poll, not a pickup delay; Android immediately starts
another claim after each successful result submission and reuses one OkHttp
connection pool.
This release also negotiates a supported MCP protocol version, issues a bounded OAuth-subject-bound session, and requires that session on follow-up requests. Retried tool calls are bound to the OAuth subject, MCP session, typed JSON-RPC id, and request hash; terminating a session invalidates its cached or pending work. The release also cleans up cancelled relay work and crashed app-server state, revalidates authorized paths, isolates per-thread events, and redacts bounded nested error data at every public transport.
Version 1.2.5 also reconciles codex_status.latestAgentMessage with the
authorized persisted transcript. Fully persisted external Codex completions,
including synthesized rollout-* turns, now replace stale bridge-observed
messages while incomplete or interrupted transcript tails remain excluded.
Deploy the updated relay before updating the Windows agent. The new relay still accepts legacy one-shot results, while the new agent uses the chunked format only after the relay advertises support.
See docs/REMOTE_DEPLOYMENT.md for Hostinger hPanel
steps, DNS for mcp.biotele.mx, Auth0 setup, Microsoft Entra ID setup,
ChatGPT web connector setup and recovery, environment variables, local-agent
installation, and the threat model.
Available Tools
10 toolscodex_interruptInterrupt Codex turnADestructiveIdempotent
Request cancellation of an active Codex turn.
Inputs: threadId (required), turnId.
codex_list_approvalsList Codex approvalsARead-onlyIdempotent
List pending app-server requests. This release resolves command-execution and file-change approval requests; unsupported request types remain visible.
Inputs: threadId.
codex_list_threadsList Codex threadsARead-onlyIdempotent
List persisted Codex threads whose working directories are inside CODEX_ALLOWED_ROOTS. Results outside those roots are filtered.
Inputs: cwd, limit, cursor, searchTerm.
codex_read_threadRead Codex threadARead-onlyIdempotent
Read a persisted authorized Codex thread. The bridge denies threads outside CODEX_ALLOWED_ROOTS.
Inputs: threadId (required), includeTurns.
codex_resolve_approvalResolve Codex approvalADestructive
Explicitly accept, accept for the session, decline, or cancel a pending Codex command-execution or file-change approval.
Inputs: decision (required), requestKey (required).
codex_sendSend new Codex turnADestructive
Resume an authorized Codex thread when necessary and start a new turn. Use only when no turn is active; use codex_steer for an in-flight turn.
Inputs: prompt (required), threadId (required), cwd, model, +4 more.
codex_startStart Codex taskADestructive
Start a new Codex app-server thread and immediately begin a turn in an allowed local repository. Return threadId, turnId, and an event cursor for codex_wait or codex_status.
Inputs: cwd (required), prompt (required), model, effort, +3 more.
codex_statusRead Codex statusARead-onlyIdempotent
Read a thread snapshot, current turn state, pending approvals, latest agent message, latest diff, and recent streamed events.
Inputs: threadId (required), maxEvents, includeTurns, afterSequence.
codex_steerSteer active Codex turnADestructive
Append guidance to the currently active turn without creating another turn. Supply expectedTurnId when available to prevent steering the wrong turn.
Inputs: prompt (required), threadId (required), expectedTurnId.
codex_waitWait for Codex progressARead-onlyIdempotent
Long-poll an active turn until it completes, fails, requests approval, is interrupted, or reaches the timeout. Continue with the returned eventCursor.
Inputs: threadId (required), maxEvents, timeoutMs, afterSequence.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 10 tools
Each tool targets a distinct lifecycle moment: start/send create or resume turns, steer mutates an active turn, status/wait/read observe, interrupt cancels, and approvals have dedicated list/resolve tools. Potentially overlapping pairs like send vs steer and status vs read_thread are explicitly disambiguated in their descriptions.
All tools share the codex_ prefix and use clear action-oriented verbs, with verb_noun forms for list/read/resolve operations. The naming is consistent, predictable, and uniformly snake_case.
10 tools is well-scoped for a Codex supervisor, covering turn lifecycle, observation, thread inspection, and approval handling without unnecessary redundancy. Each tool has a clear role in the workflow.
The surface covers the core workflow: starting, resuming, steering, observing, waiting on, interrupting, and listing threads, plus approval management. Minor gaps exist around deleting threads or resolving unsupported approval types, but agents can complete primary supervision tasks.
Maintenance
Related MCP Connectors
MCP server for mandates, delegation, policy-gated execution, credential grants, and audit.
MCP server for your apps' tools and custom tools, plus hosted AI agents and approval-gated workflows
Remote MCP server exposing your Node Command fleet (files, shell, processes, browser) to AI hosts.
Guarded MCP server for agent-readable business truth, provenance, readiness, and discovery.
Related MCP Servers
- AlicenseBqualityFmaintenanceAn MCP server that exposes the local Grok CLI to Codex for bounded repo work, reviews, rescue analysis, adversarial checks, session listing/export, and background job management while keeping Codex hidden context out of scope.121MIT
- AlicenseNot gradedqualityDmaintenanceCodex Bridge MCP is a local MCP orchestration service for a stable Claude Code x Codex CLI development workflow.22 npm2MIT
- FlicenseBqualityFmaintenanceProduction-oriented MCP gateway for managing Codex through a persistent codex app-server process, supporting threads, autonomous goals, approvals, and HTTP/stdio transports.202-
- AlicenseAqualityBmaintenanceLocal MCP bridge that lets Codex operate local Claude Code sessions, including listing, starting, resuming, forking, prompting, and stopping conversations via the Remote Control CLI.14MIT