Skip to main content
Glama

antigravity-codex-mcp

An async-first MCP server for the OpenAI Codex CLI. Each work tool returns a job ID and shell commands for retrieving the result. A detached worker records the job and its logs on disk, so stopping the client’s wait or restarting the MCP server leaves the job running.

Install

Use Node.js 20.1+ and an authenticated Codex CLI. The server discovers the Codex app on Windows or the CLI on an absolute PATH entry. If you have the CLI, sign in with codex login.

The most reliable option across npm versions and operating systems is to clone and build locally.

git clone https://github.com/SlopSurfer4444/antigravity-codex-mcp.git
cd antigravity-codex-mcp
npm install
npm run build

To run from that checkout, set the MCP server's command to node and use the absolute path to the checkout's dist/index.js as its sole argument.

For a one-off run from GitHub with npm 12+, allow the direct Git dependency and this repository's prepare script. npm configuration

npx --allow-git=root --allow-scripts=SlopSurfer4444/antigravity-codex-mcp github:SlopSurfer4444/antigravity-codex-mcp

Antigravity

Add the entry to Antigravity’s mcp_config.json. Antigravity MCP configuration

{
  "mcpServers": {
    "antigravity-codex-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "--allow-git=root",
        "--allow-scripts=SlopSurfer4444/antigravity-codex-mcp",
        "github:SlopSurfer4444/antigravity-codex-mcp"
      ]
    }
  }
}

Claude Code

Add the entry to the project’s .mcp.json. Claude Code MCP configuration

{
  "mcpServers": {
    "antigravity-codex-mcp": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "--allow-git=root",
        "--allow-scripts=SlopSurfer4444/antigravity-codex-mcp",
        "github:SlopSurfer4444/antigravity-codex-mcp"
      ]
    }
  }
}

For either snippet on Windows, set "command": "cmd.exe" and prepend "/d", "/c", "npx" to the existing args to launch the npm command shim.

Related MCP server: claude-codex-mcp

Tools

Tool

Purpose

codex

Run a prompt. Reuse a sessionId to resume, or pass resetSession: true to start a new thread with that ID.

review

Review uncommitted changes, a base branch, a commit, or a custom prompt.

adversarial_review

Run a skeptical, read-only review of a plan, design, or diff.

websearch

Run Codex’s web search.

job_status

Inspect a job, its live log tail, or its terminal result.

list_jobs

List recent jobs, optionally filtered by status.

cancel_job

Stop a job and its child processes.

listModels

Show cached models, aliases, and supported speed tiers.

listSessions

Show active persisted sessions.

ping

Check connectivity.

help

Show job and speed-tier usage.

Use waitCommand in PowerShell on Windows or in the default shell on macOS and Linux. Use waitCommandPosix in Git Bash, Bash, or Zsh. Either waits for terminal JSON and exits with status 0 on success or 1 on failure or cancellation. Append --timeout <seconds> to bound the wait. Exit status 124 means the wait timed out and the job can still be retrieved by ID.

Jobs and sessions default to ~/.codex/mcp-jobs and ~/.codex/mcp-sessions. You can override them with CODEX_MCP_JOBS_DIR and CODEX_MCP_SESSIONS_DIR. When only the jobs directory is overridden, sessions live in its sessions subdirectory.

Rules for GEMINI.md or CLAUDE.md

When codex, review, adversarial_review, or websearch returns a jobId, save it.
Run its wait command once as a long-running terminal task. Use waitCommand
in PowerShell and waitCommandPosix in Git Bash, Bash, or Zsh. Read the
terminal JSON before acting on the result. Use job_status for troubleshooting
or recovery after an interrupted wait. Avoid polling or submitting the job
again. Use cancel_job when the user asks to stop the job itself.

Fast and Ultrafast

  • Fast uses serviceTier: "fast" or "priority".

  • Ultrafast uses serviceTier: "ultrafast".

  • Default uses serviceTier: "default" or "standard" to leave tier selection to Codex.

service_tier and speed are aliases for serviceTier. Set CODEX_DEFAULT_SERVICE_TIER in the MCP server’s environment for a default override. Existing threads keep their stored tier on resume, including when you switch models. Use resetSession: true or a new ID to change tiers.

Choose sol, astra, terra, or an exact model slug. Aliases and tier support come from ~/.codex/models_cache.json (or the cache under CODEX_HOME). The canonical service_tiers[].id takes precedence over additional_speed_tiers.

Development

npm run typecheck
npm run build
npm test

ISC. Based on tuannvm/codex-mcp-server.

Available Tools

11 tools
adversarial_reviewA
Read-only

Start a skeptical, read-only architecture, plan, or diff audit. Defaults to Astra with high effort. Returns a background job immediately. Run waitCommand or waitCommandPosix (Bash or Zsh), or call job_status with jobId for output.

Inputs: focus, model, speed, prompt, +6 more. Returns: tool, jobId, model, status, +8 more

cancel_jobA
DestructiveIdempotent

Stop the process tree for a running background job and return its final status.

Inputs: jobId (required).

codexA
Destructive

Start Codex CLI for coding, architecture, or read-only consultation with optional sessionId resume. Returns a background job immediately. Run waitCommand or waitCommandPosix (Bash or Zsh), or call job_status with jobId for output.

Inputs: prompt (required), model, speed, sandbox, +9 more. Returns: tool, jobId, model, status, +8 more

helpB
Read-onlyIdempotent

Get MCP usage for background jobs, serviceTier and CODEX_DEFAULT_SERVICE_TIER.

Inputs: no named parameters.

job_statusA
Read-only

Read the job status, a live output tail while running, or its full result or error after completion.

Inputs: jobId (required), tailLines, includeOutput.

list_jobsB
Read-only

List background jobs from newest to oldest, with optional status filtering.

Inputs: limit, status.

listModelsA
Read-onlyIdempotent

List Codex models, supported reasoning efforts and service tiers, and resolved model aliases from ~/.codex/models_cache.json. Shows CODEX_DEFAULT_SERVICE_TIER.

Inputs: includeHidden.

listSessionsA
Read-onlyIdempotent

List active saved conversation sessions, including their Codex thread IDs and service tiers.

Inputs: no named parameters.

pingA
Read-onlyIdempotent

Test the MCP connection. Response metadata lists background job commands, serviceTier options and CODEX_DEFAULT_SERVICE_TIER.

Inputs: message.

reviewA
Read-only

Start a read-only code review against a repository. Supports uncommitted changes with a custom review prompt. Returns a background job immediately. Run waitCommand or waitCommandPosix (Bash or Zsh), or call job_status with jobId for output.

Inputs: base, model, speed, title, +8 more. Returns: tool, jobId, model, status, +8 more

websearchA
Read-only

Start a search using the native Codex web search tool in a read-only session. Returns a background job immediately. Run waitCommand or waitCommandPosix (Bash or Zsh), or call job_status with jobId for output.

Inputs: query (required), model, speed, numResults, +6 more. Returns: tool, jobId, model, status, +8 more

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A3.5/5.0

    Scored across 11 tools

    Disambiguation4/5

    The start tools (codex, review, adversarial_review, websearch) are mostly separated by purpose, and job management tools are distinct. Some boundary ambiguity remains between codex's read-only consultation and review/adversarial_review, and between ping and help for MCP metadata.

    Naming Consistency2/5

    Names mix snake_case (job_status, list_jobs), camelCase (listModels, listSessions), and bare nouns/verbs (codex, review, ping). Even the same list action is split between listModels/listSessions and list_jobs, so naming is not predictable.

    Tool Count5/5

    The 11 tools fit the domain: job starters, job controls, session/model discovery, and connection/help utilities. The set is well within a reasonable range and each group maps to a clear need.

    Completeness4/5

    The background job lifecycle is covered with start, status, list, and cancel operations, plus model/session discovery and help/ping. Minor gaps include limited session management (list only) and no dedicated wait/poll abstraction beyond job_status.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      B
      maintenance
      Enables MCP clients to control the local Codex CLI, including running and resuming agent sessions, forking, code review, applying diffs, and generating images, with background execution for long-running tasks.
      18
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Lets an MCP client hand coding tasks, second-opinion reviews, and image-asset generation to the official OpenAI CLI agent running locally, returning final messages, session IDs, and saved files. Jobs run sandboxed with prompts over stdin, work asynchronously with polling, and expose a live model catalog without needing an API key.
      5
      3
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Lets Claude and other MCP clients hand coding tasks to the Codex CLI as a sub-agent, running under the user's own Codex configuration so any configured model provider (OpenAI, DeepSeek, local models) does the work. Provides tools to start, poll, cancel and inspect jobs with compact change summaries, long-task handling, token-saving lean mode and clean process teardown.
      MIT