Skip to main content
Glama
codex-mcp-agent

codex-mcp-agent

codex-mcp-agent

中文版

Note: This project is a fork of the current Git remote:

Enable Claude Code, Cursor and other AI tools to call Codex for task execution. Plus/Pro/Team subscribers can maximize GPT-5 usage without additional costs.

Setup

1. Install Codex CLI

npm install -g @openai/codex
codex login

2. Configure MCP

Add to your .mcp.json: Safe Mode (Default):

{
  "mcpServers": {
    "codex": {
      "type": "stdio",
      "command": "uvx",
      "args": ["codex-mcp-agent@latest"]
    }
  }
}

Writable Mode:

{
  "mcpServers": {
    "codex": {
      "type": "stdio",
      "command": "uvx",
      "args": ["codex-mcp-agent@latest", "--yolo"]
    }
  }
}

Or use Claude Code commands:

# Safe mode (default)
claude mcp add codex-mcp-agent -- uvx codex-mcp-agent@latest

# Writable mode
claude mcp add codex-mcp-agent -- uvx codex-mcp-agent@latest --yolo

Related MCP server: Codex MCP Server

Tools

The MCP server exposes two tools:

  • codex_execute(prompt, work_dir) - General purpose codex execution

  • codex_review(review_type, work_dir, target?, prompt?) - Specialized code review

If you have any other use case requirements, feel free to open issue.

HTTP/SSE Mode (Optional)

For local personal use, you can run the server over HTTP with Server-Sent Events (SSE) and connect via type: "sse".

Start the server in SSE mode:

uvx codex-mcp-agent@latest --sse            # safe mode, localhost:8822
uvx codex-mcp-agent@latest --sse --yolo     # writable mode

# Options
#   --host  (default: 127.0.0.1)
#   --port  (default: 8822)

Configure your client .mcp.json:

{
  "mcpServers": {
    "codex": {
      "type": "sse",
      "url": "http://127.0.0.1:8822"
    }
  }
}

Notes:

  • SSE mode keeps the same Safe/Writable behavior controlled by --yolo.

  • SSE server binds to 127.0.0.1 by default and has no auth/CORS for simplicity.

  • Stdio mode remains the default; use --sse only if you prefer HTTP.

Optional: Streamable HTTP transport (if your client supports it):

uvx codex-mcp-agent@latest --http           # safe mode streamable-http transport

Safety

  • Safe Mode: Default read-only operations protect your environment

  • Writable Mode: Use --yolo flag when you need full codex capabilities

  • Sequential Execution: Prevents conflicts from parallel agent operations

Available Tools

3 tools
codex_executeD

Execute prompt using codex for general purpose.

Inputs: prompt (required), work_dir (required), ctx (required). Returns: result

codex_researchA

Produce an analysis report around a topic using the repository code.

    Args:
        system_prompt: High-level system guidance for the research process.
        work_dir: Repository/workspace directory to analyze.
        topic: Investigation topic or question to answer.
    

Inputs: system_prompt (required), work_dir (required), topic (required), ctx. Returns: result

codex_reviewC

Execute code review using codex with pre-defined review prompts.

Inputs: review_type (required), work_dir (required), target, prompt, +1 more. Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.1/5.0

    Scored across 3 tools

    Disambiguation5/5

    Each tool targets a distinct activity: general execution, repository research, and code review. No overlap in purpose.

    Naming Consistency5/5

    All tools follow a consistent 'codex_verb' pattern (execute, research, review), making them predictable and easy to distinguish.

    Tool Count5/5

    Three tools is well-scoped for a focused Codex-based agent, covering key functionalities without bloat.

    Completeness4/5

    The tools cover general execution, research, and code review, but could benefit from additional tools like code generation or explanation to fully round out the domain.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers