Task Agents
Delegate complex, multi-step, or specialized tasks to an autonomous agent for independent execution with dedicated context (e.g., refactoring across multiple files, fixing all test failures, systemati
What is Task Agents?
Task Agents is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to delegate complex, multi-step, or specialized tasks to an autonomous agent for independent execution with dedicated context (e.g., refactoring across multiple files, fixing all test failures, systemati
Delegate complex, multi-step, or specialized tasks to an autonomous agent for independent execution with dedicated context (e.g., refactoring across multiple files, fixing all test failures, systemati
This server falls under the Coding Agents category on MCPgee, the world's largest MCP server directory with 33,000+ servers.
Features
- run_agent
Use Cases
Maintainer
Works with
Installation
NPM
npx -y sub-agents-mcpManual Installation
npx -y sub-agents-mcpConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
How to Set Up and Use Task Agents
Sub-Agents MCP (published as the Task Agents server) lets any MCP-compatible AI tool delegate complex, multi-step tasks to autonomous sub-agents that each run in their own isolated context. Instead of asking Claude to refactor an entire codebase in one shot, you define lightweight agent markdown files describing the task, pick an execution engine (Claude Code, Cursor, Codex, or Gemini CLI), and the server spawns the right tool to carry out the work independently. This is especially useful for long-running tasks like fixing all test failures, systematic documentation passes, or running parallel code reviews without consuming the parent session's context window.
Prerequisites
- Node.js 18 or later installed (for npx execution)
- At least one supported agent CLI installed: Claude Code, Cursor CLI, OpenAI Codex, or Gemini CLI
- An MCP-compatible host such as Claude Desktop, Cursor, or Windsurf
- A directory containing agent definition markdown files (the AGENTS_DIR)
Create an agents directory
Make a directory that will hold your agent definition files. Each file is a markdown document that describes what a particular sub-agent should do when invoked. The path must be absolute.
mkdir -p /Users/you/agentsWrite an agent definition file
Create a markdown file inside your agents directory. The filename becomes the agent name. Describe the agent's purpose, instructions, and any constraints it should follow.
# code-reviewer
You are a meticulous code reviewer. When given a file or class name,
read the source code and provide a detailed review covering correctness,
performance, readability, and security concerns.Add the server to your MCP client config
Open your MCP client configuration file and add the sub-agents-mcp entry. Set AGENTS_DIR to the absolute path of your agents directory and AGENT_TYPE to the execution engine you have installed.
{
"mcpServers": {
"task-agents": {
"command": "npx",
"args": ["-y", "sub-agents-mcp"],
"env": {
"AGENTS_DIR": "/Users/you/agents",
"AGENT_TYPE": "claude",
"AGENT_PERMISSION": "safe-edit",
"EXECUTION_TIMEOUT_MS": "300000"
}
}
}
}Restart your MCP client
Save the configuration file and restart your MCP client. The run_agent tool will appear in the available tools list once the server connects successfully.
Delegate a task to a sub-agent
In your AI chat, ask the host to use a specific agent. The server reads the agent definition, spins up the configured execution engine, and runs the task independently, returning results when complete.
Task Agents Examples
Client configuration
Claude Desktop configuration that delegates tasks to Claude Code sub-agents with safe-edit permissions.
{
"mcpServers": {
"task-agents": {
"command": "npx",
"args": ["-y", "sub-agents-mcp"],
"env": {
"AGENTS_DIR": "/Users/you/agents",
"AGENT_TYPE": "claude",
"AGENT_PERMISSION": "safe-edit",
"EXECUTION_TIMEOUT_MS": "300000",
"SESSION_ENABLED": "true",
"SESSION_DIR": "/Users/you/.sub-agents/sessions"
}
}
}
}Prompts to try
Example prompts that delegate complex tasks to sub-agents.
- "Use the code-reviewer agent to check the UserService class in src/services/UserService.ts"
- "Use the test-writer agent to create unit tests for all functions in the auth module"
- "Delegate a refactoring task to the refactor agent: rename all instances of 'userId' to 'accountId' across the project"
- "Use the docs agent to write JSDoc comments for every exported function in lib/api.js"
- "Run the security-audit agent against the entire src/ directory and summarize findings"Troubleshooting Task Agents
run_agent fails with 'AGENTS_DIR not found' or agent not recognized
Ensure AGENTS_DIR is set to an absolute path (not relative) and that the directory exists. The agent name in your prompt must match the filename (without .md extension) inside that directory.
Agent execution times out
EXECUTION_TIMEOUT_MS defaults to 5 minutes (300000). For long-running tasks, increase it up to the maximum of 600000 (10 minutes) in your env config.
AGENT_TYPE is not recognized
Valid values are 'cursor', 'claude', 'gemini', and 'codex'. Make sure the corresponding CLI tool is installed and accessible in your PATH before setting this variable.
Frequently Asked Questions about Task Agents
What is Task Agents?
Task Agents is a Model Context Protocol (MCP) server that delegate complex, multi-step, or specialized tasks to an autonomous agent for independent execution with dedicated context (e.g., refactoring across multiple files, fixing all test failures, systemati It connects AI assistants to external tools and data sources through a standardized interface.
How do I install Task Agents?
Install via npm with the command: npx -y sub-agents-mcp. Then add the server configuration to your AI client's JSON config file (e.g., claude_desktop_config.json or .cursor/mcp.json).
Which AI clients work with Task Agents?
Task Agents works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.
Is Task Agents free to use?
Yes, Task Agents is open source and available under the MIT License license. You can use it freely in both personal and commercial projects.
Task Agents Alternatives — Similar Coding Agents Servers
Looking for alternatives to Task Agents? Here are other popular coding agents servers you can use with Claude, Cursor, and VS Code.
Dify
★ 142.2kProduction-ready platform for agentic workflow development.
Ruflo
★ 54.0k🌊 The leading agent orchestration platform for Claude. Deploy intelligent multi-agent swarms, coordinate autonomous workflows, and build conversational AI systems. Features enterprise-grade architecture, self-learning swarm intelligence, RAG integrat
Goose
★ 45.7kan open source, extensible AI agent that goes beyond code suggestions - install, execute, edit, and test with any LLM
Antigravity Awesome Skills
★ 38.3kInstallable GitHub library of 1,400+ agentic skills for Claude Code, Cursor, Codex CLI, Gemini CLI, Antigravity, and more. Includes installer CLI, bundles, workflows, and official/community skill collections.
AgentScope
★ 25.5kBuild and run agents you can see, understand and trust.
Serena
★ 24.5kA coding agent toolkit that provides IDE-like semantic code retrieval and editing tools, enabling LLMs to efficiently navigate and modify codebases using symbol-level operations instead of basic file reading and string replacements.
Browse More Coding Agents MCP Servers
Explore all coding agents servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.
Set Up Task Agents in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
Ready to use Task Agents?
Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.