codex-mcp
Allows Claude Code to call OpenAI Codex for design reasoning, code review, and technical consultation using models like GPT-5.6 Sol with configurable reasoning effort, sandbox mode read-only, and session continuation.
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., "@codex-mcpreview the current diff for potential issues"
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.
codex-mcp
English README: README.en.md
短いセットアップガイド: SETUP.md
Claude CodeからOpenAI Codexを、読み取り専用の設計・深い推論・コードレビュー役として呼び出すプラグインです。fable-mcpと逆向きの構成です。
ユーザー
↓
Claude Code(実装担当)
↓ MCP
codex-mcp
↓ Codex CLI
GPT-5.6 Solなど(設計・推論・レビュー担当)一文でセットアップ
最も簡単な方法は、次の一文をClaude Codeまたは普段使っているコーディングエージェントへ渡すことです。
https://github.com/sam-mountainman/codex-mcp をセットアップして。受け取ったエージェントはAGENTS.mdをセットアップ契約として読み、Node.js、Codex CLI、Claude Code、認証、プラグイン登録、実動確認まで進めます。APIキーを通常チャットへ貼る必要はありません。
Related MCP server: codex-buddy-for-claude
機能
gpt_plan: リポジトリを読んで具体的な実装計画を作るgpt_ask: 技術相談、難しいデバッグ、トレードオフ分析gpt_review: 現在の差分を読み取り専用でレビューするgpt_continue:session_idを使って同じCodex会話を継続するgpt_status: CLI、認証、モデル一覧、既定値をローカル診断する(モデル利用なし)
既定値はgpt-5.6-solとmaxです。すべてのモデル呼び出しはapproval_policy=never、sandbox_mode=read-onlyで実行されるため、Codex側はリポジトリを変更できません。
セットアップ
前提はNode.js 18以上です。セットアップスクリプトは、Codex CLIまたはClaude Codeがなければ公式npmパッケージをインストールし、MCPをビルドしてClaude Codeへプラグイン登録します。
macOS / Linux:
git clone https://github.com/sam-mountainman/codex-mcp.git
cd codex-mcp
./install.shWindows PowerShell:
git clone https://github.com/sam-mountainman/codex-mcp.git
Set-Location codex-mcp
.\install.ps1既にCodexへログイン済みなら、その認証を再利用します。未ログイン時はChatGPTログイン(推奨)またはAPIキーを選べます。
明示指定する場合:
# ChatGPTアカウントでログイン
./install.sh --auth=chatgpt
# 環境変数のAPIキーでログイン(キーはコマンド引数に載せない)
OPENAI_API_KEY=... ./install.sh --auth=api
# プラグインだけセットアップ
./install.sh --auth=skip --skip-live-check完了後にClaude Codeを再起動するか/reload-pluginsを実行し、Codexの状態を確認してと依頼してください。
モデル・推論レベルの変更
Claude Codeへ自然文で指定できます。
GPT-5.6 Terra、reasoning lowでこの設計を考えて
Solのmaxで実装をレビューして
さっきのsession_idをLunaのmediumで続けてMCPツールを直接呼ぶ場合の例:
{
"task": "この機能の設計と実装計画を作って",
"model": "gpt-5.6-sol",
"reasoning_effort": "max",
"cwd": "/absolute/path/to/project"
}サーバーが受け付ける推論値はnone / low / medium / high / xhigh / max / ultraです。実際に使える組み合わせはローカルCodex CLIのモデルカタログに従います。gpt_statusで対象モデルの対応値を確認できます。
環境変数でサーバー既定値も変更できます。
export CODEX_MCP_DEFAULT_MODEL=gpt-5.6-terra
export CODEX_MCP_DEFAULT_REASONING_EFFORT=mediumその他の設定:
CODEX_MCP_CODEX_BIN: Codex CLIの絶対パスCODEX_MCP_TIMEOUT_MS: 1回のタイムアウト(既定20分)CODEX_MCP_MAX_OUTPUT_CHARS: MCPへ返す最大文字数(既定200,000)
開発・検証
npm install
npm run verify
npm run live-smoke
claude plugin validate --strict .npm run live-smokeだけが実際にモデルを呼び出します。その他のテストはローカルのみです。
ローカル開発中はマーケットプレイスへ登録せず、Claude Codeを次のように起動して確認することもできます。
claude --plugin-dir /absolute/path/to/codex-mcp認証と課金
内部ではResponses APIを直接呼ばず、codex exec --jsonを使います。そのためCodex CLIが公式に対応する両方の認証を利用できます。
ChatGPTログイン: ChatGPTプラン側のCodex利用枠
OpenAI APIキー: OpenAI Platformの従量課金
APIキーやCodexの認証ファイルをリポジトリへ保存しません。APIキー方式のセットアップでも、キーは環境変数から標準入力へ渡し、コマンド引数や通常出力には載せません。
制約
modelは将来のCodexモデルIDも通せるよう固定リストにしていません。最終的な有効性はCodex CLIが検証します。reasoning_effortはCLI/APIで差があり得ます。例えばローカルカタログがnoneを表示しないモデルでは、その値は実行時に拒否される場合があります。gpt_continueはCodex CLIが保存したセッションを使うため、初回呼び出しと同じローカル認証・Codexホームが必要です。
ライセンス
MIT
参考資料
This server cannot be deployed
Maintenance
Related MCP Connectors
No-data MCP handoff for local Claude Code to Codex harness moves. $49 lifetime.
Paid remote MCP for Claude Code skill update gate MCP, structured receipts, audit logs, and reviewer
A paid remote MCP for OpenAI Codex agent coordination MCP, built to return verdicts, receipts, usage
Live SEO workflow tools for Claude Code, Codex, and AI agents.
Related MCP Servers
- AlicenseBqualityDmaintenanceEnables Claude Code, Cursor, and other AI tools to call OpenAI Codex for task execution, with safe and writable modes.3MIT
- AlicenseNot gradedqualityCmaintenanceEnables Claude Code to leverage OpenAI models for expert code review, deep architecture analysis, and security audits, with automatic markdown report generation.MIT
- AlicenseAqualityDmaintenanceEnables Claude Code to delegate tasks to OpenAI's Codex CLI (GPT-5.4) with structured execution traces, parallel execution, session persistence, and adversarial code review.15MIT
- AlicenseAqualityBmaintenanceEnables OpenAI Codex to consult Claude Code for co-analysis, adversarial second opinions, and read-only file review over the Model Context Protocol, with Claude remaining advisory and unable to modify files.924 npmMIT