Codex MCP Server

npm versionarrow-up-right npm downloadsarrow-up-right licensearrow-up-right

Bridge between Claude and OpenAI's Codex CLI — get AI-powered code analysis, generation, and review right in your editor.

spinner

Quick Start

1. Install Codex CLI

npm i -g @openai/codex
codex login --api-key "your-openai-api-key"

2. Add to Claude Code

claude mcp add codex-cli -- npx -y codex-mcp-server

3. Start Using

Ask codex to explain this function
Use codex to refactor this code for better performance
Use review to check my uncommitted changes

One-Click Install

VS Codearrow-up-right VS Code Insidersarrow-up-right Cursorarrow-up-right

Tools

Tool
Description

codex

AI coding assistant with session support, model selection, and structured output metadata

review

AI-powered code review for uncommitted changes, branches, or commits

listSessions

View active conversation sessions

ping

Test server connection

help

Get Codex CLI help

Examples

Code analysis:

Multi-turn conversations:

Passing a sessionId creates the session on first use, so listSessions will show it (for this server instance) and subsequent calls can resume context.

Code review:

Advanced options:

Requirements

  • Codex CLI v0.75.0+ — Install with npm i -g @openai/codex or brew install codex

  • OpenAI API key — Run codex login --api-key "your-key" to authenticate

Codex 0.87 Compatibility

  • Thread ID + structured output: When Codex CLI emits threadId, this server returns it in content metadata and structuredContent, and advertises an outputSchema for structured responses.

Documentation

Environment Variables

  • CODEX_MCP_CALLBACK_URI: Static MCP callback URI passed to Codex when set (overridden by callbackUri tool arg)

Development

License

ISC

Last updated

Was this helpful?