Skip to content

Codex

Bridge Claude with OpenAI's Codex CLI. Access GPT-5.5 for code generation, analysis, and review with automatic fallback to GPT-5.5-mini on quota limits.

Installation

Run in your terminal:

bash
# Project scope (current project only)
claude mcp add codex-cli -- npx -y ask-codex-mcp

# User scope (all projects)
claude mcp add --scope user codex-cli -- npx -y ask-codex-mcp

Or install as a plugin (adds slash commands like /multi-review, /brainstorm, /compare, plus reviewer subagents and a pre-commit hook):

bash
/plugin marketplace add Lykhoyda/ask-llm
/plugin install ask-llm@ask-llm-plugins

Or install globally:

bash
npm install -g ask-codex-mcp

Prerequisites

  1. Node.js v20.0.0 or higher
  2. Codex CLI installed and authenticated

Tools

ToolPurpose
ask-codexSend prompts to Codex CLI. Optional sessionId for multi-turn — maps to Codex's native thread_id and uses codex exec resume <id> under the hood (ADR-058)
get-usage-statsPer-session token totals + breakdowns. In-memory (ADR-054)
pingFast connection test to verify MCP setup

ask-codex returns both human-readable text and a structured AskResponse (provider, response, model, sessionId, usage) via MCP outputSchema. The Thread ID returned in the response footer is the same value as structuredContent.sessionId — pass it back as sessionId to continue the conversation.

Models

  • Default: gpt-5.5 (highest capability)
  • Fallback: gpt-5.5-mini (automatic on quota errors per ADR-028, model bumped in ADR-067)

Key Features

  • GPT-5.5 access via the official Codex CLI
  • Native session continuitysessionId parameter maps to Codex's thread_id; codex exec resume <id> is used internally for follow-up turns (zero replay cost — Codex retains state)
  • --full-auto flag so Codex never hangs waiting for approval prompts in MCP subprocess context (ADR-046)
  • JSONL output parsing for structured responses + token usage
  • Automatic quota fallback from GPT-5.5 to mini
  • Structured AskResponse via outputSchema for programmatic clients
  • Standard MCP transport works with 40+ clients

npm

Released under the MIT License.