Spawn multiple specialized Codex agents as MCP servers, each independently configured.
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.
One brain, many arms.
An MCP server that wraps the OpenAI Codex SDK, letting you run multiple specialized Codex agents β each with its own model, sandbox, effort, and personality β from any MCP client.
Codex is powerful. But one instance does everything the same way. Sometimes you want a strict code reviewer in read-only sandbox. A test writer with workspace-write access. A cheap quick helper on minimal effort. A deep thinker on xhigh.
Codex Octopus lets you spin up as many of these as you need. Same binary, different configurations. Each one shows up as a separate tool in your MCP client.
@openai/codex)CODEX_API_KEY env var) or inherited from parent processOr use npx directly in your .mcp.json (see Quick Start below).
Add to your .mcp.json:
This gives you two tools: codex and codex_reply. That's it β you have Codex as a tool.
The real power is running several instances with different configurations:
Your MCP client now sees three distinct tools β code_reviewer, test_writer, quick_qa β each purpose-built.
Don't want to write configs by hand? Add a factory instance:
This exposes a single create_codex_mcp tool β an interactive wizard. Tell it what you want ("a strict code reviewer with read-only sandbox") and it generates the .mcp.json entry for you.
Each non-factory instance exposes:
| Tool | Purpose |
|---|---|
<name> | Send a task to the agent, get a response + thread_id |
<name>_reply | Continue a previous conversation by thread_id |
Per-invocation parameters (override server defaults):
| Parameter | Description |
|---|---|
prompt | The task or question (required) |
cwd | Working directory override |
model | Model override |
additionalDirs | Extra directories the agent can access |
effort | Reasoning effort (minimal to xhigh) |
sandboxMode | Sandbox override (can only tighten, never loosen) |
approvalPolicy | Approval override (can only tighten, never loosen) |
networkAccess | Enable network access from sandbox |
webSearchMode | Web search: disabled, cached, live |
instructions | Additional instructions (prepended to prompt) |
All configuration is via environment variables in .mcp.json. Every env var is optional.
| Env Var | Description | Default |
|---|---|---|
CODEX_TOOL_NAME | Tool name prefix (<name> and <name>_reply) | codex |
CODEX_DESCRIPTION | Tool description shown to the host AI | generic |
CODEX_SERVER_NAME | MCP server name in protocol handshake | codex-octopus |
CODEX_FACTORY_ONLY | Only expose the factory wizard tool | false |
| Env Var | Description | Default |
|---|---|---|
CODEX_MODEL | Model (gpt-5-codex, o3, codex-1, etc.) | SDK default |
CODEX_CWD | Working directory | process.cwd() |
CODEX_SANDBOX_MODE | read-only, workspace-write, danger-full-access | read-only |
CODEX_APPROVAL_POLICY | never, on-failure, on-request, untrusted | on-failure |
CODEX_EFFORT | minimal, low, medium, high, xhigh | SDK default |
CODEX_ADDITIONAL_DIRS | Extra directories (comma-separated) | none |
CODEX_NETWORK_ACCESS | Allow network from sandbox | false |
CODEX_WEB_SEARCH | disabled, cached, live | disabled |
| Env Var | Description |
|---|---|
CODEX_INSTRUCTIONS | Replaces the default instructions |
CODEX_APPEND_INSTRUCTIONS | Appended to the default (usually what you want) |
| Env Var | Description |
|---|---|
CODEX_PERSIST_SESSION | true/false β enable session resume (default: true) |
| Env Var | Description | Default |
|---|---|---|
CODEX_API_KEY | OpenAI API key for this agent | inherited from parent |
read-only β the agent can't write files unless you explicitly set workspace-write or danger-full-access.cwd overrides preserve agent knowledge β when the host overrides cwd, the agent's configured base directory is automatically added to additionalDirectories.sandboxMode and approvalPolicy can only tighten (e.g., workspace-write β read-only), never loosen._reply tool respects persistence β not registered when CODEX_PERSIST_SESSION=false.CODEX_API_KEY in generated configs.minimal effort + web_search: OpenAI does not allow web_search tools with minimal reasoning effort. Use low or higher if web search is needed.ISC - Xiaolai Li
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/codex-octopus)<a href="https://allmcps.com/mcp/codex-octopus"><img src="https://allmcps.com/api/badge/codex-octopus?style=directory" alt="Codex Octopus on AllMCPs" /></a>