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.
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.jsonto 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:
- Generate unit tests for utils.py
- Refactor database.py to use async/await
- 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 tasksmedium- 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-asyncruns 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
- Python 3.8+
- Codex CLI installed and authenticated
- Claude Code
- uvx (for easy installation)
License
MIT License - see LICENSE
Questions? Open an issue on GitHub.
Made with ❤️ for the Claude Code + Codex community
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。