Skip to main content
Glama
1WorldCapture

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
promptYes
work_dirYes
ctxYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

D1.8/5.0
Behavior1/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, and the description fails to disclose any behavioral traits such as side effects, authentication requirements, rate limits, or what happens upon execution. The agent has no insight into the tool's safety or behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness2/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single short sentence, but this conciseness comes at the cost of necessary detail. It is under-specification rather than efficient communication.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness1/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has 3 required parameters, a complex input, and an output schema but no annotations, the description is severely incomplete. It fails to provide essential context for correct invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%. The description does not elaborate on any of the three parameters (prompt, work_dir, ctx), nor does it explain the complex Context object. The agent receives no additional meaning beyond the bare schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description states 'Execute prompt using codex for general purpose', which is somewhat clear but vague. It does not distinguish from sibling tools codex_research and codex_review, leaving the agent guessing about the specific behavior.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool vs alternatives. The description provides no context about prerequisites, exclusions, or scenarios where codex_execute is preferred over codex_research or codex_review.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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.
    
ParametersJSON Schema
NameRequiredDescriptionDefault
system_promptYes
work_dirYes
topicYes
ctxNo

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A3.9/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, so description carries full burden. It states the tool produces a report but does not disclose side effects, auth needs, or output format. Adequate but minimal.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise with a clear docstring format listing parameters. It avoids extraneous information, though it could be slightly more structured.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations, no output schema description, and moderate complexity (4 params, 3 required), the description adequately covers the tool's purpose and core parameters. It lacks details on return value or behavior beyond 'produce a report', but is sufficient for basic use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema has 0% description coverage. The description adds meaning to all three required parameters (e.g., 'high-level system guidance', 'repository/workspace directory', 'investigation topic'). The optional ctx parameter is not mentioned, but it's internal. Overall, description compensates well for lack of schema descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states it produces an analysis report about a topic using repository code, with a specific verb and resource. This distinguishes it from sibling tools codex_execute (execution) and codex_review (review).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for research/analysis but provides no explicit guidance on when to use vs. alternatives like codex_execute or codex_review, nor any conditions for use.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

codex_reviewC

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

ParametersJSON Schema
NameRequiredDescriptionDefault
review_typeYes
work_dirYes
targetNo
promptNo
ctxNo

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

C2.3/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. However, it only mentions 'pre-defined review prompts,' giving a slight hint about input constraints, but omits critical details like whether the tool is read-only, whether it modifies state, or what side effects occur.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness2/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence, which is concise but overly brief given the tool's complexity (5 parameters, no schema descriptions). It fails to earn its place by omitting essential details, making it under-specified rather than efficiently concise.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness1/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Considering the tool has 5 parameters, 0% schema description coverage, no annotations, and an output schema that is not explained, the description is severely incomplete. It does not address how parameters interact, what valid inputs are, or what the tool returns, leaving the agent with insufficient information to use it effectively.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema has 0% description coverage for parameters, so the description must compensate. Yet it adds no meaning to review_type, work_dir, target, prompt, or ctx. The agent gains no insight into what these parameters represent or how to use them correctly.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states 'Execute code review using codex with pre-defined review prompts,' which clearly identifies the tool's purpose as code review. While it distinguishes from siblings like codex_execute and codex_research by focusing on review, it does not elaborate on what makes this review tool unique.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

There is no guidance on when to use this tool versus the alternatives codex_execute or codex_research. The description lacks context about typical use cases or prerequisites, leaving the agent without decision support.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

TDQS

B3.1/5.0
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
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/1WorldCapture/codex-as-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server