Skip to content

Codex MCP ToolConnect the Codex CLI to the MCP Ecosystem

Leverage OpenAI's Codex models in any client that supports the standardized MCP protocolβ€”built for Claude Code

β€’β€’β€’

And much more to explore

What is Codex MCP Tool? ​

Codex MCP Tool is a Model Context Protocol (MCP) server that bridges the gap between OpenAI's powerful Codex CLI and the growing ecosystem of MCP-compatible clients. It allows AI assistants like Claude to leverage Codex's advanced code analysis and generation capabilities through a standardized protocol.

Key Features ​

  • πŸš€ Non-Interactive Execution: Runs codex exec commands programmatically
  • πŸ“ File Reference Support: Use @ syntax to include files in your prompts
  • πŸ”’ Sandbox Modes: Choose from read-only, workspace-write, or full access
  • βœ… Approval Policies: Control when human approval is needed
  • 🎯 Model Selection: Choose between GPT-5 and other available models
  • πŸ“Š Progress Tracking: Real-time updates for long-running operations
  • πŸ”„ Change Mode: Structured edit suggestions with OLD/NEW format

Use Cases ​

  • Code Analysis: Understand complex codebases with deep AI insights
  • Security Reviews: Find vulnerabilities and get remediation suggestions
  • Code Generation: Create new features with context-aware code generation
  • Refactoring: Modernize legacy code with intelligent suggestions
  • Documentation: Generate comprehensive docs from your codebase
  • Testing: Create unit tests that actually understand your code

Quick Start ​

For Claude Code Users ​

bash
# One-command installation
claude mcp add codex-cli -- npx -y codex-mcp-tool codex-mcp

# Verify installation
/mcp

For Claude Desktop Users ​

Add to your configuration file:

json
{
  "mcpServers": {
    "codex-cli": {
      "command": "npx",
      "args": ["-y", "codex-mcp-tool", "codex-mcp"]
    }
  }
}

For detailed installation and setup instructions, see our Getting Started Guide.

Example Commands ​

Once installed, you can use natural language or slash commands:

// Natural language
"use codex to analyze @src/main.ts and explain what it does"
"ask codex to find security vulnerabilities in this codebase"
"have codex refactor this function to use modern JavaScript"

// Slash commands (Claude Code)
/codex-cli:analyze @README.md summarize this file
/codex-cli:sandbox create a Python data processing script

Documentation ​

Community & Support ​

Acknowledgments ​

This project was inspired by the excellent work from jamubc/gemini-mcp-tool. Special thanks to @jamubc for the original MCP server architecture and implementation patterns.

License ​

This project is licensed under the MIT License. See the LICENSE file for details.

Disclaimer: This is an unofficial, third-party tool and is not affiliated with, endorsed, or sponsored by OpenAI.

Released under the MIT License.