codex-cli-mcp-slim

v0.1.3
codex-cli-mcp-slim Checked 4 days ago Published 19 days ago

A 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.

ParameterTypeDescription
prompt *stringPrompt sent verbatim to codex on stdin. codex runs its full agentic loop and this server returns the final agent message.
add_dirarrayExtra writable directories. Each entry maps to a separate codex --add-dir flag (repeatable, not comma-joined).
cdstringPass -C <DIR>: the working directory codex runs in. Defaults to this server's own working directory.
configarrayConfiguration 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…
envobjectExtra environment variables for the codex subprocess.
ephemeralbooleanPass --ephemeral: do not persist the session's rollout file to disk.
extra_argsarrayRaw 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.
modelstringPass -m <MODEL>: the model slug for this call, overriding config.toml.
profilestringPass -p <PROFILE>: the config.toml profile to load.
sandboxstringPass --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_checkbooleanPass --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_secondsintegerHard 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.

ParameterTypeDescription
prompt *stringPrompt sent verbatim to codex on stdin. codex runs its full agentic loop and this server returns the final agent message.
thread_id *stringThe thread to continue: the thread_id from a previous result's [codex] line. Maps to codex exec resume <THREAD_ID>.
configarrayConfiguration 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…
envobjectExtra environment variables for the codex subprocess.
ephemeralbooleanPass --ephemeral: do not persist the session's rollout file to disk.
extra_argsarrayRaw 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.
modelstringPass -m <MODEL>: the model slug for this call, overriding config.toml.
skip_git_repo_checkbooleanPass --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_secondsintegerHard wall-clock timeout for the codex subprocess in seconds (default 1800).