[BUG] Dynamically-injected MCP servers available in parent session are not propagated to spawned subagents — regression in v2.1.x

Resolved 💬 1 comment Opened Apr 9, 2026 by AlvaroRojas Closed Apr 10, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

MCP servers that are dynamically injected by Claude Code into the parent session (i.e. not listed in any static mcp-configs/mcp-servers.json or settings.json mcpServers block, but provided by an enabled feature/flag) are not available to subagents spawned via the Agent tool.

The parent session has full access to these tools. Spawned subagents report the MCP server as entirely absent — the tools don't appear even in the deferred tool list.

This is a regression — in a prior version, dynamically-injected MCP servers were available to spawned subagents. No config changes were made between working and broken states.

Environment

  • Claude Code version: 2.1.97
  • OS: Windows 11 Pro (10.0.26200)

Steps to Reproduce

  1. Enable a Claude Code feature that dynamically injects an MCP server into the session (e.g. via an env var or plugin flag in settings.json) without adding a static entry to mcp-configs/mcp-servers.json
  2. Confirm the MCP tools are available in the parent session (they appear in the deferred tool list and can be loaded via ToolSearch)
  3. Spawn a subagent using the Agent tool
  4. In the subagent, list all deferred tools (via ToolSearch or inspection)
  5. Result: The MCP server that was dynamically injected in the parent is absent from the subagent's tool environment entirely

What Should Happen?

Subagents spawned via the Agent tool should have access to the same MCP servers as the parent session, including those that are dynamically injected by enabled features/plugins — matching behavior from prior versions.

What Actually Happens?

Only statically configured MCP servers (entries in mcp-configs/mcp-servers.json) appear to propagate to spawned subagents. Dynamically-injected MCP servers are scoped exclusively to the parent session.

Workaround

Manually add the dynamically-injected MCP server as a static entry in mcp-configs/mcp-servers.json if its configuration is known. Not always possible if the server is an internal Claude Code implementation detail with no user-facing config.

Additional Context

  • Statically configured MCP servers (e.g. Gmail, Google Calendar, Exa via mcp-configs/mcp-servers.json) propagate correctly to subagents and appear in their deferred tool list
  • The regression is specific to dynamically-injected servers — the propagation mechanism appears to have changed between versions
  • Related: anthropics/claude-code#26479 (teammates not inheriting project settings.local.json)

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗