sub-agents-mcp
v0.15.1MCP server for delegating tasks to specialized AI sub-agents across coding tools
Values you need
| Variable | What it is | |
|---|---|---|
AGENTS_DIR | required | Absolute path to the directory containing agent definition files (.md or .txt) |
AGENT_TYPE | required | Type of AI CLI to use: 'cursor', 'claude', 'gemini', 'codex', 'command-code', 'glm', 'kimi', 'grok', 'antigravity', 'opencode', 'mcode', or 'pi' |
AGENT_PERMISSION | optional | Approval/sandbox level for sub-agents: 'read-only', 'safe-edit' (default), or 'yolo' |
AGENT_MODEL | optional | Optional model override applied to every sub-agent execution by this MCP server |
AGENT_EFFORT | optional | 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 | optional secret | API key for cursor-agent authentication (used only when AGENT_TYPE=cursor; passed via env, never via CLI args) |
CLI_API_KEY | optional 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_MS | optional | 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_ENABLED | optional | Enable session management to maintain execution history across agent calls (default: false) |
SESSION_DIR | optional | Directory path for storing session files (default: .mcp-sessions in current working directory) |
SESSION_RETENTION_DAYS | optional | Number of days to retain session history before automatic cleanup (default: 1) |
AGENTS_SETTINGS_PATH | optional | 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.1Add 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
- Ask the user for: AGENTS_DIR, AGENT_TYPE. Never invent or guess these values; secrets go into the client config, not into chat logs.
- 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).
- Restart or reload the client so it starts the server.
- 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