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 "Install 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: gpt-subagents
機能
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 installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/sam-mountainman/codex-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server