Self-hosted MCP server: run OpenAI Codex CLI prompts and manage workspace files.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent — or use 1-click editor setup below.
💡 Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
OpenAI Codex CLI inside an aicodebox container. Minimal and toolchain-loaded images, five ways in: interactive shell, one-shot exec, OpenAI-compatible endpoint, MCP server, Telegram bot, and a cron scheduler that fires codex on whatever schedule you want.
You talk to codexbox. codexbox talks to codex. codex talks to OpenAI — or your ChatGPT subscription. Nobody cares about the middle.
codexbox wrapperDocker installed and running is the only prerequisite.
The installer pulls the selected image, creates the persistent Codex and SSH
directories, downloads the wrapper, and installs codexbox on your PATH.
Installing with CODEXBOX_FULL=1 bakes latest-full into the wrapper, so the
choice persists; you do not need to export it again. CODEXBOX_FULL must be
set for bash, not merely for curl, hence the export … && form above.
From a checkout of this repository, build the matching image and install the local wrapper without pulling a published codexbox image:
These targets set CODEXBOX_SRC_LOCAL=true. make install and make install-full build their image first; make install-wrapper only installs the
local wrapper.sh against the selected existing image. It fails if that image
is absent instead of falling back to docker pull.
codexbox wrapperThe wrapper mounts the current directory as the workspace, persists ~/.codex
(so login survives container recreation), forwards auth and configured
environment variables, and manages a per-directory container.
The wrapper forwards "$@" straight to the image, so any codex subcommand works (codexbox mcp ..., codexbox doctor, etc.). The sandbox-bypass flag is injected inside the container — you never pass it yourself.
The bare interactive TUI defaults to continuing the most recent session for the directory you're in (same idea as claudebox's default) — codex's own resume --last cwd-scopes the lookup and starts a fresh session automatically when there's nothing to resume, so this is safe on a brand-new workspace too. Pass --no-continue to force a fresh session instead.
Use raw Docker only when you intentionally do not want the wrapper, such as a one-shot run or a long-running API service. The Modes section has the relevant commands and configuration.
psyb0t/codexbox:latest is the default minimal image: Codex, Node.js, Python, uv, Docker, Git, jq, and curl.psyb0t/codexbox:latest-full adds the general-purpose development toolchain from Claudebox's full image while retaining Codexbox's own adapter, entrypoint, auth, and config.CODEXBOX_FULL is binary: unset or 0 selects minimal; 1 selects full. Any other value fails. The installer writes the resolved image into the installed wrapper, so the choice persists without exporting the variable on every run. A runtime CODEXBOX_FULL=0 or CODEXBOX_FULL=1 temporarily forces a variant; CODEXBOX_IMAGE remains the highest-priority explicit override.
The full image adds:
The full variant is reproducible by design: its minimal parent and the
published aicodebox parent are digest-pinned; Node tools install through a
committed pnpm lockfile with lifecycle scripts disabled; Python tools install
from a committed hash-locked requirements file; and Go tools build from a
committed go.sum with the checksum database enabled. The lock inputs use a
fixed seven-day release-age cutoff and are refreshed deliberately, not during
an ordinary image build.
Licensing note: the minimal image is clean — just Apache-2.0 Codex on
top of the aicodebox base. The full image additionally bundles HashiCorp
Terraform, which is BUSL-1.1 (source-available, non-compete), not
OSI-approved open source. If that matters to your use case, stick to the
minimal image or review the BUSL-1.1 terms
yourself before using latest-full. Full breakdown in
THIRD_PARTY.md.
Set these on the host before running codexbox:
| Var | Default | What it does |
|---|---|---|
OPENAI_API_KEY | — | API-key auth (seeded into ~/.codex/auth.json on boot). Not needed for subscription login. |
OPENAI_BASE_URL | — | Point codex at an OpenAI-compatible endpoint |
CODEXBOX_IMAGE | installed image | Override the image the wrapper runs |
CODEXBOX_FULL | installed choice (0 initially) | 0 forces minimal; 1 forces full |
CODEXBOX_DATA_DIR | ~/.codex | Host dir mounted as CODEX_HOME (auth + config + sessions) |
CODEXBOX_SSH_DIR | ~/.ssh/codexbox | SSH key dir mounted into the container (for git over SSH) |
CODEXBOX_MAX_MEM | 10g | Per-container memory limit |
CODEXBOX_CONTAINER_NAME | derived from $PWD | Override the per-workspace container name |
CODEXBOX_ENV_* | — | Forward arbitrary env into the container (prefix stripped: CODEXBOX_ENV_FOO=bar → FOO=bar) |
CODEXBOX_MOUNT_* | — | Mount extra host dirs (/host:/container syntax, or a bare path for same-path-both-sides) |
CODEXBOX_MODE_CRON=1 + CODEXBOX_MODE_CRON_FILE=/path/cron.yaml codexbox starts the cron scheduler as a long-running background container instead.
Prefer no host install? Everything the wrapper does is plain docker run; see Manual Docker use and Modes.
Foreground modes (API / Telegram / Cron) are mutually exclusive — except CODEXBOX_TELEGRAM_MODE=1 + CODEXBOX_CRON_MODE=1, which run together (cron in-thread inside telegram). API wins if set alongside anything else.
MCP mode (CODEXBOX_MCP_MODE=1) is independent — it coexists with whatever foreground mode is running. In API mode it's mounted at /mcp on the API port; in other modes it runs as a sidecar uvicorn on its own port.
Each mode has its own page with full setup, env vars, and examples.
Long-lived FastAPI server on :8080. Agent runs (sync, async with run-id polling, cancellable), workspace file upload/download/list/delete with traversal checking, and an OpenAI-compatible chat/completions endpoint with streaming and client-executed tool calling. Codex's native --output-schema backs jsonSchema, so schema-conforming output needs no retries.
No reviews yet — be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/codexbox)<a href="https://allmcps.com/mcp/codexbox"><img src="https://allmcps.com/api/badge/codexbox?style=directory" alt="Codexbox on AllMCPs" /></a>