[BUG] Plugin-defined subagents cannot access MCP tools - breaks plugin ecosystem
Summary
Plugin-defined subagents (agents in ~/.claude/plugins/*/agents/) cannot access MCP tools defined in the plugin's .mcp.json, making the plugin system incomplete for advanced use cases.
Environment
- Claude Code version: 2.1.x (latest)
- Platform: macOS (Darwin 25.2.0)
- Subscription: Pro ($200/month)
The Problem
When using the Task tool to spawn a plugin-defined agent, that agent cannot access MCP tools, even though:
- The MCP servers are properly configured in the plugin's
.mcp.json - The main Claude session has full access to these MCP tools
- Built-in agents (
general-purpose,Explore,Plan) DO receive MCP tools
Plugin Structure
~/.claude/plugins/marketplaces/fusengine-plugins/plugins/ai-pilot/
├── .mcp.json # ✅ MCP servers configured (context7, exa, etc.)
├── agents/
│ └── research-expert.md # ❌ Cannot access MCP tools
└── skills/
└── research/ # References MCP tools that agent can't use
.mcp.json Content
{
"mcpServers": {
"context7": { "command": "npx", "args": ["-y", "@upstash/context7-mcp"] },
"exa": { "type": "http", "url": "https://mcp.exa.ai/mcp?..." }
}
}
Expected Behavior
Plugin-defined agents should inherit MCP tools from their plugin's .mcp.json, just like built-in agents inherit from the main session.
Actual Behavior
Plugin agents respond with:
"I don't have access to the Context7/Exa MCP tools in this environment"
Then they fall back to WebSearch/WebFetch which defeats the purpose of specialized MCP integrations.
Reproduction Steps
- Create a plugin with
.mcp.jsonand an agent - Verify MCP tools work in main session:
mcp__plugin_fuse-ai-pilot_context7__query-docs✅ - Launch plugin agent via Task tool
- Agent cannot call the same MCP tools ❌
Workarounds Tested (All Failed)
| Workaround | Result |
|------------|--------|
| Full tool name prefix (mcp__plugin_fuse-ai-pilot_*) | ❌ Not recognized |
| Remove tools: from agent YAML (teppana88's suggestion) | ❌ No effect |
| enableAllProjectMcpServers: true in settings.json | ❌ No effect |
| resume parameter workaround | ❌ No effect |
| Global MCP config (~/.claude/.mcp.json) | Works but defeats plugin portability |
Impact
This bug breaks the plugin ecosystem for advanced use cases:
- Plugin authors cannot ship self-contained plugins with specialized MCP tools
- Users must manually configure MCP globally instead of just installing a plugin
- Agent specialization is impossible - all agents must use generic WebSearch
- Paying customers ($200/month) expect plugins to work as documented
Related Issues
- #13605 - Same bug, open since Dec 2025
- #15810 - Subagents not inheriting MCP
- #19526 - Feature request for MCP in subagents
- #4476 - Agent-scoped MCP configuration
- #17524 - Plugin agents not discovered
Proposed Solution
When spawning a plugin-defined agent via Task tool:
- Look up the agent's source plugin
- Load MCP servers from that plugin's
.mcp.json - Make those tools available to the spawned agent
This would make the plugin system actually work as users expect.
Request
Please prioritize this fix. The plugin system is a major selling point of Claude Code, but it's fundamentally broken without MCP tool inheritance.
---
Voted by: Multiple users in related issues
Priority: High (blocks plugin ecosystem adoption)
This issue has 6 comments on GitHub. Read the full discussion on GitHub ↗