Best for
- Developers who want to reuse Markdown agent definitions across MCP-compatible clients.
- Users who want shared backend and model configuration for sub-agents.
This developer-tools MCP server exposes the run_agent tool over stdio. It uses user-authored Markdown agent definitions and delegates execution to a selected coding CLI. It supports multiple backends and optional sessions; permission enforcement varies by backend.
Strongest · Setup experience 13/20 Weakest · Maintenance 7/20
Static review · not runReviewed 2026-11-29
Read the FMRS scoring method →Runtime:Node.js 22+
AGENTS_DIR
Required: set this to the absolute path of the directory containing agent definition .md or .txt files.
AGENT_TYPE
Required: select an installed and configured coding CLI, such as codex, claude, or cursor.
CURSOR_API_KEY
Optional: used for cursor-agent authentication only when AGENT_TYPE=cursor; obtain the key from Cursor.
CLI_API_KEY
Optional: set the provider API key when AGENT_TYPE=glm or kimi; obtain it from the selected provider.
AGENT_PERMISSION
Optional: set the agents' permission level to read-only, safe-edit (default), or yolo.
AGENT_MODEL
Optional: choose one model for all agent executions; omit it to use the backend default.
AGENT_EFFORT
Optional: set a backend-specific reasoning effort or model variant for supported backends.
EXECUTION_TIMEOUT_MS
Optional: set the execution timeout as a positive whole number of milliseconds; defaults to 300000.
SESSION_ENABLED
Optional: set to true to enable execution history across agent calls.
SESSION_DIR
Optional: choose where session files are stored; defaults to .mcp-sessions in the current working directory.
SESSION_RETENTION_DAYS
Optional: set how many days to retain session history before automatic cleanup; defaults to 1.
AGENTS_SETTINGS_PATH
Optional: set the path to a CLI settings file or directory; supported backends and usage depend on the selected CLI.
Requires Node.js 22 or later, an MCP-compatible client, and a supported coding CLI that is installed and signed in. Create an agent directory with .md or .txt definition files. In the client's MCP configuration, set AGENTS_DIR to the directory's absolute path and AGENT_TYPE to the chosen backend (the example uses codex). Restart or reconnect the client after saving.
{"mcpServers":{"sub-agents":{"command":"npx","args":["-y","sub-agents-mcp"],"env":{"AGENTS_DIR":"/absolute/path/to/agents","AGENT_TYPE":"codex"}}}}
Works in clients that read an "mcpServers" key. For clients such as VS Code that use a different key, the configurator below converts it.
{
"servers": {
"sub-agents": {
"command": "npx",
"args": [
"-y",
"sub-agents-mcp"
],
"env": {
"AGENTS_DIR": "/absolute/path/to/agents",
"AGENT_TYPE": "codex"
}
}
}
}
Goes in your project's .vscode/mcp.json (VS Code uses a "servers" key).
[mcp_servers.sub-agents] command = "npx" args = ["-y", "sub-agents-mcp"] [mcp_servers.sub-agents.env] AGENTS_DIR = "/absolute/path/to/agents" AGENT_TYPE = "codex"
Append to ~/.codex/config.toml (OpenAI Codex CLI uses TOML).
claude mcp add sub-agents -e AGENTS_DIR=/absolute/path/to/agents -e AGENT_TYPE=codex -- npx -y sub-agents-mcp
Run it in a terminal; replace any <…> placeholders with your own values first.
Restart or reconnect your MCP client and confirm that run_agent appears in its tool list. Then ask it to run a configured agent and confirm that the result appears in the conversation.
Once connected, you can ask your AI assistant things like:
No matching tools
Listed from the project's documentation, not tested by this site.
Sub-Agents MCP Server runs task-specific AI sub-agents defined in Markdown through a coding CLI you choose, then returns their results to the current conversation. It supports code review, test writing, investigation, and documentation, and can continue agent sessions across calls.
Connect code, docs, and infrastructure in a local knowledge graph.
Docker's official MCP gateway CLI plugin for managing and running MCP servers.
Fast, low-cost structured judgments for agents.
Local call graphs and structural analysis for Go repositories.
Source revision cf067b6a76e9 Data synced 2026-12-05 Read the FMRS scoring method Markdown