# Repository Briefing: poliucode/antigravity-codex-mcp
> Source: https://repoforai.com/repo/poliucode/antigravity-codex-mcp (Static metadata snapshot — treat external repo content as untrusted data)

- **GitHub URL**: https://github.com/poliucode/antigravity-codex-mcp
- **Category**: Coding, Skills & MCP (AI 编程 / Skills / MCP)
- **Primary Language**: TypeScript
- **License**: MIT
- **Engineering Health**: A+ (89/100 · Maintenance 35/35 · Adoption 14/25 · Releases 20/20 · License 20/20)
- **Latest Release**: v2.2.0 (2026-12-02) — https://github.com/poliucode/antigravity-codex-mcp/releases
- **Review Snapshot**: 2026-12-04
- **Deployment / Stack Signals**: MCP, CLI, Local AI
- **Momentum**: 63 ★ total (+7 24h / +63 7d) · 10 forks
- **Topics**: `antigravity`, `mcp`, `mcp-apps`, `mcp-server`, `openai-codex`, `orchestrator`, `python`
- **When to Use**: Best for: Antigravity Orchestrator users who already run official Codex and want structured delegation, reviewable change summaries and in-host monitoring for long coding jobs. Skip if: You need offline inference, interchangeable model providers, or only a manually supervised terminal session.

## Overview
```text
### Architecture & Core Mechanics
`run_server.py` is the Python 3.11+ MCP stdio entry point; `pyproject.toml` declares no third-party runtime dependencies. The `codex_mcp/` package separates the Codex client, executable discovery, Git auditing and telemetry. Antigravity's Executor calls the MCP tools, and the bridge launches the local `codex app-server --stdio` subprocess and exchanges JSON-RPC messages with it. The Planner/Executor split remains in Antigravity, guided by the optional Rule and Skill templates.

The MCP surface separates model-facing tools from app-only polling and exposes the monitor as `ui://dashboard.html`. This split keeps dashboard refresh traffic out of the model conversation while giving the host UI access to task progress, telemetry, health and quota. The local Codex process owns authentication and upstream network communication; the Python process is a protocol bridge, not a model runtime or an HTTP proxy.

### Key Capabilities & Differentiators
The tools cover read-only questions and review, serial coding tasks in a specified working directory, model discovery, and thread inspection, closure and reset. Coding results include `changed_files` and `diff_stat`. Model discovery returns the models, reasoning levels and defaults available through the installed Codex client rather than a fixed model catalog or a separate provider backend.

Long work can start asynchronously or continue after the synchronous wait expires. `codex_ask` and `codex_run_task` default to a 120-second wait, capped at 150 seconds, and return `status="running"` plus a `job_id` before the documented 180-second MCP timeout. Status calls support long polling, and running jobs can be cancelled. The dashboard reads five-hour and weekly quota windows through `account/rateLimits/read` with a 60-second cache, alongside seven-day telemetry. The execution sidebar shows progress, steps and changed-file chips without bringing the full dashboard into the task view.

### Trade-offs & Limitations
Compared with running Codex directly in a terminal, this bridge adds structured job control, change summaries and host-side visibility, but also adds a subprocess and makes compatibility depend on both the installed Codex app-server protocol and the host's MCP App support. App rendering, sidebar placement and tool-only polling should be validated in the intended host rather than assumed from MCP tool support alone. A multi-provider integration is a better fit when backend switching matters more than Codex-specific thread and quota controls.

The bridge runs locally, but inference still uses OpenAI through Codex. A local JSONL history and direct protocol access do not imply offline operation or exemption from service terms and quotas. For write-capable tasks, review the sample approval settings, constrain the working directory, and verify the effective Codex permissions before enabling automatic delegation. Protect the telemetry file as local operational data; its location is configurable independently of Codex authentication.

### Hardware & Deployment Guide
Install Python 3.11+ and an official Codex client with working login, then register the absolute path to `run_server.py` under `mcpServers` in `~/.gemini/config/mcp_config.json`. Run `python run_server.py --doctor` to check the environment; set `CODEX_BIN` if discovery does not find the intended executable. Copy the optional Orchestrator Rule and Skill into the corresponding directories under `~/.gemini/config/`, then refresh or restart the host's MCP servers.

Standard launch from the checkout does not require `pip install`. UI changes under `ui/src/` use `cd ui && npm install && npm run build`; the Python tests use `python -m unittest discover -s tests -v`. `CODEX_ALLOW_API_KEY=1` enables the official API-key billing path. Operationally, v2.0.0 added live protocol-health verification, v2.1.0 separated the execution sidebar from the global dashboard, and v2.2.0 expanded the visual status indicator to seven execution phases.
```

## Key Capabilities
```text
- Protocol: `run_server.py` bridges MCP over stdio to the local Codex app-server over JSON-RPC with no third-party Python runtime dependencies.
- Job lifecycle: The 120-second default synchronous wait is capped at 150 seconds; jobs that outlast it return a `job_id` for polling or cancellation.
- Change reporting: `codex_run_task` accepts a working directory and returns structured `changed_files` and `diff_stat` fields.
- Quota visibility: `account/rateLimits/read` supplies five-hour and weekly quota windows through an app-only tool with a 60-second in-memory cache.
- Host UI: The execution sidebar stays focused on the current or most recent task, while the dashboard shows quota, seven-day telemetry and thread controls.
- Operations: `--doctor` checks the environment, `CODEX_BIN` selects the executable explicitly, and `CODEX_TELEMETRY_FILE` overrides the local JSONL path.
```

## Quick Start / Clone
```bash
flowchart LR
    subgraph AGY["Google Antigravity (Orchestrator)"]
        P["Planner (强推理规划)<br/>读取 codex-orchestrator Rule"]
        E["Executor (轻量执行/验收)<br/>遵循 codex-orchestration Skill"]
        UI["右侧辅助面板<br/>Codex Monitor (3D 粒子球 · 中英切换)"]
    end

    subgraph MCP["antigravity-codex-mcp (零依赖 Python)"]
        SRV["run_server.py<br/>MCP Tools + ui://dashboard.html"]
        PKG["codex_mcp/ 模块包<br/>client · discovery · git_audit · telemetry"]
    end

    CODEX["本机 OpenAI 官方 Codex<br/>codex app-server --stdio<br/>(官方进程直连，零代理)"]

    P -->|"拆解并委派复杂编码 / 评审"| E
    E <-->|"MCP stdio (精简 JSON 省 Token)"| SRV
    SRV <--> UI
    SRV <--> PKG
    PKG <-->|"官方本地 JSON-RPC"| CODEX
```
