Codex

v1.4.10Coding Agentsstable

MCP server wrapper for OpenAI Codex CLI that enables Claude Code to leverage Codex's AI capabilities directly.

claude-codecodexcursormcpopenai
Share:
462
Stars
0
Downloads
0
Weekly
0/5

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

Integrate OpenAI Codex capabilities into Claude Code.
Leverage Codex's AI capabilities directly through MCP.
tuannvm

Maintainer

LicenseMIT
Languagetypescript
Versionv1.4.10
UpdatedMay 21, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

NPM

npx -y codex-mcp-server

Manual Installation

npx -y codex-mcp-server

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

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
1

Install the OpenAI Codex CLI

The MCP server wraps the Codex CLI, so install it globally first.

npm i -g @openai/codex
2

Authenticate 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"
3

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-server
4

Configure 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"]
    }
  }
}
5

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.

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.

Quick Config Preview

{ "mcpServers": { "codex": { "command": "npx", "args": ["-y", "codex-mcp-server"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

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.

33,000+ ServersFree & Open SourceStep-by-Step Guides