codex-cli-mcp-slim
v0.1.3A thin, auditable MCP server wrapping the Codex CLI (codex exec).
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
codex
Run a single non-interactive Codex session (`codex exec`) with the given prompt and return its final message. codex is an agentic coding assistant that reads and, depending on the sandbox, edits files inside the working directory. Forward-compatible: unknown CLI flags can be passed via `extra_args`. The codex binary path is configurable via $CODEX_CMD.
| Parameter | Type | Description |
|---|---|---|
prompt * | string | Prompt sent verbatim to codex on stdin. codex runs its full agentic loop and this server returns the final agent message. |
add_dir | array | Extra writable directories. Each entry maps to a separate codex --add-dir flag (repeatable, not comma-joined). |
cd | string | Pass -C <DIR>: the working directory codex runs in. Defaults to this server's own working directory. |
config | array | Configuration overrides as key=value strings, one per element. Each entry maps to a separate codex -c flag (for example "model_reasoning_effort=high"). Values are parsed as TOML by codex, so quote str… |
env | object | Extra environment variables for the codex subprocess. |
ephemeral | boolean | Pass --ephemeral: do not persist the session's rollout file to disk. |
extra_args | array | Raw CLI flags appended verbatim (one token per element). Use to reach new or uncommon codex exec flags without updating this server. Do not pass --json or a prompt: the server adds both. |
model | string | Pass -m <MODEL>: the model slug for this call, overriding config.toml. |
profile | string | Pass -p <PROFILE>: the config.toml profile to load. |
sandbox | string | Pass --sandbox <MODE>: read-only, workspace-write or danger-full-access. Overrides sandbox_mode from config.toml; network access still follows the [sandbox_workspace_write] section there. |
skip_git_repo_check | boolean | Pass --skip-git-repo-check: allow running in a directory that is not inside a git repository. Without it codex refuses such a working directory. |
timeout_seconds | integer | Hard wall-clock timeout for the codex subprocess in seconds (default 1800). |
codex-reply
Continue a previous Codex session (`codex exec resume <THREAD_ID>`) with a follow-up prompt and return the new final message. Only the flags `codex exec resume` accepts are exposed; the working directory and sandbox come from the current configuration (this server's own flags and config.toml), not from the original session.
| Parameter | Type | Description |
|---|---|---|
prompt * | string | Prompt sent verbatim to codex on stdin. codex runs its full agentic loop and this server returns the final agent message. |
thread_id * | string | The thread to continue: the thread_id from a previous result's [codex] line. Maps to codex exec resume <THREAD_ID>. |
config | array | Configuration overrides as key=value strings, one per element. Each entry maps to a separate codex -c flag (for example "model_reasoning_effort=high"). Values are parsed as TOML by codex, so quote str… |
env | object | Extra environment variables for the codex subprocess. |
ephemeral | boolean | Pass --ephemeral: do not persist the session's rollout file to disk. |
extra_args | array | Raw CLI flags appended verbatim (one token per element). Use to reach new or uncommon codex exec flags without updating this server. Do not pass --json or a prompt: the server adds both. |
model | string | Pass -m <MODEL>: the model slug for this call, overriding config.toml. |
skip_git_repo_check | boolean | Pass --skip-git-repo-check: allow running in a directory that is not inside a git repository. Without it codex refuses such a working directory. |
timeout_seconds | integer | Hard wall-clock timeout for the codex subprocess in seconds (default 1800). |