C

Codex Subagent MCP

by parisbs · io.github.parisbs/codex-subagent-mcp

Enables Claude Code to delegate coding tasks—investigation, review, long-running background jobs, and optional file edits—to a locally installed OpenAI Codex CLI, with the model and reasoning effort chosen per task and read-only execution by default. Follow-up requests reuse Codex's existing context, and write-enabled delegations can be confined to a managed git worktree so the user's own checkout stays untouched.

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-parisbs-codex-subagent-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "codex-subagent-mcp"
      ],
      "env": {
        "CODEX_SUBAGENT_MAX_DELEGATIONS_PER_HOUR": "<VALUE>",
        "CODEX_SUBAGENT_MAX_BACKGROUND_JOBS": "<VALUE>",
        "CODEX_SUBAGENT_USAGE_LOG": "<VALUE>",
        "CODEX_SUBAGENT_DEFAULT_MODEL": "<VALUE>",
        "CODEX_SUBAGENT_DEFAULT_EFFORT": "<VALUE>",
        "CODEX_SUBAGENT_ALLOWED_MODELS": "<VALUE>",
        "CODEX_SUBAGENT_DEFAULT_SANDBOX": "<VALUE>",
        "CODEX_SUBAGENT_MAX_SANDBOX": "<VALUE>",
        "CODEX_SUBAGENT_MAX_EFFORT": "<VALUE>",
        "CODEX_SUBAGENT_MCP_SERVERS": "<VALUE>",
        "CODEX_SUBAGENT_PLUGINS": "<VALUE>",
        "CODEX_SUBAGENT_APPS": "<VALUE>",
        "CODEX_BIN": "<VALUE>"
      }
    }
  }
}

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-parisbs-codex-subagent-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "codex-subagent-mcp"
      ],
      "env": {
        "CODEX_SUBAGENT_MAX_DELEGATIONS_PER_HOUR": "<VALUE>",
        "CODEX_SUBAGENT_MAX_BACKGROUND_JOBS": "<VALUE>",
        "CODEX_SUBAGENT_USAGE_LOG": "<VALUE>",
        "CODEX_SUBAGENT_DEFAULT_MODEL": "<VALUE>",
        "CODEX_SUBAGENT_DEFAULT_EFFORT": "<VALUE>",
        "CODEX_SUBAGENT_ALLOWED_MODELS": "<VALUE>",
        "CODEX_SUBAGENT_DEFAULT_SANDBOX": "<VALUE>",
        "CODEX_SUBAGENT_MAX_SANDBOX": "<VALUE>",
        "CODEX_SUBAGENT_MAX_EFFORT": "<VALUE>",
        "CODEX_SUBAGENT_MCP_SERVERS": "<VALUE>",
        "CODEX_SUBAGENT_PLUGINS": "<VALUE>",
        "CODEX_SUBAGENT_APPS": "<VALUE>",
        "CODEX_BIN": "<VALUE>"
      }
    }
  }
}

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-parisbs-codex-subagent-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "codex-subagent-mcp"
      ],
      "env": {
        "CODEX_SUBAGENT_MAX_DELEGATIONS_PER_HOUR": "<VALUE>",
        "CODEX_SUBAGENT_MAX_BACKGROUND_JOBS": "<VALUE>",
        "CODEX_SUBAGENT_USAGE_LOG": "<VALUE>",
        "CODEX_SUBAGENT_DEFAULT_MODEL": "<VALUE>",
        "CODEX_SUBAGENT_DEFAULT_EFFORT": "<VALUE>",
        "CODEX_SUBAGENT_ALLOWED_MODELS": "<VALUE>",
        "CODEX_SUBAGENT_DEFAULT_SANDBOX": "<VALUE>",
        "CODEX_SUBAGENT_MAX_SANDBOX": "<VALUE>",
        "CODEX_SUBAGENT_MAX_EFFORT": "<VALUE>",
        "CODEX_SUBAGENT_MCP_SERVERS": "<VALUE>",
        "CODEX_SUBAGENT_PLUGINS": "<VALUE>",
        "CODEX_SUBAGENT_APPS": "<VALUE>",
        "CODEX_BIN": "<VALUE>"
      }
    }
  }
}

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-parisbs-codex-subagent-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "codex-subagent-mcp"
      ],
      "env": {
        "CODEX_SUBAGENT_MAX_DELEGATIONS_PER_HOUR": "<VALUE>",
        "CODEX_SUBAGENT_MAX_BACKGROUND_JOBS": "<VALUE>",
        "CODEX_SUBAGENT_USAGE_LOG": "<VALUE>",
        "CODEX_SUBAGENT_DEFAULT_MODEL": "<VALUE>",
        "CODEX_SUBAGENT_DEFAULT_EFFORT": "<VALUE>",
        "CODEX_SUBAGENT_ALLOWED_MODELS": "<VALUE>",
        "CODEX_SUBAGENT_DEFAULT_SANDBOX": "<VALUE>",
        "CODEX_SUBAGENT_MAX_SANDBOX": "<VALUE>",
        "CODEX_SUBAGENT_MAX_EFFORT": "<VALUE>",
        "CODEX_SUBAGENT_MCP_SERVERS": "<VALUE>",
        "CODEX_SUBAGENT_PLUGINS": "<VALUE>",
        "CODEX_SUBAGENT_APPS": "<VALUE>",
        "CODEX_BIN": "<VALUE>"
      }
    }
  }
}

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-parisbs-codex-subagent-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "codex-subagent-mcp"
      ],
      "env": {
        "CODEX_SUBAGENT_MAX_DELEGATIONS_PER_HOUR": "<VALUE>",
        "CODEX_SUBAGENT_MAX_BACKGROUND_JOBS": "<VALUE>",
        "CODEX_SUBAGENT_USAGE_LOG": "<VALUE>",
        "CODEX_SUBAGENT_DEFAULT_MODEL": "<VALUE>",
        "CODEX_SUBAGENT_DEFAULT_EFFORT": "<VALUE>",
        "CODEX_SUBAGENT_ALLOWED_MODELS": "<VALUE>",
        "CODEX_SUBAGENT_DEFAULT_SANDBOX": "<VALUE>",
        "CODEX_SUBAGENT_MAX_SANDBOX": "<VALUE>",
        "CODEX_SUBAGENT_MAX_EFFORT": "<VALUE>",
        "CODEX_SUBAGENT_MCP_SERVERS": "<VALUE>",
        "CODEX_SUBAGENT_PLUGINS": "<VALUE>",
        "CODEX_SUBAGENT_APPS": "<VALUE>",
        "CODEX_BIN": "<VALUE>"
      }
    }
  }
}

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-parisbs-codex-subagent-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "codex-subagent-mcp"
      ],
      "env": {
        "CODEX_SUBAGENT_MAX_DELEGATIONS_PER_HOUR": "<VALUE>",
        "CODEX_SUBAGENT_MAX_BACKGROUND_JOBS": "<VALUE>",
        "CODEX_SUBAGENT_USAGE_LOG": "<VALUE>",
        "CODEX_SUBAGENT_DEFAULT_MODEL": "<VALUE>",
        "CODEX_SUBAGENT_DEFAULT_EFFORT": "<VALUE>",
        "CODEX_SUBAGENT_ALLOWED_MODELS": "<VALUE>",
        "CODEX_SUBAGENT_DEFAULT_SANDBOX": "<VALUE>",
        "CODEX_SUBAGENT_MAX_SANDBOX": "<VALUE>",
        "CODEX_SUBAGENT_MAX_EFFORT": "<VALUE>",
        "CODEX_SUBAGENT_MCP_SERVERS": "<VALUE>",
        "CODEX_SUBAGENT_PLUGINS": "<VALUE>",
        "CODEX_SUBAGENT_APPS": "<VALUE>",
        "CODEX_BIN": "<VALUE>"
      }
    }
  }
}

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_SUBAGENT_MAX_DELEGATIONS_PER_HOUR No Delegation and follow-up processes per rolling hour: decimal integer 1 to 9007199254740991; unset means unrestricted. In memory per server; probes never count.
CODEX_SUBAGENT_MAX_BACKGROUND_JOBS No Cap on running background jobs: decimal integer 1 to 8 (default 8). Blocking calls do not use this cap.
CODEX_SUBAGENT_USAGE_LOG No Opt-in local usage log: on or off (default off). Records counts and settings, never prompts, code or paths; labels are caller text.
CODEX_SUBAGENT_DEFAULT_MODEL No Stops the server asking which Codex model to use. Sets the default model for delegations.
CODEX_SUBAGENT_DEFAULT_EFFORT No Reasoning effort used when a delegation call specifies none.
CODEX_SUBAGENT_ALLOWED_MODELS No Comma-separated allow-list of Codex models. Any model not in the list is refused.
CODEX_SUBAGENT_DEFAULT_SANDBOX No Sandbox used when a call specifies none: read-only, workspace-write or danger-full-access. Defaults to read-only and cannot exceed the ceiling.
CODEX_SUBAGENT_MAX_SANDBOX No Ceiling on what a delegation may do. Set to read-only to forbid writing outright.
CODEX_SUBAGENT_MAX_EFFORT No Ceiling on reasoning effort. Useful for keeping ultra off the table.
CODEX_SUBAGENT_MCP_SERVERS No MCP servers from Codex's config a delegation keeps: none (default), all, or comma-separated names.
CODEX_SUBAGENT_PLUGINS No Installed Codex plugins a delegation keeps: none (default), all, or comma-separated name@marketplace ids.
CODEX_SUBAGENT_APPS No Whether a delegation keeps Codex's apps (connectors to external services): off (default) or on.
CODEX_BIN No Path to the Codex executable, if it is not codex on PATH.

Similar servers