Feature Request: Allow MCP tools to be available in subagents (Task tool)
Summary
Currently, when using the Task tool to spawn subagents (Explore, Plan, feature-dev, etc.), these subagents do not have access to MCP server tools like Serena. This limits their effectiveness for code navigation and editing tasks.
Problem
MCP servers like Serena provide powerful semantic code navigation through Language Server Protocol (LSP):
find_symbol- Find symbols by name with semantic understandingfind_referencing_symbols- Find all references to a symbol across the codebaseget_symbols_overview- Get structured overview of a file's symbolsreplace_symbol_body- Precisely edit function/class bodiesrename_symbol- Rename symbols across the entire codebase
However, when I delegate tasks to subagents via the Task tool, they fall back to basic tools (Glob, Grep, Read) and lose all the semantic navigation capabilities.
Current behavior:
Main Claude (has MCP tools)
└── spawns Subagent (NO MCP tools) ❌
Desired behavior:
Main Claude (has MCP tools)
└── spawns Subagent (inherits MCP tools) ✅
Use Cases
- Large refactoring tasks - Subagent could use
find_referencing_symbolsto find all usages before refactoring - Code exploration - Explore agent could use
get_symbols_overviewfor better understanding - Parallel code reviews - Multiple subagents could analyze different parts with semantic understanding
- Feature development - feature-dev agents could make precise edits with
replace_symbol_body
Current Workaround
I've added instructions to my CLAUDE.md to use MCP tools directly instead of delegating to subagents for code tasks. This works but defeats the purpose of parallelization.
Implementation Considerations
I understand there are technical challenges:
| Challenge | Possible Solution |
|-----------|-------------------|
| State conflicts (multiple agents accessing LSP) | File-level locking or isolated LSP connections per agent |
| Resource consumption | Lazy connection initialization, connection pooling |
| Latency | Optional flag to enable/disable MCP in subagents |
Proposed Solution
- Option A (Simple): Allow MCP tools to be passed to subagents that have "All tools" access (Explore, Plan, general-purpose)
- Option B (Configurable): Add a parameter to Task tool like
include_mcp_tools: trueto opt-in
- Option C (Selective): Allow specifying which MCP tools to pass:
mcp_tools: ["serena"]
Environment
- Claude Code CLI
- MCP Server: Serena (LSP-based code navigation)
- OS: Windows 11
---
Thank you for considering this feature! MCP servers significantly enhance code understanding, and having them available in subagents would make Claude Code even more powerful for large codebases.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗