codex
Run a non-interactive agentic coding session from a prompt and return the final message; optionally reads and edits files in the working directory.
Instructions
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.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cd | No | Pass -C <DIR>: the working directory codex runs in. Defaults to this server's own working directory. | |
| env | No | Extra environment variables for the codex subprocess. | |
| model | No | Pass -m <MODEL>: the model slug for this call, overriding config.toml. | |
| config | No | 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 strings that are not bare words. | |
| prompt | Yes | Prompt sent verbatim to codex on stdin. codex runs its full agentic loop and this server returns the final agent message. | |
| add_dir | No | Extra writable directories. Each entry maps to a separate codex --add-dir flag (repeatable, not comma-joined). | |
| profile | No | Pass -p <PROFILE>: the config.toml profile to load. | |
| sandbox | No | 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. | |
| ephemeral | No | Pass --ephemeral: do not persist the session's rollout file to disk. | |
| extra_args | No | 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. | |
| timeout_seconds | No | Hard wall-clock timeout for the codex subprocess in seconds (default 1800). | |
| skip_git_repo_check | No | 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. |