antigravity-codex-mcp
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| CODEX_MCP_HOST | No | Host address to bind. CLI flag: --host <addr>. | 127.0.0.1 |
| CODEX_MCP_PORT | No | Port number. CLI flag: --port <num>. | 8765 |
| CODEX_CLI_COMMAND | No | Codex CLI command. CLI flag: --codex-command <cmd>. | codex |
| CODEX_MCP_BACKEND | No | Backend to use (cli or app-server). CLI flag: --backend <cli|app-server>. | cli |
| CODEX_MCP_HTTP_PATH | No | HTTP route path. CLI flag: --path <route>. | /mcp |
| CODEX_MCP_STATELESS | No | Enable stateless HTTP mode. CLI flag: --stateless. | false |
| CODEX_MCP_STATE_DIR | No | State directory. CLI flag: --state-dir <dir>. | ~/.codex-mcp-state |
| CODEX_MCP_TRANSPORT | No | Transport mode. CLI flag: --transport <stdio|http>. | stdio |
| CODEX_MCP_AUTH_TOKEN | No | Bearer token for HTTP mode. CLI flag: --auth-token <token>. Required for authenticated HTTP mode unless CODEX_MCP_AUTH_TOKEN_FILE is used. | |
| CODEX_MCP_MAX_SANDBOX | No | Maximum sandbox mode. CLI flag: --max-sandbox <mode>. Default: unrestricted for stdio, workspace-write for HTTP. | |
| CODEX_MCP_ALLOWED_HOSTS | No | Comma-separated allowed Host headers. CLI flag: --allowed-hosts <csv>. Default: loopback + bind host. | |
| CODEX_MCP_ALLOWED_ROOTS | No | Allowed workspace root paths. CLI flag: --allowed-roots <paths>. Required for HTTP mode; unrestricted for stdio by default. | |
| CODEX_MCP_ALLOW_ANY_CWD | No | Allow any current working directory (dev opt-in only). CLI flag: --allow-any-cwd. | false |
| CODEX_MCP_DEFAULT_MODEL | No | Default Codex model. CLI flag: --default-model <model>. Unset by default. | |
| CODEX_MCP_ALLOWED_ORIGINS | No | Comma-separated allowed Origin headers. CLI flag: --allowed-origins <csv>. Default: loopback origins. | |
| CODEX_MCP_AUTH_TOKEN_FILE | No | Path to a file containing the bearer token for HTTP mode. CLI flag: --auth-token-file <path>. Alternative to CODEX_MCP_AUTH_TOKEN. | |
| CODEX_MCP_DEFAULT_PROFILE | No | Default Codex profile name. CLI flag: --default-profile <name>. Unset by default. | |
| CODEX_MCP_SESSION_TTL_SEC | No | HTTP session idle TTL in seconds. CLI flag: --session-ttl-sec <sec>. | 3600 |
| CODEX_MCP_MAX_RETAINED_JOBS | No | Maximum retained jobs. CLI flag: --max-retained-jobs <n>. | 500 |
| CODEX_MCP_MAX_CONCURRENT_JOBS | No | Maximum concurrent jobs. CLI flag: --max-concurrent-jobs <n>. | 4 |
| CODEX_MCP_DEFAULT_REASONING_EFFORT | No | Default reasoning effort level. CLI flag: --default-reasoning-effort <lvl>. Unset by default. | |
| CODEX_MCP_ALLOW_UNAUTHENTICATED_HTTP | No | Allow unauthenticated HTTP (loopback dev opt-in only). CLI flag: --allow-unauthenticated-http. | false |
| CODEX_MCP_ALLOW_UNAUTHENTICATED_NETWORK | No | Allow unauthenticated network access (dangerous opt-in). CLI flag: --allow-unauthenticated-network. | false |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": true
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| codex_runA | Start a new asynchronous Codex CLI session ( |
| codex_resumeB | Resume an existing Codex session by exact session_id, previous MCP job_id, or use_last=true (mutually exclusive). Locks session identity strictly. |
| codex_forkB | Fork an existing Codex session by exact session_id or previous MCP job_id into a brand-new session. |
| codex_reviewA | Run a non-interactive Codex code review ( |
| codex_pollA | Safely long-poll an asynchronous Codex job (wait_seconds <= 55). Supports replayable cursor (returns seq > cursor), truncation reporting, terminal/events wakeup modes, and optional intermediate event omission. |
| codex_resultA | Retrieve the final structured result of a completed/failed/cancelled/timed_out job. Returns ready=false without blocking if still active. |
| codex_cancelA | Cancel an active Codex job by terminating its process tree. Atomic against completion and retryable on kill failure. |
| codex_list_sessionsA | List Codex sessions by merging local $CODEX_HOME/sessions rollout files and MCP job records. Sessions in both appear as source='both' and match both local and mcp filters. |
| codex_get_sessionA | Inspect metadata and recent user/assistant conversation turns for a specific Codex session_id. |
| codex_list_jobsA | List active and recent asynchronous Codex MCP jobs (newest first). Useful for reconnecting or recovering job_id across windows/devices. |
| codex_list_workspacesA | List available workspace directories (allowed roots + child directories in restricted mode, or recently used directories in unrestricted mode) with Git branch and dirty status. |
| codex_healthA | One-shot preflight and health check: verifies Codex CLI availability, MCP concurrency/policy limits, default model/reasoning config, cached models, and optional cwd/model/reasoning_effort readiness. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 12 tools
Most tools target clearly distinct operations: run (new session), resume, fork, review, poll, result, cancel all have specific roles clarified by descriptions. Minor overlap exists between codex_list_sessions and codex_list_jobs (both enumerate session/job records, with sessions merging both sources) and between codex_resume and codex_fork (both accept session_id or job_id), but the descriptions draw the lines adequately.
All tools share a consistent `codex_` prefix with a predictable verb_noun convention (codex_run, codex_resume, codex_poll, codex_list_sessions, codex_get_session). A couple of names are noun-only (codex_health, codex_result) rather than verb-led, a minor deviation from the otherwise uniform pattern.
Twelve tools is well within the ideal range and each maps to a distinct facet of the async job/session lifecycle. The set is cleanly organized into job control (run/poll/result/cancel), session management (resume/fork/list/get), plus review, health, and workspace listing, so no tool feels redundant.
The surface covers the full async lifecycle (start, poll, result, cancel), session continuation (resume, fork, list, get), review, and environment introspection (health, workspaces). Minor gaps remain: no session/job cleanup or deletion, no way to change default config (only read it via health), and no content-based session search.