C

Codex Octopus

by xiaolai · io.github.xiaolai/codex-octopus

An MCP server that wraps the OpenAI Codex SDK to deploy multiple specialized AI agents with individual configurations for models, sandboxing, and behavior. It enables users to manage dedicated tools for tasks like code review and test writing through a customizable agent factory.

npm Local · stdio GlamaOfficial MCP Registry High confidence

Install

Add to ~/Library/Application Support/Claude/claude_desktop_config.json

Windows / Linux path
Windows: %APPDATA%\Claude\claude_desktop_config.json
Linux: ~/.config/Claude/claude_desktop_config.json
{
  "mcpServers": {
    "io-github-xiaolai-codex-octopus": {
      "command": "npx",
      "args": [
        "-y",
        "codex-octopus"
      ],
      "env": {
        "CODEX_API_KEY": "<YOUR_VALUE>",
        "CODEX_TOOL_NAME": "codex",
        "CODEX_MODEL": "<VALUE>",
        "CODEX_SANDBOX_MODE": "read-only",
        "CODEX_APPROVAL_POLICY": "on-failure",
        "CODEX_APPEND_INSTRUCTIONS": "<VALUE>",
        "CODEX_FACTORY_ONLY": "false",
        "CODEX_CWD": "<VALUE>",
        "CODEX_EFFORT": "<VALUE>",
        "CODEX_WEB_SEARCH": "disabled",
        "CODEX_DESCRIPTION": "<VALUE>",
        "CODEX_SERVER_NAME": "codex-octopus",
        "CODEX_INSTRUCTIONS": "<VALUE>",
        "CODEX_NETWORK_ACCESS": "false",
        "CODEX_ADDITIONAL_DIRS": "<VALUE>",
        "CODEX_PERSIST_SESSION": "true"
      }
    }
  }
}

Restart Claude Desktop to activate the new server.

Add to .cursor/mcp.json (project) or ~/.cursor/mcp.json (global)

Windows / Linux path
Windows: .cursor\mcp.json (project) or %USERPROFILE%\.cursor\mcp.json (global)
Linux: .cursor/mcp.json (project) or ~/.cursor/mcp.json (global)
{
  "mcpServers": {
    "io-github-xiaolai-codex-octopus": {
      "command": "npx",
      "args": [
        "-y",
        "codex-octopus"
      ],
      "env": {
        "CODEX_API_KEY": "<YOUR_VALUE>",
        "CODEX_TOOL_NAME": "codex",
        "CODEX_MODEL": "<VALUE>",
        "CODEX_SANDBOX_MODE": "read-only",
        "CODEX_APPROVAL_POLICY": "on-failure",
        "CODEX_APPEND_INSTRUCTIONS": "<VALUE>",
        "CODEX_FACTORY_ONLY": "false",
        "CODEX_CWD": "<VALUE>",
        "CODEX_EFFORT": "<VALUE>",
        "CODEX_WEB_SEARCH": "disabled",
        "CODEX_DESCRIPTION": "<VALUE>",
        "CODEX_SERVER_NAME": "codex-octopus",
        "CODEX_INSTRUCTIONS": "<VALUE>",
        "CODEX_NETWORK_ACCESS": "false",
        "CODEX_ADDITIONAL_DIRS": "<VALUE>",
        "CODEX_PERSIST_SESSION": "true"
      }
    }
  }
}

Cursor usually picks up config changes automatically; if the server does not appear, reload the window.

Add to .mcp.json (project) or ~/.claude.json (global)

Windows / Linux path
Windows: .mcp.json (project) or %USERPROFILE%\.claude.json (global)
Linux: .mcp.json (project) or ~/.claude.json (global)
{
  "mcpServers": {
    "io-github-xiaolai-codex-octopus": {
      "command": "npx",
      "args": [
        "-y",
        "codex-octopus"
      ],
      "env": {
        "CODEX_API_KEY": "<YOUR_VALUE>",
        "CODEX_TOOL_NAME": "codex",
        "CODEX_MODEL": "<VALUE>",
        "CODEX_SANDBOX_MODE": "read-only",
        "CODEX_APPROVAL_POLICY": "on-failure",
        "CODEX_APPEND_INSTRUCTIONS": "<VALUE>",
        "CODEX_FACTORY_ONLY": "false",
        "CODEX_CWD": "<VALUE>",
        "CODEX_EFFORT": "<VALUE>",
        "CODEX_WEB_SEARCH": "disabled",
        "CODEX_DESCRIPTION": "<VALUE>",
        "CODEX_SERVER_NAME": "codex-octopus",
        "CODEX_INSTRUCTIONS": "<VALUE>",
        "CODEX_NETWORK_ACCESS": "false",
        "CODEX_ADDITIONAL_DIRS": "<VALUE>",
        "CODEX_PERSIST_SESSION": "true"
      }
    }
  }
}

The server will be available in the next Claude Code session.

Add to .vscode/mcp.json

Windows / Linux path
Windows: .vscode\mcp.json
Linux: .vscode/mcp.json
{
  "servers": {
    "io-github-xiaolai-codex-octopus": {
      "command": "npx",
      "args": [
        "-y",
        "codex-octopus"
      ],
      "env": {
        "CODEX_API_KEY": "<YOUR_VALUE>",
        "CODEX_TOOL_NAME": "codex",
        "CODEX_MODEL": "<VALUE>",
        "CODEX_SANDBOX_MODE": "read-only",
        "CODEX_APPROVAL_POLICY": "on-failure",
        "CODEX_APPEND_INSTRUCTIONS": "<VALUE>",
        "CODEX_FACTORY_ONLY": "false",
        "CODEX_CWD": "<VALUE>",
        "CODEX_EFFORT": "<VALUE>",
        "CODEX_WEB_SEARCH": "disabled",
        "CODEX_DESCRIPTION": "<VALUE>",
        "CODEX_SERVER_NAME": "codex-octopus",
        "CODEX_INSTRUCTIONS": "<VALUE>",
        "CODEX_NETWORK_ACCESS": "false",
        "CODEX_ADDITIONAL_DIRS": "<VALUE>",
        "CODEX_PERSIST_SESSION": "true"
      }
    }
  }
}

Reload the VS Code window to activate.

Add to ~/.codeium/windsurf/mcp_config.json

Windows / Linux path
Windows: %USERPROFILE%\.codeium\windsurf\mcp_config.json
Linux: ~/.codeium/windsurf/mcp_config.json
{
  "mcpServers": {
    "io-github-xiaolai-codex-octopus": {
      "command": "npx",
      "args": [
        "-y",
        "codex-octopus"
      ],
      "env": {
        "CODEX_API_KEY": "<YOUR_VALUE>",
        "CODEX_TOOL_NAME": "codex",
        "CODEX_MODEL": "<VALUE>",
        "CODEX_SANDBOX_MODE": "read-only",
        "CODEX_APPROVAL_POLICY": "on-failure",
        "CODEX_APPEND_INSTRUCTIONS": "<VALUE>",
        "CODEX_FACTORY_ONLY": "false",
        "CODEX_CWD": "<VALUE>",
        "CODEX_EFFORT": "<VALUE>",
        "CODEX_WEB_SEARCH": "disabled",
        "CODEX_DESCRIPTION": "<VALUE>",
        "CODEX_SERVER_NAME": "codex-octopus",
        "CODEX_INSTRUCTIONS": "<VALUE>",
        "CODEX_NETWORK_ACCESS": "false",
        "CODEX_ADDITIONAL_DIRS": "<VALUE>",
        "CODEX_PERSIST_SESSION": "true"
      }
    }
  }
}

Restart Windsurf (or refresh its MCP servers panel) to activate the new server.

Windsurf Next uses ~/.codeium/windsurf-next/mcp_config.json. Devin Desktop (the Windsurf rebrand) uses ~/.config/devin/mcp_config.json and imports the Windsurf file.

Add to ~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json

Windows / Linux path
Windows: %APPDATA%\Code\User\globalStorage\saoudrizwan.claude-dev\settings\cline_mcp_settings.json
Linux: ~/.config/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json
{
  "mcpServers": {
    "io-github-xiaolai-codex-octopus": {
      "command": "npx",
      "args": [
        "-y",
        "codex-octopus"
      ],
      "env": {
        "CODEX_API_KEY": "<YOUR_VALUE>",
        "CODEX_TOOL_NAME": "codex",
        "CODEX_MODEL": "<VALUE>",
        "CODEX_SANDBOX_MODE": "read-only",
        "CODEX_APPROVAL_POLICY": "on-failure",
        "CODEX_APPEND_INSTRUCTIONS": "<VALUE>",
        "CODEX_FACTORY_ONLY": "false",
        "CODEX_CWD": "<VALUE>",
        "CODEX_EFFORT": "<VALUE>",
        "CODEX_WEB_SEARCH": "disabled",
        "CODEX_DESCRIPTION": "<VALUE>",
        "CODEX_SERVER_NAME": "codex-octopus",
        "CODEX_INSTRUCTIONS": "<VALUE>",
        "CODEX_NETWORK_ACCESS": "false",
        "CODEX_ADDITIONAL_DIRS": "<VALUE>",
        "CODEX_PERSIST_SESSION": "true"
      }
    }
  }
}

Cline reloads cline_mcp_settings.json automatically; if the server does not appear, reload the VS Code window.

Open it from Cline's MCP Servers panel → Configure. Roo Code uses a different file and format.

Configuration

Environment variables this server reads. Secrets stay on your machine.

NameRequiredDescription
CODEX_API_KEY secret No OpenAI API key for this agent (can be inherited from parent process)
CODEX_TOOL_NAME No Tool name prefix (<name> and <name>_reply) Default: codex
CODEX_MODEL No Model (gpt-5-codex, o3, codex-1, etc.)
CODEX_SANDBOX_MODE No read-only, workspace-write, danger-full-access Default: read-only
CODEX_APPROVAL_POLICY No never, on-failure, on-request, untrusted Default: on-failure
CODEX_APPEND_INSTRUCTIONS No Appended to the default instructions
CODEX_FACTORY_ONLY No Only expose the factory wizard tool Default: false
CODEX_CWD No Working directory
CODEX_EFFORT No Reasoning effort (minimal, low, medium, high, xhigh)
CODEX_WEB_SEARCH No Web search mode: disabled, cached, live Default: disabled
CODEX_DESCRIPTION No Tool description shown to the host AI
CODEX_SERVER_NAME No MCP server name in protocol handshake Default: codex-octopus
CODEX_INSTRUCTIONS No Replaces the default instructions
CODEX_NETWORK_ACCESS No Allow network from sandbox Default: false
CODEX_ADDITIONAL_DIRS No Extra directories (comma-separated)
CODEX_PERSIST_SESSION No enable session resume Default: true

Similar servers