Codex MCP server
✓ VerifiedEnables Claude Code to perform AI-powered code analysis, generation, and review using the OpenAI Codex CLI.
Also known as tuannvm/codex-mcp-server
- Stars
- 649
- Tools
- 5
- Downloads, 30 days
- —
- Latest version
- —
- Last commit
- May 25, 2026
- License
- —
What is Codex MCP?
Codex enables Claude Code to perform AI-powered code analysis, generation, and review using the OpenAI Codex CLI. It exposes 5 tools, such as codex, review, websearch.
Summary generated from the project's README
About Codex MCP server
Developers using Claude Code can perform AI-powered code analysis, generation, and review by connecting their environment to the OpenAI Codex CLI. This server acts as a bridge that allows an AI client to access specialized coding intelligence directly within an editor. To set it up, you must first install the Codex CLI via npm and authenticate using an OpenAI API key through the codex login command.
The server provides several specialized tools including codex for general coding assistance, review for inspecting uncommitted changes or specific branches, and websearch for technical research. It supports advanced features like session management via sessionId to maintain context across multiple turns, and allows for model selection such as using o3 with high reasoning effort. Users can also request structured content and utilize automated tasks through sandbox settings.
What you can do with it
- 1Perform code reviewsAsk the AI to check your local uncommitted changes or specific pull request branches for issues.
- 2Maintain conversation contextContinue a specific coding task across multiple prompts by using a session ID.
- 3Conduct technical researchSearch the web for specific programming language features or performance comparisons.
- 4Analyze complex logicUse high reasoning models to investigate security vulnerabilities in authentication code.
Written from the project's README. Every use case is checked against a quote from it.
How to install Codex MCP
Formats verified 10 Nov 2026Add to CursorAdd to GooseInstall Codex MCP in Claude Code
$ claude mcp add codex-mcp-server -- npx -y codex-mcp-serverInstall Codex MCP in Cursor
~/.cursor/mcp.json
{
"mcpServers": {
"codex-mcp-server": {
"command": "npx",
"args": [
"-y",
"codex-mcp-server"
]
}
}
}Install Codex MCP in VS Code
.vscode/mcp.json
{
"servers": {
"codex-mcp-server": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"codex-mcp-server"
]
}
}
}Install Codex MCP in VS Code CLI
$ code --add-mcp '{"name":"codex-mcp-server","type":"stdio","command":"npx","args":["-y","codex-mcp-server"]}'Install Codex MCP in Claude Desktop
claude_desktop_config.json
{
"mcpServers": {
"codex-mcp-server": {
"command": "npx",
"args": [
"-y",
"codex-mcp-server"
]
}
}
}Install Codex MCP in Codex
$ codex mcp add codex-mcp-server -- npx -y codex-mcp-serverInstall Codex MCP in Codex config.toml
~/.codex/config.toml
[mcp_servers.codex-mcp-server] command = "npx" args = ["-y", "codex-mcp-server"]
Install Codex MCP in Gemini CLI
$ gemini mcp add -s user codex-mcp-server npx -- -y codex-mcp-serverInstall Codex MCP in Gemini settings.json
~/.gemini/settings.json
{
"mcpServers": {
"codex-mcp-server": {
"command": "npx",
"args": [
"-y",
"codex-mcp-server"
]
}
}
}Codex MCP tools 5
Detected from the READMEcodexreviewwebsearchpinghelp
| codex | — | |
| review | — | |
| websearch | — | |
| ping | — | |
| help | — |
Automated checks
Ran Nov 14, 2026Full report →Passed our automated checks. That is not a security audit: read the code and give the server the narrowest access it needs. How checks work · What to fix for more points
- Source repository linked and reachabletuannvm/codex-mcp-server is public and reachablegithub.com/tuannvm/codex-mcp-server ↗Pass
- Package names this repository as its sourcecodex-mcp-server names tuannvm/codex-mcp-server as sourcenpmjs.com/package/codex-mcp-server ↗Pass
- Build provenance (Sigstore attestation)Sigstore attestation for codex-mcp-servernpmjs.com/package/codex-mcp-server/v/1.4.10#provenance ↗Pass
- Open source license (OSI)No licenseFinding
- Commit or release in the last yearLast commit or release 2026-05-25github.com/tuannvm/codex-mcp-server ↗Pass
- OpenSSF ScorecardNot checked
- Package name not close to a popular packageNo popular package one edit away from codex-mcp-serverPass
- No critical advisory in the package or its dependenciesNot checked
- No hidden instructions to the model5 tool descriptions and the README read; no override phrases, credential paths or hidden charactersPass
- Destructive tools are labelledNo tool named like delete, drop or execPass
- Remote endpoint answers the MCP handshakeNot checked
README
View on GitHubCodex 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:#FFA500
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
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 |
websearch |
Web search using Codex CLI with customizable result count and search depth |
listSessions |
View active conversation sessions |
ping |
Test server connection |
help |
Get Codex CLI help |
Examples
Code analysis:
Use codex to analyze this authentication logic for security issues
Multi-turn conversations:
Use codex with sessionId "refactor" to analyze this module
Use codex with sessionId "refactor" to implement your suggestions
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:
Use review with base "main" to check my PR changes
Use review with uncommitted true to review my local changes
Advanced 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 available
Web 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 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 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 tests
Related 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
Codex MCP questions
How do I add Codex MCP to Claude Code?
Run claude mcp add codex-mcp-server -- npx -y codex-mcp-server in your terminal. Add --scope user to make it available in every project.
How do I add Codex MCP to Cursor?
Open ~/.cursor/mcp.json and add the server under mcpServers, using the Cursor config shown in the install section above.
What tools does Codex MCP provide?
It exposes 5 tools, including codex, review, websearch, ping, help.
How do I install the Codex MCP Server?
You can add it to Claude Code by running: claude mcp add codex-cli -- npx -y codex-mcp-server
Can I perform code reviews on uncommitted changes?
Yes, you can use the review tool with the uncommitted flag set to true to review your local changes.
Does the server support web searching?
Yes, the websearch tool allows you to perform web searches using the Codex CLI with customizable result counts and depth.