OpenAI Codex MCP Server

OpenAI Codex MCP Server

openai-codex-mcp-tomatio13•bytomatio13

Wraps the OpenAI Codex CLI as an MCP server exposing tools for code generation, explanation, debugging, and interactive coding sessions with Claude.

License: MIT License with Attribution•Runtime: Awaiting documentation review•Category: developer tools

WHAT IT DOES

  • •Offers a codex_agent tool covering code generation, explanation, debugging, refactoring, security analysis, test creation, documentation generation, and multimodal image input.
  • •Provides a codex_interactive tool for starting interactive sessions.
  • •Runs over stdio mode for Claude Desktop or SSE mode for Web API access.
  • •Supports task_type optimization for specific tasks and approval modes ranging from suggest to full-auto.

BEST FOR

  • •Generating, explaining, debugging, or refactoring code from within Claude Desktop.
  • •Running security analysis and test creation tasks with configurable approval levels.
  • •Implementing UI designs from image inputs.

ABOUT OPENAI-CODEX-MCP-TOMATIO13

OpenAI Codex MCP Server is cataloged as an MCP server attributed to tomatio13. Wraps the OpenAI Codex CLI as an MCP server exposing tools for code generation, explanation, debugging, and interactive coding sessions with Claude. It is categorized under developer tools. See the capability inspector for recorded interfaces and their independent review status; consult upstream documentation for the current interface.

HOW TO INSTALL

Installation configuration is not reviewed. No executable setup is offered for this entry; inspect the source repository before proceeding.

LICENSE

Catalog license label: MIT License with Attribution. Check the source repository's current license and terms before using, modifying or distributing this software.

能力检查器

能力定义尚未审核。未核验的采集内容不会作为可信接口展示。

Tools (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

Resources (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

Prompts (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

NEWSLETTER - COMING LATER

Newsletter subscriptions are not open yet

Email delivery is not connected. This page does not collect email addresses or create subscriptions.

Browse the registry for current listings instead.

Community Reviews

Coming later

Reviews for OpenAI Codex MCP Server are not available yet

Review publishing and storage are not connected. This page does not collect or publish ratings or comments, including after sign-in.

FREQUENTLY ASKED QUESTIONS

Which AI providers can the codex_agent tool use?

The provider parameter supports openai, azure, gemini, ollama, mistral, deepseek, xai, and groq.

Is the full-auto approval mode sandboxed?

Yes, full-auto mode runs in a network-disabled sandbox, and file operations are limited to the current working directory.

上游原版 README

在 GitHub 查看同一版本原文

README.md · 66f13894366b · 采集于 2026-11-13 13:55:36 UTC

保留上游原文,不做 AI 改写。为安全起见过滤脚本、表单和不安全链接。

当前显示最后一次成功采集的文档快照,请以来源页面为准。

OpenAI Codex MCP Server

Python Version MCP Protocol OpenAI Codex License

JA doc EN doc

Wraps OpenAI Codex CLI as an MCP (Model Context Protocol) server for integration with Claude.

🚀 Features

This MCP server provides the following tools:

  • codex_agent: Comprehensive tool with access to all OpenAI Codex CLI features

    • Code generation, explanation, debugging, refactoring
    • Security analysis, test creation, documentation generation
    • Multimodal support (image input)
    • Multiple AI provider support
    • 3-level automation modes (suggest/auto-edit/full-auto)
  • codex_interactive: Tool for starting interactive sessions

🔌 Supported Modes

  • stdio mode: Uses standard input/output (for Claude Desktop)
  • SSE mode: Uses Server-Sent Events (for Web API)

📋 Prerequisites

  1. OpenAI Codex CLI:

    npm install -g @openai/codex
    
  2. Python 3.12 or higher

  3. Environment setup: Copy .env.example to .env and configure

🛠️ Installation

1. Clone the repository

git clone https://github.com/Tomatio13/openai-codex-mcp.git
cd openai-codex-mcp

2. Setup

./setup.sh

3. Start the server

stdio mode (for Claude Desktop)

./run.sh

SSE mode (for Web API)

./run_sse.sh [port] [host]

# Examples:
./run_sse.sh 8080 0.0.0.0  # Port 8080, listen on all interfaces
./run_sse.sh              # Default: localhost:8000

Manual startup

# stdio mode
python codex_server.py --mode stdio

# SSE mode
python codex_server.py --mode sse --port 8000 --host localhost

Or run setup and start in one command:

./setup_and_run.sh

Manual installation

# Install dependencies
pip install -e .

# Start server
python codex_server.py

🔧 Claude Configuration

To use the MCP server with Claude Desktop, add the following to your configuration file:

macOS

~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "openai-codex": {
      "command": "python",
      "args": ["/path/to/openai-codex-mcp/codex_server.py", "--mode", "stdio"],
      "env": {
        "PATH": "/usr/local/bin:/usr/bin:/bin"
      }
    }
  }
}

Windows

%APPDATA%\Claude\claude_desktop_config.json:

{
  "mcpServers": {
    "openai-codex": {
      "command": "python",
      "args": ["C:\\path\\to\\openai-codex-mcp\\codex_server.py", "--mode", "stdio"],
      "env": {
        "PATH": "C:\\Program Files\\nodejs;C:\\Windows\\System32"
      }
    }
  }
}

SSE mode

In SSE mode, you can access the MCP server via HTTP endpoints:

# Start server
./run_sse.sh 8000

# Available endpoints
# GET  http://localhost:8000/sse - SSE connection
# POST http://localhost:8000/message - Send message

💡 Usage

Once the MCP server is configured in Claude Desktop, you can use the tools as follows:

Basic code generation

@openai-codex codex_agent prompt="Create a Python function to calculate Fibonacci numbers"

Task-specific optimization

@openai-codex codex_agent prompt="Explain this code" task_type="code-explanation"
@openai-codex codex_agent prompt="Fix the bug in utils.py" task_type="debugging" model="o4-preview"
@openai-codex codex_agent prompt="Check for security vulnerabilities" task_type="security"

Automation level settings

# Suggestions only (default, safest)
@openai-codex codex_agent prompt="Refactor this code" approval_mode="suggest"

# Auto-edit (automatic file read/write, command execution requires confirmation)
@openai-codex codex_agent prompt="Explain this codebase" approval_mode="auto-edit"

# Full auto (fully automatic execution in network-disabled sandbox)
@openai-codex codex_agent prompt="Create and run tests" approval_mode="full-auto"

Multimodal (image input)

@openai-codex codex_agent prompt="Implement this UI design" images=["design.png"] task_type="code-generation"

Using different AI providers

@openai-codex codex_agent prompt="Review this code" provider="azure" model="gpt-4.1"
@openai-codex codex_agent prompt="Explain this" provider="ollama" model="llama3"

Interactive sessions

@openai-codex codex_interactive initial_prompt="Tell me about the project structure" approval_mode="auto-edit"

🎯 Task Types

Use the task_type parameter to generate prompts optimized for specific tasks:

  • general: General coding assistance (default)
  • code-generation: Generate new code
  • code-explanation: Explain existing code
  • debugging: Find and fix bugs
  • refactoring: Improve code structure
  • testing: Write or fix tests
  • security: Security analysis and fixes
  • documentation: Generate or improve documentation

🤖 AI Providers

Supported AI providers through the provider parameter:

  • openai: OpenAI (default)
  • azure: Azure OpenAI
  • gemini: Google Gemini
  • ollama: Ollama (local models)
  • mistral: Mistral AI
  • deepseek: DeepSeek
  • xai: xAI
  • groq: Groq

🔒 Approval Modes

  • suggest: Only suggests changes, requires approval for all actions (safest)
  • auto-edit: Can read and write files automatically, asks for shell commands
  • full-auto: Full autonomy with network-disabled sandbox (most powerful)

🛡️ Security

  • The full-auto mode runs in a network-disabled sandbox for security
  • File operations are limited to the current working directory
  • All shell commands require explicit approval unless in full-auto mode

🐛 Troubleshooting

Common Issues

  1. "codex command not found"

    npm install -g @openai/codex
    
  2. Permission denied on scripts

    chmod +x *.sh
    
  3. Python version issues

    • Ensure Python 3.12+ is installed
    • Use virtual environment: python3 -m venv venv && source venv/bin/activate
  4. MCP connection issues

    • Check Claude Desktop configuration file syntax
    • Verify file paths are absolute
    • Restart Claude Desktop after configuration changes

📝 License

MIT License with Attribution - see LICENSE file for details.

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

📞 Support

If you encounter any issues or have questions, please open an issue on GitHub.


Made with ❤️ for the Claude + OpenAI Codex community

Install configuration

Are you the maintainer?

Claim this server with your GitHub account to request manual ownership verification.

README Embed Badge
Markdown

Link to the catalog listing for OpenAI Codex MCP Server from your README. This badge does not certify ownership, compatibility or security.

[![MCP catalog listing](https://img.shields.io/badge/MCP-awesome--mcp-orange?style=flat-square)](https://awesome-mcp.com/servers/openai-codex-mcp-tomatio13)

REPOSITORY STATS

GitHub StarsUnavailable
ForksUnavailable

Public repository statistics could not be verified. Check the configured source address; unavailable counts are not zero.

下载与拉取统计

来源、范围和时段分别列出;不相加,不代表安装人数、活跃用户或安全审核。

尚无已审核的包 / 镜像标识,暂不展示下载统计。

Related developer tools MCP Servers

Alternative and complementary servers in the same category

View all in developer tools →
Postbye
postbye-mcp•postbye-team

A directory listing describing a cancellation-letter and mailing-address service. The configured public GitHub repository returned 404 during source verification.

Repository stats unavailable
Developer Tools
Singapore Proxy MCP
singapore-proxy-mcp•Xavierfok

A hosted MCP service for browsing and searching through Singapore mobile-network proxies.

0
Developer Tools

A directory listing describing a Markdown-to-PDF service. The configured public GitHub repository returned 404 during source verification.

Repository stats unavailable
Developer Tools