codex-async-mcp
Provides asynchronous job management for OpenAI Codex CLI, allowing long-running code generation and editing tasks without blocking, including start, poll, list, and cancel operations.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@codex-async-mcp Start codex job to change format to number_to_currency in prorate_calculation_service.rb"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
agent-async-mcp
Local MCP server that runs Codex, Cursor, and Gemini CLI tasks asynchronously — returns a job_id immediately instead of blocking, so the orchestrating agent never hits the MCP 60-second timeout.
How it works
Claude (orchestrator)
│
├─ codex_start(prompt, cwd) → job_id (instant)
│
└─ codex_wait(job_id) → blocks up to 50 s, returns result
loop again on timeoutA sequential queue ensures only one agent process runs at a time. Jobs are persisted in SQLite so the queue survives server restarts.
Related MCP server: codex-mcp-bridge
Install
curl -fsSL https://raw.githubusercontent.com/benzkittisak/claude-codex-mcp/master/install.sh | bashThe installer will:
Clone this repo to
~/.local/share/agent-async-mcp/Create an isolated Python venv
Symlink
agent-asyncto~/.local/bin/Detect Claude Code, Codex, Cursor, Claude Desktop and ask which to register
Uninstall:
curl -fsSL https://raw.githubusercontent.com/benzkittisak/claude-codex-mcp/master/install.sh | bash -s uninstall
# or, if already installed:
agent-async uninstallCLI
agent-async list-agents # show detected / registered agents
agent-async add-agent claude-code # register with Claude Code CLI
agent-async add-agent codex # register with Codex CLI
agent-async add-agent cursor # register with Cursor IDE
agent-async add-agent claude-desktop # register with Claude Desktop
agent-async remove-agent <agent> # unregister
agent-async status # open real-time job monitor
agent-async update # pull latest + reinstall
agent-async check-update # check without installing
agent-async enable-auto-update # schedule daily auto-update (09:00)
agent-async disable-auto-update # remove scheduled auto-update
agent-async uninstall # remove everythingRequirements
Python 3.11+
One or more agent CLIs:
codex,cursor,gemini(optional — only needed for the tools you use)Claude Code CLI (recommended orchestrator)
MCP Tools (13 total)
Codex
Tool | Description |
| Queue a Codex task → returns |
| Block until done; loop on |
| Block until ANY queued job completes |
Cursor
Tool | Description |
| Queue a Cursor headless task → |
| Block until done |
Gemini
Tool | Description |
| Queue a Gemini CLI task → |
| Block until done |
| Ask Gemini to draft/publish a Confluence page |
| Ask Gemini to draft/publish a PR |
Shared / Queue
Tool | Description |
| List recent jobs (all agents), newest first |
| Cancel running or pending job |
|
|
| Called BY an agent to signal completion |
approval_policy values
Value | Behavior |
| No prompts, no sandbox (use for automation) |
| Auto-applies edits |
| Read-only — pauses for interactive input (avoid in automation) |
Permissions (settings.local.json)
Add to your Claude Code project's .claude/settings.local.json:
{
"permissions": {
"allow": [
"mcp__agent-async__codex_start", "mcp__agent-async__codex_wait",
"mcp__agent-async__cursor_start", "mcp__agent-async__cursor_wait",
"mcp__agent-async__gemini_start", "mcp__agent-async__gemini_wait",
"mcp__agent-async__queue_status", "mcp__agent-async__job_list",
"mcp__agent-async__job_cancel", "mcp__agent-async__agent_notify_done",
"mcp__agent-async__codex_await_any"
]
}
}Usage pattern
# Start a job (returns immediately)
result = codex_start(
prompt="In app/services/foo.rb line 42, change X to Y. Do not change anything else.",
cwd="/path/to/repo",
approval_policy="full-auto"
)
job_id = result["job_id"]
# Wait in a loop (each call blocks up to 50 s)
while True:
result = codex_wait(job_id, timeout_seconds=50)
if result["status"] == "timeout":
continue
break # "done" | "error" | "cancelled"Job data
Jobs are persisted in ~/.agent-async/:
~/.agent-async/
queue.db ← SQLite: job metadata, status, token usage
jobs/<job_id>/
output.txt ← stdout + stderr from the agent processTroubleshooting
agent-async: command not found
~/.local/bin not in PATH. Run:
source ~/.zshrc # or ~/.bashrcOr open a new terminal. The installer adds it automatically.
status: "error" immediately after *_start
The agent CLI failed to start. Check output:
cat ~/.agent-async/jobs/<job_id>/output.txtMessage | Fix |
| Install codex: |
| Install gemini CLI from github.com/google-gemini/gemini-cli |
|
|
status: "running" forever
The subprocess is hung. Most common cause: approval_policy="suggest" waiting for interactive input. Always use "full-auto" for automation.
agent-async status # open monitor to see live stateCancel a stuck job:
job_cancel(job_id="<job_id>")Old jobs filling up disk
find ~/.agent-async/jobs -maxdepth 1 -type d -mtime +7 -exec rm -rf {} +Project structure
agent-async-mcp/
├── install.sh
├── mcp-monitor.py
├── pyproject.toml
└── src/
└── agent_async_mcp/
├── server.py # MCP entry point, tool definitions
├── job_manager.py # queue, spawn, wait, cancel
├── db.py # SQLite schema + helpers
├── config.py # paths, timeouts, agent binaries
└── cli.py # agent-async CLIDevelopment
git clone https://github.com/benzkittisak/claude-codex-mcp
cd claude-codex-mcp
pip install -e ".[dev]"
pytest tests/ -vAvailable Tools
4 toolscodex_cancelA
Cancel a running codex job by sending SIGTERM to the subprocess.
Inputs: job_id (required). Returns: object
codex_listA
List recent codex jobs with their status and prompt summaries.
Inputs: limit. Returns: result
codex_pollA
Poll the status and output of a running (or finished) codex job.
Inputs: job_id (required), tail_lines. Returns: object
codex_startA
Start a codex task asynchronously in the background.
Returns a job_id immediately — does not block or timeout. Use codex_poll(job_id) to check progress.
Inputs: prompt (required), cwd (required), approval_policy. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
Each tool has a distinct purpose: start, list, poll, and cancel. There is no overlap in functionality, and the descriptions clearly differentiate them.
All tools follow a consistent 'codex_verb' pattern using snake_case, making it predictable for an agent to infer tool behavior from the name.
Four tools cover the essential operations for managing async jobs (start, list, poll, cancel) without redundancy or missing critical actions.
The tool set covers the full lifecycle of an async job: initiating (start), monitoring (poll, list), and termination (cancel). No obvious gaps are present.
Maintenance
Related MCP Connectors
Hosted MCP server for task-first delegation to remote workstations and workers.
MCP server for the FFmpeg Micro video transcoding API — create, monitor, download transcodes.
MCP server for mandates, delegation, policy-gated execution, credential grants, and audit.
An MCP server for search and retrieval over a local LanceDB database
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceWraps OpenAI Codex CLI as an MCP server, exposing 8 Codex tools (exec, review, skill list, skill run, status, poll, list jobs, kill) as named tools for use with pi or codex.1,488 npmISC
- AlicenseAqualityCmaintenanceMCP server that wraps Codex CLI as a subprocess, exposing code execution, web search, and structured output as Model Context Protocol tools.883 npm3MIT
- AlicenseNot gradedqualityBmaintenanceA local STDIO MCP server that bridges MCP clients to the Codex CLI by sending instructions to a configured workspace, exposing task run, status, and result tools with a read-only sandbox and no remote transport.135MIT
- AlicenseNot gradedqualityDmaintenanceMCP server that lets MCP clients inspect, create, update, and deploy ChatGPT Sites through a local Codex installation.1MIT