codex-mcp-async

codex-mcp-async

Enables Claude Code to run OpenAI Codex (GPT-5) tasks asynchronously in the background, filtering out thinking logs to save 95% context tokens and allowing parallel execution.

Category
Visit Server

README

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

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

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured