Skip to main content
Glama

codex-bridge

An Antigravity plugin and MCP/CLI bridge that connects Antigravity (Gemini) to OpenAI Codex / GPT over Agent Client Protocol (ACP) via @agentclientprotocol/codex-acp.

中文说明

Why codex-bridge?

  • Play to each model's strengths: Keep Gemini for natural communication, brainstorming, copywriting, and UI/aesthetic design; delegate heavy implementation, debugging, refactoring, test loops, and Codex-managed repositories to Codex/GPT.

  • Zero migration of Codex assets: codex-acp inherits your existing ~/.codex authentication, skills, plugins, MCP servers, AGENTS.md, and memories.

  • Session continuity: Search and resume existing Codex Desktop threads via codex_sessions + codex_run(session_id).

  • Adaptive sync/async + context economy: Short tasks return within wait_seconds (default 60s); longer runs seamlessly return a job_id controllable via codex_wait, codex_status, codex_steer, and codex_cancel. Full transcripts stay on disk (log_path) so coordinator context stays lean.

  • GPT extra capabilities & quota offload: Built-in presets for develop, debug, review, research (web search), image (native image generation), gif, and offload (thin-coordinator mode when Gemini quota is tight).

Related MCP server: codex-app-server-mcp

Architecture

Antigravity (Gemini)
   ├── MCP stdio ──▶ dist/mcp-server.mjs ──┐
   └── CLI / Swarm ─▶ dist/cli.mjs        ──┼──▶ AcpClient (NDJSON stdio) ──▶ @agentclientprotocol/codex-acp
                                                                                  └── ~/.codex (auth, skills, plugins, MCP, sessions)

Prerequisites

  1. Node.js 20+

  2. @agentclientprotocol/codex-acp installed globally (or CODEX_ACP_PATH set):

    npm install -g @agentclientprotocol/codex-acp
  3. Codex authenticated (e.g., via Codex Desktop / ChatGPT login in ~/.codex or CODEX_API_KEY / OPENAI_API_KEY).

Installation (Antigravity Plugin)

Clone this repository and deploy it into ~/.gemini/config/plugins/codex-bridge:

Windows (PowerShell):

.\scripts\install.ps1

macOS / Linux:

chmod +x scripts/install.sh
./scripts/install.sh

Antigravity automatically discovers ~/.gemini/config/plugins/codex-bridge. Whenever you pull or edit source code in this repository, run npm run deploy to rebuild and sync the runtime plugin files cleanly.

MCP Tools

Tool

Description

codex_run

Run a task in a new or resumed Codex session (prompt, cwd, session_id, preset, mode, model, wait_seconds, images)

codex_wait

Wait for a background running job to finish or report progress

codex_status

Inspect a job's status or check global ACP health & available models

codex_steer

Send mid-flight steering or follow-up instructions to a job

codex_cancel

Cancel a running job via ACP session/cancel

codex_sessions

List/search existing Codex Desktop & ACP sessions

CLI Usage

node dist/cli.mjs health
node dist/cli.mjs sessions --query "my-project" --limit 10
node dist/cli.mjs run --cwd "/path/to/repo" --preset develop --prompt "Fix failing unit tests"

Verification

npm run typecheck
npm run build
npm test

License

MIT

Tool Schema Changelog

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

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      B
      maintenance
      Enables Claude Code or any MCP client to delegate hands-on coding work to OpenAI Codex over a persistent app-server process, keeping long-lived threads with follow-ups, async polling, approvals, steering, and interrupts. Supports native code review, resuming existing sessions, structured output, and parallel worktree-isolated tasks.
      10
      37 npm
      2
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables Antigravity to delegate coding, review, and analysis tasks to an independent OpenAI Codex subagent over the official @openai/codex app-server v2 JSON-RPC protocol. Supports persistent multi-turn threads, protocol-level sandbox and permission switching, multimodal image inputs, structured output schemas, background job steering and cancellation, plus live progress telemetry.
      6
      MIT