Skip to main content
MCP server CX Codex

codex-octopus — Claude Code MCP server: setup

Runs several separately configured Codex agents through MCP. Use it to split code review, test writing, and quick coding tasks.

Install into Claude Code · Platform CLI All methods and platforms ↓
claude mcp add --env CODEX_API_KEY=<CODEX_API_KEY> --env CODEX_TOOL_NAME=<CODEX_TOOL_NAME> --env CODEX_MODEL=<CODEX_MODEL> --env CODEX_SANDBOX_MODE=<CODEX_SANDBOX_MODE> --env CODEX_APPROVAL_POLICY=<CODEX_APPROVAL_POLICY> --transport stdio codex-octopus -- npx -y codex-octopus
Open on GitHub

What codex-octopus does

codex-octopus exposes the OpenAI Codex SDK through an MCP server. Each server instance can have its own model, sandbox setting, reasoning effort, working directory, and extra instructions. An MCP client sees those instances as separate tools.

Configuration lives in environment variables inside .mcp.json. You can give one agent read-only access for review and another workspace-write access for tests. A factory mode provides the create_codex_mcp tool, which builds an MCP configuration entry from a requested agent setup. Calls can also override the directory, model, extra directories, network access, and web search mode.

The setup needs Node.js 18 or newer, the Codex CLI provided through @openai/codex, and an OpenAI key in CODEX_API_KEY or inherited from the parent process. Without Node.js 18 or newer, the server will not start.

What it helps with

  • split code review and test writing across separate agents
  • assign different models and reasoning effort to each agent
  • keep a reviewer inside a read-only sandbox
  • give an agent access to extra project directories
  • generate an MCP entry with the factory tool

Example prompts for the agent

  • Ask the configured Codex tool to inspect this module and report concrete bugs, not style preferences.
  • Have the test-focused agent write coverage for this code, including edge cases, with workspace write access.
  • Use create_codex_mcp to generate a read-only code review agent configuration.

How to install codex-octopus

Platform CLI

claude mcp add --env CODEX_API_KEY=<CODEX_API_KEY> --env CODEX_TOOL_NAME=<CODEX_TOOL_NAME> --env CODEX_MODEL=<CODEX_MODEL> --env CODEX_SANDBOX_MODE=<CODEX_SANDBOX_MODE> --env CODEX_APPROVAL_POLICY=<CODEX_APPROVAL_POLICY> --transport stdio codex-octopus -- npx -y codex-octopus

Replace <…> with your own values. 2 more environment variables are in the server README

Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more

Questions about codex-octopus

How do I install codex-octopus in Claude Code?

Run claude mcp add codex-octopus -e CODEX_API_KEY=<CODEX_API_KEY> -- npx -y codex-octopus.

What does codex-octopus do?

It exposes separately configured Codex instances as MCP tools. Each instance can use its own model, sandbox, instructions, and reasoning effort.

What is required for codex-octopus to work?

You need Node.js 18 or newer, the Codex CLI through @openai/codex, and an OpenAI key in CODEX_API_KEY or inherited from the parent process.

Similar MCP servers

All MCP servers for Agent setup: memory, context, orchestration →

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor