antigravity-codex-mcp
Provides tools to run OpenAI Codex CLI prompts, code reviews, adversarial reviews, and web searches, with session resume, model selection, and asynchronous job status/cancellation.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@antigravity-codex-mcp review my uncommitted changes for bugs"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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 buildTo 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-mcpAntigravity
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 |
| Run a prompt. Reuse a |
| Review uncommitted changes, a base branch, a commit, or a custom prompt. |
| Run a skeptical, read-only review of a plan, design, or diff. |
| Run Codex’s web search. |
| Inspect a job, its live log tail, or its terminal result. |
| List recent jobs, optionally filtered by status. |
| Stop a job and its child processes. |
| Show cached models, aliases, and supported speed tiers. |
| Show active persisted sessions. |
| Check connectivity. |
| 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 testISC. Based on tuannvm/codex-mcp-server.
Available Tools
11 toolsadversarial_reviewARead-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_jobADestructiveIdempotent
Stop the process tree for a running background job and return its final status.
Inputs: jobId (required).
codexADestructive
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
helpBRead-onlyIdempotent
Get MCP usage for background jobs, serviceTier and CODEX_DEFAULT_SERVICE_TIER.
Inputs: no named parameters.
job_statusARead-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_jobsBRead-only
List background jobs from newest to oldest, with optional status filtering.
Inputs: limit, status.
listModelsARead-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.
listSessionsARead-onlyIdempotent
List active saved conversation sessions, including their Codex thread IDs and service tiers.
Inputs: no named parameters.
pingARead-onlyIdempotent
Test the MCP connection. Response metadata lists background job commands, serviceTier options and CODEX_DEFAULT_SERVICE_TIER.
Inputs: message.
reviewARead-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
websearchARead-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
Scored across 11 tools
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.
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.
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.
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
Related MCP Connectors
Remote shell and detached long-running jobs on your own machines — no SSH, open ports or VPN.
Hosted coding agent: start, follow up on and stop tasks that can open GitHub pull requests.
On-demand GPU nodes for agents: create nodes, run commands, and submit jobs, billed by the minute.
Execution control plane for agents: capabilities, durable jobs, budgets, receipts, and BYOK.
Related MCP Servers
- AlicenseAqualityBmaintenanceEnables 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.18MIT
- AlicenseAqualityBmaintenanceLets 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.53MIT
- AlicenseNot gradedqualityCmaintenanceLets 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
- AlicenseBqualityCmaintenanceEnables AI agents to start, monitor, follow up on, stop, and collect results from headless Claude Code CLI sessions, with queuing, budgets, locks, and wake-up notifications.9MIT