Codex Orchestrator
Orchestrates OpenAI Codex CLI runs for code review, implementation, and integration using ChatGPT Plus authentication, with model/reasoning profiles, quota tracking, and isolated verification.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Codex Orchestrator (for Google Antigravity + ChatGPT Plus)
English | 简体中文
Zero-dependency Node.js orchestrator, independent verifier, and Google Antigravity Plugin that lets Antigravity safely orchestrate OpenAI Codex CLI (using your existing ChatGPT Plus subscription, no extra API key required).
Instead of blindly trusting model self-reports or granting unrestricted disk access, every delegation runs through an isolated git worktree, an independent filesystem-vs-baseline audit, snapshot verification, transactional allowlist patching, and a real cross-module integration gate.
Architecture
Antigravity (Planner / Verifier / Integrator)
│ uses Skill + thin stdio MCP (`src/mcp-adapter.mjs`, timeoutSeconds: 960)
▼
Core Runner & Guards (`src/*.mjs`)
├─ M1 Registry & Path Guard : project whitelist, git toplevel check, NTFS junction/ADS guard
├─ M2 Workspace Manager : atomic run_token locks, disabled git hooks, detached worktree
├─ M3 Codex Runner : direct binary spawn, UTF-8 stdin, `--ignore-user-config`, process-tree kill
├─ M4 Verifier & Patch Applier : filesystem-vs-baseline audit, snapshot test run, wx create + rollback
└─ M5 Integration Gate : full-tree content digest + real cross-module smoke/integration testsWhy --ignore-user-config --ignore-rules?
When Codex CLI runs on a machine that also has the Codex Desktop App installed, default invocations inherit desktop MCP servers and memory stores outside the CLI sandbox. Passing --ignore-user-config --ignore-rules -c windows.sandbox="elevated" -c forced_login_method="chatgpt" keeps your ChatGPT Plus OAuth login while isolating each worker run cleanly.
Related MCP server: codex-antigravity-mcp
Prerequisites
Node.js
>= 20(tested on Nodev26.8.1).Git (on Windows, portable MinGit or Git for Windows works).
OpenAI Codex CLI (
npm install -g @openai/codex) logged in with your ChatGPT Plus account (codex login).
Quick Start (3 Steps on Any Machine)
git clone <your-repo-url> codex-orchestrator
cd codex-orchestrator
# 1. Auto-detect node/git/codex, generate local config/*.json, and install the Antigravity Plugin
node scripts/setup.mjs
# 2. Register a Git repository you want Antigravity + Codex to work on
# (Add `--shared-dep node_modules` so isolated verification snapshots can copy local dependencies)
node scripts/setup.mjs register my-app /path/to/my-app --modes review,implement,integrate --shared-dep node_modules
# 3. Verify environment & tests
node scripts/setup.mjs doctor
npm testNote: Local machine files (
config/runtime.json,config/projects.json,state/,scratch/) are gitignored so your personal paths and task logs are never committed. Templates live inconfig/runtime.example.jsonandconfig/projects.example.json.
Capability Profiles, Model Catalog, Quota Cooldown & Auth Fallback (v1.3)
Dynamic Codex Model Catalog & Aliases (
codex_list_models/node src/cli.mjs models): Queriescodex debug models(with automatic--bundledfallback) so any model supported by your Codex CLI / ChatGPT account (gpt-6.2-sol,gpt-6.2-astra,gpt-6.1-terra,gpt-6-luna, etc.) can be inspected and selected dynamically viamodelor shorthandmodel_aliases(sol,astra,terra,luna).Separated Review vs. Execution Routing, Strict
deepGuard & L4 Escalation (light|standard|deep): Profiles distinguish the review layer (codex_review:light/standard=gpt-6.2-astramedium,deep=gpt-6.2-astrahigh) from the execution layer (codex_implement:light=gpt-6.2-solhigh,standard=gpt-6.2-solxhigh,deep=gpt-6.2-astramedium). Heavydeepruns are capped atquota.max_deep_runs_24h(default4per 24h), while routineastra/mediumreviews do not consume the heavydeepcap. Elevated combinations (gpt-6.2-astra+xhighor any model atmax) anddeepruns beyond the 24h budget require explicit user approval via a local CLI order with--approve-elevated.ultraremains hard-blocked by policy.Quota Circuit Breaker & 24h Tracking:
state/quota_state.jsontracks 24h token usage (includingmodelandreasoning_effort) and arms a temporary ChatGPT cooldown when429 / rate_limitedoccurs (cooldown_blocked: trueshort-circuits repeat hits). Unsupported model errors returnmodel_unsupportedwithout consuming code retries. Inspect or clear early with:node src/cli.mjs models node src/cli.mjs quota node src/cli.mjs quota --resetPer-Task Launch Cap & Allowed Profiles (
quota.max_launches_per_task,quota.allowed_profiles,order.max_launches): Optional hard boundaries inconfig/runtime.json(both default tonullfor backward compatibility). Whenmax_launches_per_taskororder.max_launchesis set (e.g.1), initial runs, reworks, and API fallbacks share one atomically persisted launch counter per task, while duplicate non-rework submissions stay idempotent without double-counting. Whenallowed_profilesis set (e.g.["light", "standard"]), disallowed profiles and out-of-band model/effort overrides are rejected before spawning Codex.Compact Return Summaries & Per-Attempt Log Index (
compact: true/status --attempt <id>):codex_review,codex_implement,codex_status, and CLIrun --compact/status --compactcan return a deterministic, locally generated compact summary (with first actionable error, file locations, anddetail_ref) without invoking an extra model. Every attempt (1.1,1.2,2.1,v1, ...) persists its sanitized detail JSON understate/tasks/<task_id>.attempts/so historical runs stay independently readable viacodex_status(task_id, attempt_id)even after rework.Account Window Calibration & Multi-Milestone Estimation (
codex_estimate_usage/node src/cli.mjs estimate <spec.json> [--live-account]): Queriescodex app-serveraccount/rateLimits/read(stripping all account identifiers) to sample 5-hour (primary) and 7-day (secondary) ChatGPT Plus window deltas across natural work orders (quota.sample_account_window: true), excluding cross-reset, API-fallback, and overlapping-task samples. Supports both single-order and multi-milestone project estimates (completable_milestones,first_bottleneck_stage,account_quota_status: sufficient|tight|insufficient|unknown), plus chronological leave-future-out backtesting.Tier 3 API Key Fallback Switch (Opt-In, Disabled by Default):
config/runtime.example.jsondefaults toauth: { primary: "chatgpt", allow_api_key_fallback: false, api_key_env_var: "OPENAI_API_KEY" }so ChatGPT Plus users never incur unexpected API billing. Maintainers or CI users who want automatic API fallback can setallow_api_key_fallback: trueand exportOPENAI_API_KEY.
Verification permissions
For MCP implementation and integration, register the exact executable and arguments of each approved check in the local project entry in config/projects.json. For example, add "mcp_check_argv": [["<absolute-node-executable>", "--test", "tests/contract.test.mjs"]] and list the same executable in allowed_command_bins. Read-only review works without a registered command. After running project registration again, check the local entry before dispatching work.
Verification commands run as the orchestrator's Windows user. Their scripts, imports and candidate code require your trust. Use an isolated, least-privileged Windows environment for untrusted projects. A temporary working directory limits accidental edits and does not enforce OS access controls. The verifier copies declared dependency directories and rejects links in the copied tree. Large dependency trees use extra time and disk space.
MCP cannot grant elevated reasoning approval or skip implementation verification. Use a local, operator-approved CLI order for elevated work. Keep task records and logs private.
Using with Antigravity
node scripts/setup.mjs automatically renders plugin/ into ~/.gemini/config/plugins/codex-orchestrator/ with:
plugin.jsonmcp_config.json(using resolved absolute paths andtimeoutSeconds: 960)skills/codex-orchestrator/SKILL.md(5-stage workflow: prototype → blind adversarial review → final contract → module-by-module implementation → integration gate)
Open a new conversation in Antigravity and toggle Codex Orchestrator under Customizations / Plugins if needed.
CLI Usage (Direct / Scripted)
node src/cli.mjs run orders/my-task.order.json
node src/cli.mjs estimate orders/my-task.order.json
node src/cli.mjs verify <task_id>
node src/cli.mjs apply <task_id>
node src/cli.mjs integrate <project_id> orders/integration.json
node src/cli.mjs status <task_id>
node src/cli.mjs cancel <task_id>
node src/cli.mjs doctor
node src/cli.mjs cleanup [--project <id>] [--include-failed] [--dry-run]
node src/cli.mjs unlock <project_id> --force-reconciled
# Reproducible cross-module contract-mismatch demo (zero quota cost), local metrics & P3 comparison harness
npm run demo:contract
npm run report:metrics
npm run compare:workflows -- --plan --rounds 3
npm run compare:workflows -- --snapshot-bench --files 200 --shared-files 200The estimate command and MCP tool codex_estimate_usage use completed work orders from the same project, mode, model, reasoning profile, and authentication method. The first estimate needs three complete samples. Pass an existing task ID to refresh the remaining range using its recorded input and output tokens. Account quota feasibility is shown as unknown.
Repository Layout
src/— Core orchestrator modules (config.mjs,path-guard.mjs,registry.mjs,workspace-manager.mjs,codex-runner.mjs,verifier-applier.mjs,integration-gate.mjs,cli.mjs,mcp-adapter.mjs)plugin/— Portable Antigravity Plugin source (plugin.json,mcp_config.template.json,skills/codex-orchestrator/SKILL.md)scripts/setup.mjs— Cross-machine auto-setup, project registration, and plugin installerconfig/— Example templates (*.example.json); localruntime.json&projects.jsonare gitignoredtests/— Automated unit & negative-boundary test suite (node --test)PILOT_REPORT.md— Recorded 4-gate end-to-end Windows validation report
License
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
A paid remote MCP for OpenAI Codex agent coordination MCP, built to return verdicts, receipts, usage
Source-checked CLI guides and model-aware planning for Claude Code, Codex, and Grok Build.
A paid remote MCP for OpenAI Codex context compressor, built to return verdicts, receipts, usage log
Operate GitHub from your AI assistant: repos, PRs, issues, Actions. Previews and read-only mode.
Related MCP Servers
- AlicenseAqualityDmaintenanceA controlled Model Context Protocol bridge that lets OpenAI Codex delegate work to Google Antigravity CLI on demand, with project-scoped opt-in and read-only delegation.151MIT
- AlicenseNot gradedqualityBmaintenanceEnables Codex users to delegate engineering, refactoring, auditing, and test execution tasks to Google Antigravity CLI as a persistent autonomous subagent, with tools for managing sessions and running prompts.1MIT
- AlicenseBqualityCmaintenanceEnables a local Codex chat to ask a second opinion, review staged, unstaged, or revision-based diffs, and delegate coding tasks to the Antigravity CLI running in isolated or disposable workspaces. Supports starting, polling, retrieving, and cancelling tasks with returned answers, diffs, changed-file lists, exit codes, and time/output limits, while never auto-applying returned patches.81MIT
- AlicenseAqualityBmaintenanceEnables Antigravity to delegate coding, debugging, refactoring, and code reviews to OpenAI Codex through a persistent app-server bridge, with thread continuity, approvals, isolated worktrees, and multimodal inputs.11MIT