[BUG] Plugin-defined subagents cannot access MCP tools - breaks plugin ecosystem

Resolved 💬 6 comments Opened Jan 28, 2026 by fusengine Closed Apr 10, 2026

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:

  1. The MCP servers are properly configured in the plugin's .mcp.json
  2. The main Claude session has full access to these MCP tools
  3. 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

  1. Create a plugin with .mcp.json and an agent
  2. Verify MCP tools work in main session: mcp__plugin_fuse-ai-pilot_context7__query-docs
  3. Launch plugin agent via Task tool
  4. 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:

  1. Plugin authors cannot ship self-contained plugins with specialized MCP tools
  2. Users must manually configure MCP globally instead of just installing a plugin
  3. Agent specialization is impossible - all agents must use generic WebSearch
  4. 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:

  1. Look up the agent's source plugin
  2. Load MCP servers from that plugin's .mcp.json
  3. 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)

View original on GitHub ↗

This issue has 6 comments on GitHub. Read the full discussion on GitHub ↗