Sub-Agent scoped MCP configs do not work when shared with Claude Code Plugins

Resolved 💬 4 comments Opened Mar 12, 2026 by rinormaloku Closed Apr 30, 2026

After testing Agent-Scoped MCP configs with Claude Code Plugins (Marketplace), I found three bugs:

---
Bug 1: MCP servers defined in agent files show as errors and never start

If you put MCP server config directly in an agent definition file:

mcpServers:
  - playwright:
      type: stdio
      command: npx
      args: ["-y", "@playwright/mcp@latest"]

Claude Code never actually starts the server. Instead, the agent view shows warning errors like:

⚠ Unrecognized: mcp__plugin_<plugin_name>_<mcp_server_name>__<tool_name>

And claude /mcp doesn't show the server at all. The MCP config in agent files appears to be silently ignored.

---
Bug 2: Forced workaround defeats the purpose of scoping

Because agent-level config doesn't work, the only option right now is to add the MCP server to marketplace.json at the plugin level. But that registers it globally visible and loaded for the root agent, not just the sub-agent. This directly contradicts the whole point of agent-scoped MCP and wastes tokens on tools the root agent will never use.

---
Bug 3: Sub-agents from plugins always fail on the first call

When a plugin provides a sub-agent, calling it by name fails the first time:

Agent type 'support-agent' not found.
Available agents: ..., support-agent:support-agent

Then Claude retries with the fully-qualified plugin-name:agent-name format and succeeds. This is a naming resolution bug. The agent runner should resolve plugin-scoped agents without needing a retry.

---
Thanks for shipping this! Agent-scoped MCP is a big deal for sub-agent use cases. Happy to provide more details or test fixes.

_Originally posted by @rinormaloku in #4476_

View original on GitHub ↗

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