codex-mcp-server
Provides integration with OpenAI's Codex CLI, enabling AI-powered code analysis, generation, review, and web search through tools like 'codex', 'review', and 'websearch'.
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-mcp-server Use codex to review my uncommitted changes"
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 Server
Bridge between Claude and OpenAI's Codex CLI — get AI-powered code analysis, generation, and review right in your editor.
graph LR
A[Claude Code] --> B[Codex MCP Server]
B --> C[Codex CLI]
C --> D[OpenAI API]
style A fill:#FF6B35
style B fill:#4A90E2
style C fill:#00D4AA
style D fill:#FFA500Quick 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-server3. Start Using
Ask codex to explain this function
Use codex to refactor this code for better performance
Use review to check my uncommitted changesRelated MCP server: Session Buddy
One-Click Install
Tools
Tool | Description |
| AI coding assistant with session support, model selection, and structured output metadata |
| AI-powered code review for uncommitted changes, branches, or commits |
| Web search using Codex CLI with customizable result count and search depth |
| View active conversation sessions |
| Test server connection |
| Get Codex CLI help |
Examples
Code analysis:
Use codex to analyze this authentication logic for security issuesMulti-turn conversations:
Use codex with sessionId "refactor" to analyze this module
Use codex with sessionId "refactor" to implement your suggestionsPassing 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:
Use review with base "main" to check my PR changes
Use review with uncommitted true to review my local changesAdvanced options:
Use codex with model "o3" and reasoningEffort "high" for complex analysis
Use codex with fullAuto true and sandbox "workspace-write" for automated tasks
Use codex with callbackUri "http://localhost:1234/callback" for static callbacks
Use codex to return structuredContent with threadId metadata when availableWeb search:
Use websearch with query "TypeScript 5.8 new features"
Use websearch with query "Rust vs Go performance 2025" and numResults 15
Use websearch with query "React Server Components" and searchDepth "full"Requirements
Codex CLI v0.75.0+ — Install with
npm i -g @openai/codexorbrew install codexOpenAI 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 andstructuredContent, and advertises anoutputSchemafor structured responses.
Documentation
API Reference — Full tool parameters and response formats
Session Management — How conversations work
Codex CLI Integration — Version compatibility and CLI details
Environment Variables
CODEX_MCP_CALLBACK_URI: Static MCP callback URI passed to Codex when set (overridden bycallbackUritool arg)
Development
npm install # Install dependencies
npm run dev # Development mode
npm run build # Build for production
npm test # Run testsRelated Projects
gemini-mcp-server — MCP server for Gemini CLI with 1M+ token context, web search, and media analysis
Clotch — Dynamic Island for Claude Code on macOS — monitor sessions across multiple machines and providers in real time
License
ISC
Available Tools
6 toolscodexADestructive
Execute Codex CLI in non-interactive mode for AI assistance
Inputs: prompt (required), sessionId, resetSession, model, +5 more. Returns: threadId
helpARead-onlyIdempotent
Get Codex CLI help information
Inputs: no named parameters.
listSessionsARead-onlyIdempotent
List all active conversation sessions with metadata
Inputs: no named parameters.
pingARead-onlyIdempotent
Test MCP server connection
Inputs: message.
reviewBRead-onlyIdempotent
Run a code review against the current repository using Codex CLI
Inputs: prompt, uncommitted, base, commit, +3 more.
websearchARead-onlyIdempotent
Perform web search using Codex CLI with web search enabled
Inputs: query (required), numResults, searchDepth.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 6 tools
Each tool has a clearly distinct purpose: general execution, help, session listing, connectivity test, code review, and web search. No overlaps or ambiguity.
Naming is inconsistent: 'listSessions' uses camelCase while all other tools (codex, help, ping, review, websearch) use lowercase. A consistent style pattern is missing.
With 6 tools, the set is well-scoped for a Codex CLI server. Each tool serves a distinct need without bloat or deficiency.
Covers core workflows (execution, help, sessions, connectivity, code review, web search). Minor gap: no explicit session creation/termination, but listing is provided and general execution may cover it.
Maintenance
Related MCP Connectors
Source-checked CLI guides and model-aware planning for Claude Code, Codex, and Grok Build.
Capture coding-agent sessions and resume them in any other agent: Claude Code, Codex, Cursor, more.
Use your Mac, Windows or Linux computer from ChatGPT, Claude or Codex: files, commands, documents.
Live SEO workflow tools for Claude Code, Codex, and AI agents.
Related MCP Servers
- AlicenseCqualityDmaintenanceConnects AI assistants like Claude to the Codex CLI for code analysis, editing, and execution. Supports file references with @ syntax, sandboxed code execution with approval workflows, and structured code changes for automated refactoring and documentation.8140 npm176MIT
- AlicenseAqualityBmaintenanceProvides comprehensive session management for Claude Code with automatic initialization/cleanup, quality checkpoints, and local conversation memory with semantic search for capturing learnings across coding sessions.6338 PyPI4BSD 3-Clause
- AlicenseNot gradedqualityDmaintenanceIntegrates OpenAI Codex CLI with Claude Code via MCP, enabling code execution, analysis, fixing, and web search within Claude Code.1,656 npm1ISC
- 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