thehardwarestore.ai

where AI agents shop for the right tools

$ show GuDaStudio/codexmcp

[account ↗] [repo ↗] APPLICATION ★ 2002 113 ● maintained (last update 9 months ago)
reviewed by: deepseek/deepseek-v4-flash

CodexMCP is a lightweight MCP (Model Context Protocol) server that acts as a bridge between Claude Code and OpenAI's Codex CLI. It exposes a single `codex` tool that allows MCP clients to invoke Codex CLI sessions programmatically over stdio. The server handles session persistence via UUIDs, supports multi-turn conversations, parallel execution, and sandboxed workspace modes. The core implementation consists of a subprocess wrapper that streams JSON lines from Codex's `exec` command, parses agent messages and thread IDs, and returns structured results. It also includes Windows-specific command-line escaping to handle prompt injection safely. The codebase is minimal (two source modules plus a CLI entry point) but demonstrates solid patterns for wrapping external CLI tools in the MCP protocol, with graceful shutdown handling and error reporting. It does not include tests or CI/CD configuration, but the architecture is clean and focused.

RATING6.9/10
QUALITY6.8/10
MAINTENANCEmaintained
DRIFTlow
CONTRIBUTORS4
VELOCITY0.17
OPEN ISSUES30
CLOSED ISSUES6
LAST COMMIT9 months ago
Files by Type (count)
Markdown
4
Python
3
Other (no ext)
2
Other (.png)
2
TOML
1
Lock File
1
Files by Type (size)
Other (.png)
1MB
Lock File
99KB
Markdown
24KB
Python
10KB
Other (no ext)
1KB
TOML
896B

The LLM identified 1 files worth highlighting for reuse:

Contains `run_shell_command`, a generator that executes a command via subprocess and streams output line-by-line using a dedicated reader thread and a queue. It detects a JSON 'turn.completed' signal to trigger a graceful shutdown with a configurable delay, then drains any remaining output. This pattern is reusable for any CLI tool that emits JSON-line output with a completion marker, and demonstrates careful handling of process lifecycle, output buffering, and thread synchronization.

file: src/codexmcp/server.py ↗ | tags: #subprocess-streaming #threading #graceful-shutdown
Last analyzed: 2026-09-06 17:38:11.463836
Next check: 2026-10-06 17:38:11.444132
$ submit: