MCPHub LabRegistrycodex-mcp-server
tuannvm

codex mcp server

Built by tuannvm 358 stars

What is codex mcp server?

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

How to use codex mcp server?

1. Install a compatible MCP client (like Claude Desktop). 2. Open your configuration settings. 3. Add codex mcp server using the following command: npx @modelcontextprotocol/codex-mcp-server 4. Restart the client and verify the new tools are active.
🛡️ Scoped (Restricted)
npx @modelcontextprotocol/codex-mcp-server --scope restricted
🔓 Unrestricted Access
npx @modelcontextprotocol/codex-mcp-server

Key Features

Native MCP Protocol Support
Real-time Tool Activation & Execution
Verified High-performance Implementation
Secure Resource & Context Handling

Optimized Use Cases

Extending AI models with custom local capabilities
Automating system workflows via natural language
Connecting external data sources to LLM context windows

codex mcp server FAQ

Q

Is codex mcp server safe?

Yes, codex mcp server follows the standardized Model Context Protocol security patterns and only executes tools with explicit user-granted permissions.

Q

Is codex mcp server up to date?

codex mcp server is currently active in the registry with 358 stars on GitHub, indicating its reliability and community support.

Q

Are there any limits for codex mcp server?

Usage limits depend on the specific implementation of the MCP server and your system resources. Refer to the official documentation below for technical details.

Official Documentation

View on GitHub

Codex MCP Server

npm version npm downloads license

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

VS Code VS Code Insiders Cursor

Tools

ToolDescription
codexAI coding assistant with session support, model selection, and structured output metadata
reviewAI-powered code review for uncommitted changes, branches, or commits
websearchWeb search using Codex CLI with customizable result count and search depth
listSessionsView active conversation sessions
pingTest server connection
helpGet 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/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

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

License

ISC

Global Ranking

-
Trust ScoreMCPHub Index

Based on codebase health & activity.

Manual Config

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