Skip to main content
Glama

Codex Bridge

An Antigravity plugin with an interactive control panel, persistent goal & milestone board, auto-callback progression loop, and zero-dependency MCP bridge to orchestrate your local OpenAI Codex CLI.

Version Node Dependencies MCP License: MIT

English · 简体中文


Why Codex Bridge?

Codex Bridge turns your local OpenAI Codex CLI into a persistent, goal-driven coding & analysis worker inside Google Antigravity — built specifically for iterative workflows like backend debugging/refactoring and meta-analysis / data pipelines that require continuous investigation, execution, and verification.

  • Let Antigravity analyze requirements, design verifiable milestones, inspect diffs, and verify outcomes.

  • Let Codex execute edits, run backend tests/scripts, resume multi-turn sessions, and wake Antigravity automatically when background runs finish.

Related MCP server: codex

Features

  • Native Interactive Sidecar Panel — Appears right inside Antigravity's Plugins side-pane menu with two clean tabs (Control & Goals & Jobs):

    • Model selection (auto-populated from your local ~/.codex/models_cache.json)

    • Reasoning effort (dynamically adapts to each model's supported levels: low, medium, high, xhigh, max, ultra)

    • Progression mode (switchable live):

      • manual — No automatic callbacks; wait for your next prompt.

      • notify — Automatically wakes Antigravity when a background Codex job finishes so it can verify and report findings.

      • autonomous — Automatically verifies completed milestones, calls codex_resume on failure, or advances to the next pending milestone until done (guarded by a configurable maxAutoIterations cap and one-click Pause button).

    • Sandbox policy (read-only, workspace-write, danger-full-access) & Briefing workflow (direct vs. plan_first)

  • Persistent Goal & Milestone State Machine — Goals, ordered milestones, verification commands, blockers, and linked Session IDs persist on disk (goals.json), surviving conversation compaction and restarts.

  • Restart-Resilient Background Jobs — Background jobs (codex_start) are persisted to jobs.json with live event counts and captured Session IDs; interrupted jobs after a restart can be resumed cleanly with one click via codex_resume.

  • Automatic Codex Discovery — Automatically locates the newest codex.exe bundled with Codex Desktop on Windows (survives hash-folder auto-updates), falls back to codex on PATH, or respects CODEX_BIN.

  • Zero External Dependencies — Pure Node.js ESM (>= 18). No npm install, no build step, instant startup, UTF-8 stdin prompting.

Architecture

flowchart LR
  User["User in Antigravity"] <--> Agent["Antigravity Agent"]
  User <--> Panel["Sidecar Control Panel & Goal Watcher<br/>(sidecars/codex_panel)"]
  Panel -->|Auto-Callback on Job Done| Agent
  Panel <--> Store["Persistent State<br/>(settings.json / goals.json / jobs.json)"]
  Agent <-->|MCP Stdio JSON-RPC| Server["Codex MCP Bridge<br/>(server/mcp-server.js)"]
  Store <--> Server
  Server <-->|JSONL Stream + UTF-8 stdin| Codex["Local OpenAI Codex CLI<br/>(codex exec / resume / review)"]

Quick Start

Prerequisites

  • Google Antigravity (Desktop or CLI)

  • Node.js >= 18

  • OpenAI Codex (Codex Desktop app or codex CLI installed and signed in)

Install

macOS / Linux:

git clone https://github.com/yeyuhants-prog/codex-bridge.git ~/.gemini/config/plugins/codex-bridge

Windows (PowerShell):

git clone https://github.com/yeyuhants-prog/codex-bridge.git "$env:USERPROFILE\.gemini\config\plugins\codex-bridge"

Enable & Open the Panel

  1. Open Skills & Customizations (自定义扩展) in Antigravity's left sidebar and ensure Codex Bridge is toggled ON.

  2. Open the interactive control panel from the right-hand Plugins (插件) menu → Codex Bridge.

  3. Pick your Codex model, reasoning effort, progression mode (manual / notify / autonomous), and sandbox — opening the panel in a conversation automatically binds it for completion callbacks.

MCP Tools (9)

Tool

Description

codex_goal

Create, inspect, update milestones, pause/resume, or delete persistent multi-step Goals shared with the Sidecar goal board.

codex_run

Run a task synchronously via codex exec using active panel settings (or per-call overrides). Supports optional goal_id & milestone_id.

codex_resume

Continue a previous Codex session by session_id (or "last") with follow-up instructions.

codex_review

Run Codex's built-in non-interactive Git code review (uncommitted, base branch, or commit SHA).

codex_start

Launch a persistent background Codex worker and return job_id immediately; triggers auto-callback upon completion in notify/autonomous modes.

codex_status

Inspect progress events, Session ID, or final output of a background job (including restart-interrupted jobs), with optional wait_seconds long-polling.

codex_cancel

Terminate a running background Codex job along with its child process tree.

codex_config

Read or update shared preferences (model, reasoning_effort, sandbox, workflow_mode, progression_mode, max_auto_iterations) and list local Codex models.

codex_info

Health check showing resolved Codex binary & version, active panel settings, bound conversation, active goal progress, and tracked jobs.

Example Prompts

  • Continuous backend debugging:

    "Create a persistent Codex Bridge goal to reproduce the 500 error in backend/auth, fix the root cause, and pass pytest. Start milestone 1 in the background and keep verifying until all tests pass."

  • Iterative meta-analysis pipeline:

    "Set up a goal with milestones for cleaning the dataset, checking heterogeneity (I² / Q-test), running sensitivity analysis, and exporting forest plots. Dispatch Codex step-by-step and verify each output table."

  • Code review:

    "Have Codex review my uncommitted Git changes in this repository and summarize bugs or edge cases."

  • Per-call model override:

    "Use gpt-6.2-astra with xhigh reasoning effort and have Codex refactor the parser module."

Environment Variables

Variable

Default

Purpose

CODEX_BIN

Auto-discovered

Explicit path to the codex / codex.exe binary.

CODEX_HOME

~/.codex

Directory containing Codex's config.toml and models_cache.json.

CODEX_BRIDGE_DATA_DIR

~/.gemini/antigravity/plugin_data/codex-bridge

Directory storing settings.json, goals.json, jobs.json, and history.json.

Testing

# Zero-token MCP protocol, settings & persistent goal board smoke test
npm test

# End-to-end live check against your local Codex CLI (read-only, ephemeral)
npm run test:live

Project Structure

codex-bridge/
├── plugin.json                 # Antigravity plugin manifest
├── mcp_config.json             # Portable MCP server definition
├── assets/
│   └── logo.png                # Plugin icon (512×512 transparent PNG)
├── server/
│   ├── mcp-server.js           # Zero-dependency MCP Stdio JSON-RPC server
│   ├── codex-runner.js         # Codex CLI auto-discovery, spawn & JSONL parser
│   ├── goal-store.js           # Persistent Goal & Milestone state machine
│   ├── job-manager.js          # Persistent async worker & process-tree manager
│   └── settings-store.js       # Shared preferences, history & model catalog reader
├── sidecars/
│   └── codex_panel/            # Native Antigravity side-pane UI & callback watcher
│       ├── sidecar.json
│       ├── main.mjs
│       ├── index.html
│       ├── app.js
│       └── styles.css
├── skills/
│   └── codex-worker/SKILL.md   # Orchestration skill for Antigravity
├── rules/
│   └── AGENTS.md               # Active rules while plugin is enabled
└── test/
    └── smoke-test.mjs          # End-to-end MCP smoke test

License

Released under the MIT License.

Available Tools

9 tools
codex_cancelB

Cancel a running background Codex job by job_id.

Inputs: job_id (required).

codex_configB

Read or update persistent Codex Bridge preferences (model, reasoning_effort, sandbox, workflow_mode, progression_mode, max_auto_iterations) shared with the Codex Bridge UI panel, and list available local Codex models.

Inputs: model, sandbox, list_models, workflow_mode, +3 more.

codex_goalB

Manage persistent multi-step Goals & Milestones shared with the Codex Bridge Sidecar panel (survives restarts and conversation compaction). Use this for ongoing backend debugging, refactors, or meta-analysis pipelines that require iterative verification.

Inputs: cwd, notes, title, action, +9 more.

codex_infoB

Check Codex Bridge health: shows resolved codex.exe path & version, active UI panel preferences (model, reasoning effort, sandbox, workflow mode, progression mode), active goal progress, and tracked background jobs.

Inputs: no named parameters.

codex_resumeA

Continue a previous Codex session synchronously by session_id (or 'last' for the most recent session) with follow-up instructions, preserving Codex's full conversation context.

Inputs: prompt (required), session_id (required), cwd, model, +7 more.

codex_reviewC

Run Codex's built-in non-interactive code review (codex exec review) on a Git repository.

Inputs: cwd (required), base, model, title, +6 more.

codex_runA

Run a task synchronously with local OpenAI Codex CLI (codex exec) using the model, reasoning effort, and sandbox configured in the Codex Bridge UI panel (unless explicitly overridden). Returns final response, session_id, modified files, executed commands, and token usage.

Inputs: prompt (required), cwd, model, config, +12 more.

codex_startA

Launch a Codex task asynchronously in the background and immediately return a job_id. Persisted to disk; when progression mode is 'notify' or 'autonomous', the Sidecar automatically sends a callback message back to Antigravity upon completion so verification and milestone progression continue seamlessly.

Inputs: prompt (required), cwd, model, config, +14 more.

codex_statusA

Check status, live progress events, session_id, or final output of a background Codex job started with codex_start (also inspects jobs persisted across restarts). Optionally waits up to wait_seconds.

Inputs: job_id, wait_seconds.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.6/5.0

    Scored across 9 tools

    Disambiguation4/5

    The async/sync split is clearly labeled (codex_start vs codex_run), and job-scoped status is separated from health-check info (codex_status vs codex_info). The main seam is codex_info vs codex_config, which both surface current preferences (model, sandbox, workflow mode) and could be confused about which is the right tool to inspect settings.

    Naming Consistency4/5

    All tools share a clean codex_ prefix, so the namespace is predictable and easy to scan. The action segments are slightly mixed in style—verbs (start, cancel, run, resume, review) versus nouns (info, status, goal, config)—but each remains readable and there's no case-style mixing.

    Tool Count5/5

    Nine tools is well within the ideal range for a Codex bridge and each one maps to a distinct operation: async lifecycle, sync execution, session continuation, review, goal tracking, config, and info. Nothing looks redundant or missing from the set.

    Completeness4/5

    The surface covers the full async lifecycle (start, status, cancel), synchronous run/resume, code review, persistent goals, configuration, and health inspection—no obvious dead ends for the core workflow. Minor gaps exist around enumerating all tracked jobs/sessions or fetching raw logs, which currently must be inferred via codex_status/codex_info.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      C
      quality
      D
      maintenance
      Bridges MCP clients with local Codex CLI to execute autonomous coding tasks, manage threads, and inspect history via SQLite state.
      13
      4
      Apache 2.0
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables Grok Build to orchestrate the local Codex CLI for code reviews, adversarial reviews, task rescue, session transfer, and background job management through MCP tools.
      1
      Apache 2.0
    • F
      license
      Not graded
      quality
      A
      maintenance
      Enables orchestrating multiple AI coding tools (Claude Code, Codex CLI, Gemini CLI) on shared repositories with file locking, knowledge capture, task planning, and drift detection via an MCP server.
      168
      -
    • A
      license
      A
      quality
      C
      maintenance
      Enables MCP-compatible coding agents to execute the local Codex CLI as a coding agent, including code reviews, session resume/fork, and CLI diagnostics.
      9
      MIT