Skip to main content
Glama

Codex MCP Async Server

Asynchronous MCP wrapper for OpenAI Codex CLI with 95% context savings

Enable Claude Code to call Codex (GPT-5) asynchronously, filtering out thinking processes to save 95% context tokens.

Features

  • โœ… Async execution - Start Codex tasks in background, continue working

  • โœ… Context-efficient - Filters thinking/exec logs, returns only core results

  • โœ… Full control - Access all Codex models and reasoning efforts

  • โœ… Zero config - Works out of the box with Claude Code

Related MCP server: claude-code

Quick Start

๐Ÿš€ Install with UVX

Zero configuration - just run:

uvx codex-mcp-async

Configure Claude Code

Add to your ~/.claude/settings.json:

{
  "mcpServers": {
    "codex-mcp": {
      "command": "uvx",
      "args": ["codex-mcp-async"],
      "env": {}
    }
  }
}

Or use the provided config: Copy mcp-config.json to your Claude settings directory

Restart Claude Code

Reload or restart Claude Code to load the MCP server.

Usage Examples

๐Ÿš€ Async Execution (Game Changer!)

Start a long Codex task and continue working immediately:

You:

Please analyze this entire codebase and generate comprehensive documentation

Claude: I'll analyze your entire codebase and generate comprehensive documentation. This is a large task, so I'll start it asynchronously...

โœ… Task Started (Task ID: abc12345) You can continue working on other things while it runs in the background!

You: (Continue working immediately)

While the documentation is being generated, help me fix this bug

Claude: Sure! Let me help you fix that bug...

You: (A few minutes later)

Can you check if the documentation task is finished?

Claude: โœ… Documentation Complete!

[View Generated Documentation]

  • API reference

  • Code examples

  • Architecture overview

  • Setup instructions

โšก Parallel Execution

Run multiple Codex tasks simultaneously:

You:

I need to do three things at once:

  1. Generate unit tests for utils.py

  2. Refactor database.py to use async/await

  3. Add type hints to all functions in api.py

Claude: I'll start all three tasks in parallel!

๐Ÿ”„ Task 1 Started (Task ID: task1) - Generating unit tests ๐Ÿ”„ Task 2 Started (Task ID: task2) - Refactoring database code ๐Ÿ”„ Task 3 Started (Task ID: task3) - Adding type hints

All tasks are running in parallel...

You: (Later)

Are all three tasks finished?

Claude: โœ… All Complete!

  • โœ… Task 1: Unit tests for utils.py generated

  • โœ… Task 2: database.py refactored to async mode

  • โœ… Task 3: Type hints added to api.py functions

๐ŸŽฏ Quick Sync Tasks

For simple immediate tasks:

You:

Write a Python function to validate email addresses

Claude:

import re

def validate_email(email):
    pattern = r'^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$'
    return re.match(pattern, email) is not None

# Usage examples
print(validate_email("user@example.com"))  # True
print(validate_email("invalid-email"))    # False

โœ… Task Complete!

๐Ÿง  Model Selection

You:

Analyze this research paper using GPT-5 with high reasoning

Claude:

# Uses analysis model instead of coding model
mcp__codex_mcp__codex_execute(
    prompt="Analyze this research paper on machine learning",
    args=["--full-auto", "-m", "gpt-5", "--config", "model_reasoning_effort=high"]
)

Why Async + Context Filtering?

Problem 1: Codex blocks Claude Code while running. Problem 2: Codex outputs 3000+ tokens of thinking logs for every task.

Solution: This MCP server runs Codex asynchronously and filters out 95% of the noise.

Benefits:

  • ๐Ÿš€ Start a task and continue working immediately

  • โšก Run multiple tasks in parallel

  • ๐Ÿ’พ 95% context savings (3000 tokens โ†’ 150 tokens)

  • ๐ŸŽฏ Clean, focused results only

  • ๐Ÿงน Automatic process cleanup

Advanced Usage

Model Selection

gpt-5-codex (default) - Best for coding, debugging, implementation gpt-5 - Best for analysis, planning, research

Reasoning Levels

  • minimal/low - Quick tasks

  • medium - Standard work (default)

  • high - Complex problems

Example Configurations

# Quick coding task
args=["--full-auto", "--config", "model_reasoning_effort=low"]

# Complex analysis
args=["--full-auto", "-m", "gpt-5", "--config", "model_reasoning_effort=high"]

# Web search + analysis
args=["--full-auto", "--search", "-m", "gpt-5"]

Architecture & Performance

Claude Code (you)
    โ†“ calls MCP tool
codex-mcp-async (runs Codex in background)
    โ†“ filters thinking logs (95% savings!)
Codex CLI (GPT-5)
    โ†“ returns clean result
Claude Code (receives focused output)

Context Savings:

  • Before: 3600 tokens (thinking + logs + result)

  • After: 180 tokens (clean result only)

  • 95% reduction!

Troubleshooting

Server not showing up?

  • Check: uvx codex-mcp-async runs without errors

  • Restart Claude Code after config change

Task stuck in "running"?

  • Large tasks take time to complete

  • Check debug logs: /tmp/codex_mcp_debug.log

Context too large?

  • Enable filtering: Always use async mode for long tasks

  • Split large tasks into smaller chunks

Requirements

License

MIT License - see LICENSE


Questions? Open an issue on GitHub.

Made with โค๏ธ for the Claude Code + Codex community

Available Tools

3 tools
codex_check_resultA

Check the status of an async Codex task. Returns running/completed status and the result if available.

ParametersJSON Schema
NameRequiredDescriptionDefault
task_idYesThe task_id returned by codex_execute_async

TDQS

A4/5.0
Behavior4/5

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

No annotations provided, so the description bears full burden. It transparently discloses that it returns running/completed status and result if available. However, it lacks details on error handling (e.g., task not found) or whether the call blocks.

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

Conciseness5/5

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

A single, well-structured sentence that front-loads the purpose and delivers key behavioral details without wasting words.

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?

For a simple checker tool with one parameter and no output schema, the description is largely complete. It covers status outcomes and result availability, though adding a note about potential error states would improve completeness.

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

Parameters3/5

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

Schema coverage is 100% with the schema description already explaining the parameter. The tool description adds no new meaning beyond what the schema provides, so baseline 3 is appropriate.

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 the tool checks status of an async Codex task, with specific verb 'Check' and resource 'async Codex task'. It distinguishes from siblings by focusing on polling/completion, while codex_execute presumably runs synchronously and codex_execute_async initiates the task.

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 after codex_execute_async by mentioning 'task_id returned by codex_execute_async' in the schema, but it does not explicitly state when to use or not use this tool, nor does it provide direct alternatives beyond naming siblings.

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

codex_executeA

Execute OpenAI Codex (GPT-5) synchronously with full control over subcommand and arguments. Returns only the core result, filtering out thinking process to save context. Common usage: subcommand="exec", prompt="your task", args=["--full-auto"]

ParametersJSON Schema
NameRequiredDescriptionDefault
argsNoAdditional command-line arguments. Model selection: ["-m", "gpt-5-codex"] for coding (default) or ["-m", "gpt-5"] for analysis. Reasoning effort: ["--config", "model_reasoning_effort=low|medium|high"] (gpt-5-codex supports low/medium/high; gpt-5 supports minimal/low/medium/high). Example: ["--full-auto", "-m", "gpt-5", "--config", "model_reasoning_effort=high"]. Always include "--full-auto" for non-interactive execution.
promptNoMain prompt/argument for the command (required for exec, optional for others)
timeoutNoTimeout in seconds (default: no limit)
subcommandNoCodex subcommand to executeexec

TDQS

A3.5/5.0
Behavior3/5

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

No annotations present, so the description carries the full burden. It discloses that execution is synchronous and that the thinking process is filtered out, but does not address error handling, timeouts, authentication needs, or potential side effects.

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

Conciseness5/5

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

The description is three sentences, front-loading the core purpose and key behavioral trait (synchronous, filters thinking). No redundant information.

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

Completeness3/5

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

Given the absence of an output schema, the description should clarify the return format beyond 'core result.' It also lacks guidance on error conditions. However, the example usage helps contextualize parameter use.

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

Parameters3/5

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

Schema description coverage is 100%, and the schema already provides detailed parameter documentation. The description adds a common usage example but does not significantly extend meaning beyond the schema.

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 clearly states 'Execute OpenAI Codex (GPT-5) synchronously' with specific verb and resource. It mentions synchronization, which hints at differentiation from the async sibling, but does not explicitly contrast them.

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 provides a common usage example and mentions subcommands, but does not explicitly state when to use this tool versus the async sibling or other alternatives. No when-not-to-use guidance is given.

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

codex_execute_asyncA

Start a Codex task in the background and return immediately with a task_id. Use codex_check_result to retrieve the result later. This allows you to continue working while Codex runs.

ParametersJSON Schema
NameRequiredDescriptionDefault
argsNoAdditional command-line arguments. Model selection: ["-m", "gpt-5-codex"] for coding (default) or ["-m", "gpt-5"] for analysis. Reasoning effort: ["--config", "model_reasoning_effort=low|medium|high"] (gpt-5-codex supports low/medium/high; gpt-5 supports minimal/low/medium/high). Example: ["--full-auto", "-m", "gpt-5", "--config", "model_reasoning_effort=high"]. Always include "--full-auto" for non-interactive execution.
promptNoMain prompt/argument for the command
subcommandNoCodex subcommand to executeexec

TDQS

A4/5.0
Behavior3/5

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

No annotations are provided, so the description must cover behavioral traits. It discloses the key behavior (async, returns task_id) but does not mention limitations, error handling, permissions, or side effects. It is adequate but not comprehensive.

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

Conciseness5/5

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

The description is concise with three sentences, front-loaded with the primary purpose. Every sentence adds value: first gives action, second explains retrieval, third states benefit. No wasted words.

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?

The description covers the core asynchronous flow and how to retrieve results, which is sufficient given the tool's simplicity and the schema's completeness. It could briefly mention subcommand defaults or args usage, but the schema handles that.

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

Parameters3/5

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

Schema coverage is 100%, so the baseline is 3. The description does not add any parameter-specific information; it only describes the overall tool behavior. The schema already documents each parameter with 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 'Start a Codex task in the background and return immediately with a task_id', specifying the verb and resource, and differentiates from sibling tools by noting the asynchronous behavior and the need to use codex_check_result to retrieve results.

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

Usage Guidelines4/5

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

The description explains that the tool allows you to continue working while Codex runs, and instructs to use codex_check_result to retrieve results later. This implies when to use it versus the synchronous codex_execute, but does not explicitly exclude other scenarios.

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

TDQS

A3.8/5.0
Disambiguation5/5

Each tool serves a distinct purpose: synchronous execution, async execution, and result checking. No overlap exists between these operations.

Naming Consistency4/5

All tools start with 'codex_', but there is a slight inconsistency: 'codex_execute' lacks a 'sync' modifier while its async counterpart has it, and 'codex_check_result' uses a noun phrase. Still, the pattern is mostly predictable.

Tool Count4/5

With only 3 tools, the server is minimal but appropriately scoped for its purpose of providing both sync and async code execution with result retrieval.

Completeness3/5

The core execution and result checking are covered, but missing features like cancelling async tasks or listing pending tasks create minor gaps in the lifecycle.

Maintenance

ActivityInactive
ResponsivenessNo issues

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/jeanchristophe13v/codex-mcp-async'

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