S

Sub Agents MCP

by shinpr · io.github.shinpr/sub-agents-mcp

Enables AI assistants to delegate specific tasks to specialized sub-agents (e.g., test-writer, code-reviewer). Supports both Cursor and Claude Code with custom agent definitions.

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-shinpr-sub-agents-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "sub-agents-mcp"
      ],
      "env": {
        "AGENTS_DIR": "<VALUE>",
        "AGENT_TYPE": "<VALUE>",
        "AGENT_PERMISSION": "<VALUE>",
        "AGENT_MODEL": "<VALUE>",
        "AGENT_EFFORT": "<VALUE>",
        "CURSOR_API_KEY": "<YOUR_VALUE>",
        "CLI_API_KEY": "<YOUR_VALUE>",
        "EXECUTION_TIMEOUT_MS": "300000",
        "SESSION_ENABLED": "<VALUE>",
        "SESSION_DIR": "<VALUE>",
        "SESSION_RETENTION_DAYS": "<VALUE>",
        "AGENTS_SETTINGS_PATH": "<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-shinpr-sub-agents-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "sub-agents-mcp"
      ],
      "env": {
        "AGENTS_DIR": "<VALUE>",
        "AGENT_TYPE": "<VALUE>",
        "AGENT_PERMISSION": "<VALUE>",
        "AGENT_MODEL": "<VALUE>",
        "AGENT_EFFORT": "<VALUE>",
        "CURSOR_API_KEY": "<YOUR_VALUE>",
        "CLI_API_KEY": "<YOUR_VALUE>",
        "EXECUTION_TIMEOUT_MS": "300000",
        "SESSION_ENABLED": "<VALUE>",
        "SESSION_DIR": "<VALUE>",
        "SESSION_RETENTION_DAYS": "<VALUE>",
        "AGENTS_SETTINGS_PATH": "<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-shinpr-sub-agents-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "sub-agents-mcp"
      ],
      "env": {
        "AGENTS_DIR": "<VALUE>",
        "AGENT_TYPE": "<VALUE>",
        "AGENT_PERMISSION": "<VALUE>",
        "AGENT_MODEL": "<VALUE>",
        "AGENT_EFFORT": "<VALUE>",
        "CURSOR_API_KEY": "<YOUR_VALUE>",
        "CLI_API_KEY": "<YOUR_VALUE>",
        "EXECUTION_TIMEOUT_MS": "300000",
        "SESSION_ENABLED": "<VALUE>",
        "SESSION_DIR": "<VALUE>",
        "SESSION_RETENTION_DAYS": "<VALUE>",
        "AGENTS_SETTINGS_PATH": "<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-shinpr-sub-agents-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "sub-agents-mcp"
      ],
      "env": {
        "AGENTS_DIR": "<VALUE>",
        "AGENT_TYPE": "<VALUE>",
        "AGENT_PERMISSION": "<VALUE>",
        "AGENT_MODEL": "<VALUE>",
        "AGENT_EFFORT": "<VALUE>",
        "CURSOR_API_KEY": "<YOUR_VALUE>",
        "CLI_API_KEY": "<YOUR_VALUE>",
        "EXECUTION_TIMEOUT_MS": "300000",
        "SESSION_ENABLED": "<VALUE>",
        "SESSION_DIR": "<VALUE>",
        "SESSION_RETENTION_DAYS": "<VALUE>",
        "AGENTS_SETTINGS_PATH": "<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-shinpr-sub-agents-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "sub-agents-mcp"
      ],
      "env": {
        "AGENTS_DIR": "<VALUE>",
        "AGENT_TYPE": "<VALUE>",
        "AGENT_PERMISSION": "<VALUE>",
        "AGENT_MODEL": "<VALUE>",
        "AGENT_EFFORT": "<VALUE>",
        "CURSOR_API_KEY": "<YOUR_VALUE>",
        "CLI_API_KEY": "<YOUR_VALUE>",
        "EXECUTION_TIMEOUT_MS": "300000",
        "SESSION_ENABLED": "<VALUE>",
        "SESSION_DIR": "<VALUE>",
        "SESSION_RETENTION_DAYS": "<VALUE>",
        "AGENTS_SETTINGS_PATH": "<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-shinpr-sub-agents-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "sub-agents-mcp"
      ],
      "env": {
        "AGENTS_DIR": "<VALUE>",
        "AGENT_TYPE": "<VALUE>",
        "AGENT_PERMISSION": "<VALUE>",
        "AGENT_MODEL": "<VALUE>",
        "AGENT_EFFORT": "<VALUE>",
        "CURSOR_API_KEY": "<YOUR_VALUE>",
        "CLI_API_KEY": "<YOUR_VALUE>",
        "EXECUTION_TIMEOUT_MS": "300000",
        "SESSION_ENABLED": "<VALUE>",
        "SESSION_DIR": "<VALUE>",
        "SESSION_RETENTION_DAYS": "<VALUE>",
        "AGENTS_SETTINGS_PATH": "<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
AGENTS_DIR Yes Path to your agents folder. Must be an absolute path (e.g., /Users/john/my-agents on Mac/Linux or C:\Users\john\my-agents on Windows)
AGENT_TYPE Yes Which AI tool you're using. Set to 'cursor' for Cursor or 'claude' for Claude Code
AGENT_PERMISSION No Approval/sandbox level for sub-agents: 'read-only', 'safe-edit' (default), or 'yolo'
AGENT_MODEL No Optional model override applied to every sub-agent execution by this MCP server
AGENT_EFFORT No Optional backend-specific reasoning effort or model variant. Supported by codex, claude, command-code, glm, kimi, grok, antigravity, opencode, mcode, and pi.
CURSOR_API_KEY secret No API key for cursor-agent authentication (used only when AGENT_TYPE=cursor; passed via env, never via CLI args)
CLI_API_KEY secret No Provider API key for AGENT_TYPE=glm or kimi (passed to the claude binary via env, never via CLI args). Restart/reconnect the MCP server after changing it.
EXECUTION_TIMEOUT_MS No How long agents can run in milliseconds (default: 5 minutes/300000ms, maximum: 10 minutes/600000ms) Default: 300000
SESSION_ENABLED No Enable session management to maintain execution history across agent calls (default: false)
SESSION_DIR No Directory path for storing session files (default: .mcp-sessions in current working directory)
SESSION_RETENTION_DAYS No Number of days to retain session history before automatic cleanup (default: 1)
AGENTS_SETTINGS_PATH No Path to CLI settings file/directory. Claude: --settings arg, Cursor: CURSOR_CONFIG_DIR, Codex: CODEX_HOME. GLM/Kimi/Gemini/Grok/Antigravity/OpenCode/Command Code/MiniMax Code/Pi not supported.

Similar servers