Skip to main content
Glama

codex-mcp

Plan with Claude · Execute with OpenAI Codex · Review with Claude + Codex

A Claude Code plugin and MCP server for a repeatable plan → execute → review workflow.

CI npm version License: MIT Node >= 20

macOS · Windows · Linux

What it is

Claude interviews you and turns the request into an acceptance-tested plan. Codex implements the planned tasks, while Claude and Codex review each task and the final result. That split matters because the model that writes the code is not the only one judging it: Claude plans and reviews, and a fresh read-only Codex session reviews too, all from a single command. Findings loop back into fixes, and non-blocking improvements wait for your decision. The MCP server runs the local Codex CLI and returns structured results for the workflow to use.

  • Six phases take a request from preflight through interview, plan, backlog, execution, and review.

  • 76 skills are indexed and selected for the task instead of loading every skill into context.

  • Independent tasks can run in parallel in separate git worktrees.

  • Session reports record planning, allocation, task, cost, and summary files with PIC attribution.

Related MCP server: MCP-Claude Code Bridge

Quick start

  1. Prerequisites. Install Node ≥ 20 and the Codex CLI, then authenticate with ChatGPT Plus/Pro/Team or an API key:

    npm i -g @openai/codex
    codex login
    # Or set OPENAI_API_KEY instead of using codex login.
  2. Install the plugin. It bundles five commands, 76 skills, and the codex MCP server:

    /plugin marketplace add anhnguyen0905/codex-mcp
    /plugin install codex-flow@codex-mcp

    The community-directory alternative is:

    claude plugin marketplace add anthropics/claude-plugins-community
    claude plugin install codex-flow@claude-community
  3. First run. In a project, start with:

    /codex-flow implement a dark-mode toggle on the settings page

For a standalone MCP server, see Standalone MCP server.

Auth mode. codex_health reports authMode: "chatgpt" | "apikey" | "unknown". The ChatGPT-auth backend rejects arbitrary model ids, so pass model only when authMode is apikey; otherwise omit it and steer with reasoningEffort. /codex-flow follows the same rule, and a flowDocs guard checks that wording.

Commands

Command

Purpose

/codex-flow <task>

Run the six-phase workflow from preflight to Claude + Codex review.

/codex-flow:brainstorm <question>

Frame, map, challenge, and ratify a read-only systems-thinking analysis.

/codex-flow:analyze <task>

Run the full flow with the data profile preset.

/codex-flow:design <task>

Run the full flow with the design profile preset for game/product design docs.

/codex-flow:plan <task>

Run the full flow with the plan profile preset.

How it works

Claude Code ──(MCP stdio)──▶ codex-mcp ──spawns──▶ codex exec --json

Phase

Owner

What happens

0 · Preflight

Claude

Verify Codex, baseline the workspace, and resume interrupted work.

1 · Interview

Claude

Clarify requirements until acceptance criteria are verifiable.

2 · Plan

Claude

Explore the codebase, select skills, and write the plan.

3 · Backlog

Claude

Decompose the plan into dependency-ordered tasks.

4 · Execute

Codex

Implement tasks serially or in parallel when independent.

5 · Review

Claude + Codex

Compare reviews, fix findings, and gate non-blocking improvements.

The server parses Codex’s JSONL event stream and returns a structured result through codex_execute, codex_continue, codex_review, codex_batch, codex_sessions, codex_metrics, and codex_health; see the MCP tools reference.

Highlights

  • Dual review and improvements gate. Claude and required codex_review findings are compared; non-blocking improvements wait for a user decision. Workflow reference

  • Index-based skill selection. A local index selects relevant skills within a context budget, and third-party skills are vetted before use. Skill selection

  • Context persistence for large projects. Budgeted task slices and resume context carry anchored decisions and preserve mandatory task text. Context persistence

  • Parallel execution in git worktrees. Independent tasks run across workspaces, then merge and receive integration review by wave. Parallel execution

  • Executor fallback. When Codex is unavailable, the flow offers an explicit choice to repair Codex or let Claude execute under the same plan/review contract. Executor fallback

  • Per-session reports with PIC attribution. Each session leaves planning, allocation, task, cost, and summary reports marked claude, codex, or both. Session reports

Documentation

Document

Use it for

Workflow

Phases, commands, state, skill selection, context, and reports.

MCP tools

Tool inputs, results, review behavior, redaction, and execution controls.

Configuration

Environment variables, standalone setup, optional flint-chart, and troubleshooting.

CHANGELOG

Release history.

SECURITY

Vulnerability reporting.

Security & privacy

  • No credentials handled. The server never reads, stores, or transmits credentials; authentication is handled entirely by the Codex CLI (~/.codex/); run npm run doctor to verify setup.

  • No network calls of its own. The server spawns local codex and git; model traffic is Codex's, under your OpenAI account and its data policies.

  • Local-only telemetry. Run metrics (tokens, durations, exit codes, and a 200-character error head) are appended to ~/.codex-mcp/metrics.jsonl on your machine and never uploaded; logs and notes stay under gitignored .codex-flow/.

  • Sandboxed writes. workspace-write is the default, codex_review is always read-only, danger-full-access is never used unless needed and disclosed, and per-cwd locks serialize runs.

  • Caller-defined verifyCommand. Its redacted output tail is shell output and should be treated as such; third-party skills load only after a content-pinned vet.

  • Vulnerability reports. Follow SECURITY.md.

  • Secret-redacted results. Returned text is redacted before it leaves the server; see Secret redaction.

Development

npm test          # unit tests
npm run coverage  # enforces 80% thresholds
npm run build     # tsc → dist/
npm run test:e2e  # spawns Codex and uses quota
npm run data:guard # scans for real data before a commit

Key files:

Area

File

Role

Server

src/index.ts

stdio entry

Server

src/server.ts

MCP tools, cwd lock, cancellation

Server

src/argsBuilder.ts

Codex argv

Server

src/codexRunner.ts

spawn, timeout, and kill

Server

src/eventParser.ts

JSONL → result

Server

src/workspaceDiff.ts

git diff

Server

src/terminal.ts, src/liveView.ts, src/progressFormatter.ts, src/progressNotifier.ts

live progress

Server

src/redaction.ts

secret redaction

Server

src/reviewFindings.ts

review findings

Server

src/verification.ts

acceptance verification

Workflow

scripts/sync-awesome-skills.mjs

sync skill library

Workflow

scripts/build-skills-index.mjs

build skill index

Workflow

scripts/skill-match.mjs, scripts/skill-eval.mjs

match and evaluate skills

Workflow

scripts/task-waves.mjs

compute execution waves

Workflow

scripts/session-cost.mjs

session cost reporting

Workflow

scripts/tail-progress.mjs

live progress tail

Workflow

scripts/flow-state.mjs

validate run state

Workflow

scripts/context-slice.mjs

generate context slices

Available Tools

7 tools
codex_batchRun multiple Codex tasks in parallel across workspacesA

Fan out N tasks across N cwds (typically git worktrees) with a bounded concurrency limit. Each task uses its own per-cwd lock, so callers must supply distinct cwds. Returns one result entry per input task in input order.

Inputs: tasks (required), failFast, maxConcurrency. Returns: tasks, total, failed, summary, +1 more

codex_continueContinue a Codex sessionB

Resume an existing Codex session by sessionId with a follow-up prompt — typically review feedback that Codex should address. Preserves Codex context.

Inputs: cwd (required), prompt (required), sessionId (required), model, +7 more. Returns: diff, runId, usage, errors, +25 more

codex_executeExecute a task with CodexA

Start a new Codex session that executes a plan/task in the given workspace. Returns sessionId (keep it to send review feedback later), agent message, file changes and commands run.

Inputs: cwd (required), prompt (required), model, sandbox, +6 more. Returns: diff, runId, usage, errors, +25 more

codex_healthCheck Codex CLI healthA

Report installed Codex CLI version and login status. With deep=true, also run one bounded read-only Codex exec probe to detect quota/model outages that login status cannot see.

Inputs: deep. Returns: version, authMode, loggedIn, execProbe, +4 more

codex_metricsAggregated Codex run metricsA

Roll up token/duration/failure counts from the local metrics log (~/.codex-mcp/metrics.jsonl). Set CODEX_MCP_PRICING (JSON: {inputPer1M, cachedInputPer1M, outputPer1M, reasoningOutputPer1M}) to include estCostUsd.

Inputs: cwd, tool, since, until, +2 more.

codex_reviewReview workspace changes with CodexA

Ask Codex to review the uncommitted changes in a workspace (read-only sandbox, no files modified). Returns findings ordered by severity plus a sessionId usable with codex_continue.

Inputs: cwd (required), focus, model, scope, +5 more. Returns: diff, runId, usage, errors, +25 more

codex_sessionsList prior Codex sessionsA

Discover Codex sessions stored locally under ~/.codex/sessions/. Returns sessionId, cwd, and last activity for each, newest first. sessionId can be passed to codex_continue to resume. Filter by cwd to find sessions from a specific workspace.

Inputs: cwd, limit.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A3.9/5.0

    Scored across 7 tools

    Disambiguation5/5

    Each tool maps to a distinct lifecycle stage: discovery (sessions), new execution (execute), resumption (continue), read-only review, batch fan-out, health, and metrics. The only mild overlap is execute vs batch and review vs execute, but descriptions make boundaries clear.

    Naming Consistency4/5

    All names use snake_case with a consistent codex_ prefix, which is predictable. Suffixes mix nouns (sessions, health, metrics) and verbs (execute, continue, review), so it is not a pure verb_noun pattern.

    Tool Count5/5

    Seven tools is well within the ideal 3-15 range and each covers a distinct operational need for a Codex CLI wrapper. No obvious filler.

    Completeness4/5

    Core workflows—discover, execute, continue, review, batch, health, metrics—are covered. Minor gaps include no explicit cancel/abort for running sessions and no detailed session inspection beyond listing, but agents can work around these.

    Maintenance

    ActivityNo data
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers