Codex
MCP server wrapper for OpenAI Codex CLI that enables Claude Code to leverage Codex's AI capabilities directly.
What is Codex?
Codex is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to mcp server wrapper for openai codex cli that enables claude code to leverage codex's ai capabilities directly.
MCP server wrapper for OpenAI Codex CLI that enables Claude Code to leverage Codex's AI capabilities directly.
This server falls under the Coding Agents category on MCPgee, the world's largest MCP server directory with 33,000+ servers.
Features
- MCP server wrapper for OpenAI Codex CLI that enables Claude
Use Cases
Maintainer
Works with
Installation
NPM
npx -y codex-mcp-serverManual Installation
npx -y codex-mcp-serverConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
How to Set Up and Use Codex
The Codex MCP Server wraps the OpenAI Codex CLI as a set of MCP tools, letting Claude Code and Cursor invoke Codex's AI coding capabilities directly within their existing workflow. It exposes tools for AI-assisted coding with session continuity, code review of uncommitted changes or branches, web search, and session management — effectively turning Codex into a callable sub-agent that Claude can delegate tasks to.
Prerequisites
- Node.js 18 or later
- OpenAI Codex CLI installed globally: npm i -g @openai/codex
- An OpenAI API key with access to Codex models
- Claude Code, Cursor, or another MCP-compatible client
Install the OpenAI Codex CLI
The MCP server wraps the Codex CLI, so install it globally first.
npm i -g @openai/codexAuthenticate Codex with your OpenAI API key
Log in to Codex so it can make API calls. Your key is stored locally.
codex login --api-key "your-openai-api-key"Add the Codex MCP server to Claude Code
Register the MCP server using the Claude Code CLI.
claude mcp add codex-cli -- npx -y codex-mcp-serverConfigure in Claude Desktop (alternative)
Add the server to claude_desktop_config.json for Claude Desktop use.
{
"mcpServers": {
"codex": {
"command": "npx",
"args": ["-y", "codex-mcp-server"]
}
}
}Restart your client and verify
Restart Claude Code or Claude Desktop. The codex, review, websearch, listSessions, ping, and help tools should now be available.
Codex Examples
Client configuration
Claude Desktop configuration for the Codex MCP Server.
{
"mcpServers": {
"codex": {
"command": "npx",
"args": ["-y", "codex-mcp-server"]
}
}
}Prompts to try
Tasks that combine Claude's reasoning with Codex's coding capabilities.
- "Use codex to analyze this authentication logic for security vulnerabilities."
- "Use codex with sessionId 'refactor' to analyze this module and suggest improvements."
- "Use review with base 'main' to check my uncommitted PR changes."
- "Use codex with model 'o3' and reasoningEffort 'high' to solve this complex algorithm problem."
- "Use websearch with query 'TypeScript 5.8 new features' and numResults 15 to find the latest docs."Troubleshooting Codex
codex login fails with 'command not found'
Ensure npm's global bin directory is in your PATH. Run 'npm root -g' to find the global modules path, then verify the parent bin/ folder is in PATH. Re-run 'npm i -g @openai/codex' if needed.
MCP server starts but codex tool returns API errors
Verify your OpenAI API key has access to the Codex models by testing directly with 'codex "hello"' in the terminal. Check your OpenAI account for quota or billing issues.
Session-based calls lose context between turns
Pass a consistent sessionId parameter (e.g. 'refactor' or 'debug-session') across all related codex tool calls. Without a sessionId, each call starts a fresh context.
Frequently Asked Questions about Codex
What is Codex?
Codex is a Model Context Protocol (MCP) server that mcp server wrapper for openai codex cli that enables claude code to leverage codex's ai capabilities directly. It connects AI assistants to external tools and data sources through a standardized interface.
How do I install Codex?
Install via npm with the command: npx -y codex-mcp-server. Then add the server configuration to your AI client's JSON config file (e.g., claude_desktop_config.json or .cursor/mcp.json).
Which AI clients work with Codex?
Codex works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.
Is Codex free to use?
Yes, Codex is open source and available under the MIT license. You can use it freely in both personal and commercial projects.
Codex Alternatives — Similar Coding Agents Servers
Looking for alternatives to Codex? Here are other popular coding agents servers you can use with Claude, Cursor, and VS Code.
Dify
★ 142.2kProduction-ready platform for agentic workflow development.
Ruflo
★ 54.0k🌊 The leading agent orchestration platform for Claude. Deploy intelligent multi-agent swarms, coordinate autonomous workflows, and build conversational AI systems. Features enterprise-grade architecture, self-learning swarm intelligence, RAG integrat
Goose
★ 45.7kan open source, extensible AI agent that goes beyond code suggestions - install, execute, edit, and test with any LLM
Antigravity Awesome Skills
★ 38.3kInstallable GitHub library of 1,400+ agentic skills for Claude Code, Cursor, Codex CLI, Gemini CLI, Antigravity, and more. Includes installer CLI, bundles, workflows, and official/community skill collections.
AgentScope
★ 25.5kBuild and run agents you can see, understand and trust.
Serena
★ 24.5kA coding agent toolkit that provides IDE-like semantic code retrieval and editing tools, enabling LLMs to efficiently navigate and modify codebases using symbol-level operations instead of basic file reading and string replacements.
Browse More Coding Agents MCP Servers
Explore all coding agents servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.
Set Up Codex in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
Ready to use Codex?
Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.