sub-agents-mcp

v0.15.1
io.github.shinpr/sub-agents-mcp Checked 2 days ago Published 1 month ago

MCP server for delegating tasks to specialized AI sub-agents across coding tools

Values you need

VariableWhat it is
AGENTS_DIRrequired Absolute path to the directory containing agent definition files (.md or .txt)
AGENT_TYPErequired Type of AI CLI to use: 'cursor', 'claude', 'gemini', 'codex', 'command-code', 'glm', 'kimi', 'grok', 'antigravity', 'opencode', 'mcode', or 'pi'
AGENT_PERMISSIONoptional Approval/sandbox level for sub-agents: 'read-only', 'safe-edit' (default), or 'yolo'
AGENT_MODELoptional Optional model override applied to every sub-agent execution by this MCP server
AGENT_EFFORToptional Optional backend-specific reasoning effort or model variant. Supported by codex, claude, command-code, glm, kimi, grok, antigravity, opencode, mcode, and pi.
CURSOR_API_KEYoptional secret API key for cursor-agent authentication (used only when AGENT_TYPE=cursor; passed via env, never via CLI args)
CLI_API_KEYoptional secret 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_MSoptional Agent execution timeout in milliseconds, as a positive whole number (default: 300000). The server refuses to start on an invalid value such as "5min".
SESSION_ENABLEDoptional Enable session management to maintain execution history across agent calls (default: false)
SESSION_DIRoptional Directory path for storing session files (default: .mcp-sessions in current working directory)
SESSION_RETENTION_DAYSoptional Number of days to retain session history before automatic cleanup (default: 1)
AGENTS_SETTINGS_PATHoptional 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.

npm (npx)

Requires Node.js 18+

Run in a terminal
claude mcp add sub-agents-mcp -e 'AGENTS_DIR=<AGENTS_DIR>' -e 'AGENT_TYPE=<AGENT_TYPE>' -- npx -y sub-agents-mcp@0.15.1
Add to claude_desktop_config.json
{
  "mcpServers": {
    "sub-agents-mcp": {
      "args": [
        "-y",
        "sub-agents-mcp@0.15.1"
      ],
      "command": "npx",
      "env": {
        "AGENTS_DIR": "<AGENTS_DIR>",
        "AGENT_TYPE": "<AGENT_TYPE>"
      }
    }
  }
}
Add to ~/.cursor/mcp.json
{
  "mcpServers": {
    "sub-agents-mcp": {
      "args": [
        "-y",
        "sub-agents-mcp@0.15.1"
      ],
      "command": "npx",
      "env": {
        "AGENTS_DIR": "<AGENTS_DIR>",
        "AGENT_TYPE": "<AGENT_TYPE>"
      }
    }
  }
}
Add to .vscode/mcp.json
{
  "inputs": [
    {
      "description": "AGENTS_DIR",
      "id": "agents-dir",
      "password": true,
      "type": "promptString"
    },
    {
      "description": "AGENT_TYPE",
      "id": "agent-type",
      "password": true,
      "type": "promptString"
    }
  ],
  "servers": {
    "sub-agents-mcp": {
      "args": [
        "-y",
        "sub-agents-mcp@0.15.1"
      ],
      "command": "npx",
      "env": {
        "AGENTS_DIR": "${input:agents-dir}",
        "AGENT_TYPE": "${input:agent-type}"
      },
      "type": "stdio"
    }
  }
}
Add to ~/.codex/config.toml
[mcp_servers.sub-agents-mcp]
command = "npx"
args = ["-y", "sub-agents-mcp@0.15.1"]
env = { "AGENTS_DIR" = "<AGENTS_DIR>", "AGENT_TYPE" = "<AGENT_TYPE>" }

For AI agents

  1. Ask the user for: AGENTS_DIR, AGENT_TYPE. Never invent or guess these values; secrets go into the client config, not into chat logs.
  2. Pick the user's MCP client and apply the matching config from the first install method (it is the one verified by the smoke test when available).
  3. Restart or reload the client so it starts the server.
  4. If it fails, check that the required runtime is installed (Node.js 18+) and that the values above are set.

Machine-readable: install.md · manifest.json