[Bug] MCP tools not available in spawned sub-agents via Agent tool

Resolved 💬 2 comments Opened Mar 23, 2026 by AvriSimonRepos Closed Apr 22, 2026

Bug Description
Title: MCP tools not available in spawned sub-agents (Agent tool)

Description:
MCP servers configured in .mcp.json are connected and working in the main session, but when a sub-agent is spawned via the Agent tool (even with subagent_type that explicitly lists
mcp__* tools), the MCP tools are not available to the sub-agent.

Steps to reproduce:

  1. Configure MCP servers in .mcp.json (e.g., @anthropic-ai/mcp-server-playwright, Google Sheets MCP)
  2. Verify MCP tools work in main session (they do)
  3. Define a custom agent type with mcp__playwright__ and mcp__google-sheets__ in its tools list
  4. Spawn the agent via the Agent tool
  5. Sub-agent reports MCP tools are not registered/available

Expected: Sub-agent inherits MCP server connections from parent session
Actual: Sub-agent only has built-in tools (Read, Write, Edit, Bash, Glob, Grep)

Impact: Can't build autonomous agents that use MCP tools — defeats the purpose of custom agent types that list MCP tools in their definition.report

Environment Info

  • Platform: linux
  • Terminal: wsl-Ubuntu
  • Version: 2.1.81
  • Feedback ID: 5c2cbc93-3dfb-4ecf-8972-58493460f8b8

Errors

[{"error":"Error: EACCES: permission denied, stat '/root/.linkedin-prospector/daily_log.json'\n    at async stat (node:internal/fs/promises:1032:18)\n    at async Object.validateInput (file:///home/rootadm/.local/share/fnm/node-versions/v23.9.0/installation/lib/node_modules/@anthropic-ai/claude-code/cli.js:3287:2564)\n    at async cp_ (file:///home/rootadm/.local/share/fnm/node-versions/v23.9.0/installation/lib/node_modules/@anthropic-ai/claude-code/cli.js:4108:1277)","timestamp":"2026-03-23T09:58:41.376Z"},{"error":"McpToolCallError: ### Error\nTypeError: Cannot read properties of undefined (reading 'url')\n    at Zk4 (file:///home/rootadm/.local/share/fnm/node-versions/v23.9.0/installation/lib/node_modules/@anthropic-ai/claude-code/cli.js:2713:19765)\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n    at async p7_ (file:///home/rootadm/.local/share/fnm/node-versions/v23.9.0/installation/lib/node_modules/@anthropic-ai/claude-code/cli.js:2713:16832)\n    at async Object.call (file:///home/rootadm/.local/share/fnm/node-versions/v23.9.0/installation/lib/node_modules/@anthropic-ai/claude-code/cli.js:2713:36404)\n    at async cp_ (file:///home/rootadm/.local/share/fnm/node-versions/v23.9.0/installation/lib/node_modules/@anthropic-ai/claude-code/cli.js:4108:7030)","timestamp":"2026-03-23T10:05:19.390Z"},{"error":"Error: Tool mcp__google-sheets__read_sheet_data not found\n    at Uk4 (file:///home/rootadm/.local/share/fnm/node-versions/v23.9.0/installation/lib/node_modules/@anthropic-ai/claude-code/cli.js:2713:48199)\n    at S_ (file:///home/rootadm/.local/share/fnm/node-versions/v23.9.0/installation/lib/node_modules/@anthropic-ai/claude-code/cli.js:749:20999)\n    at S2 (file:///home/rootadm/.local/share/fnm/node-versions/v23.9.0/installation/lib/node_modules/@anthropic-ai/claude-code/cli.js:749:39544)\n    at TA (file:///home/rootadm/.local/share/fnm/node-versions/v23.9.0/installation/lib/node_modules/@anthropic-ai/claude-code/cli.js:749:50235)\n    at ze6 (file:///home/rootadm/.local/share/fnm/node-versions/v23.9.0/installation/lib/node_modules/@anthropic-ai/claude-code/cli.js:749:86954)\n    at fO6 (file:///home/rootadm/.local/share/fnm/node-versions/v23.9.0/installation/lib/node_modules/@anthropic-ai/claude-code/cli.js:749:85910)\n    at gE6 (file:///home/rootadm/.local/share/fnm/node-versions/v23.9.0/installation/lib/node_modules/@anthropic-ai/claude-code/cli.js:749:85731)\n    at IE6 (file:///home/rootadm/.local/share/fnm/node-versions/v23.9.0/installation/lib/node_modules/@anthropic-ai/claude-code/cli.js:749:82089)\n    at O8 (file:///home/rootadm/.local/share/fnm/node-versions/v23.9.0/installation/lib/node_modules/@anthropic-ai/claude-code/cli.js:749:6367)\n    at Immediate.DW1 [as _onImmediate] (file:///home/rootadm/.local/share/fnm/node-versions/v23.9.0/installation/lib/node_modules/@anthropic-ai/claude-code/cli.js:742:24613)","timestamp":"2026-03-23T10:12:54.997Z"},{"error":"McpToolCallError: ### Error\nError: browserType.launchPersistentContext: Failed to launch the browser process.\nBrowser logs:\n\n<launching> /opt/google/chrome/chrome --disable-field-trial-config --disable-background-networking --disable-background-timer-throttling --disable-backgrounding-occluded-windows --disable-back-forward-cache --disable-breakpad --disable-client-side-phishing-detection --disable-component-extensions-with-background-pages --disable-component-update --no-default-browser-check --disable-default-apps --disable-dev-shm-usage --disable-features=AvoidUnnecessaryBeforeUnloadCheckSync,BoundaryEventDispatchTracksNodeRemoval,DestroyProfileOnBrowserClose,DialMediaRouteProvider,GlobalMediaControls,HttpsUpgrades,LensOverlay,MediaRouter,PaintHolding,ThirdPartyStoragePartitioning,Translate,AutoDeElevate,RenderDocument,OptimizationHints,AutomationControlled --enable-features=CDPScreenshotNewSurface --allow-pre-commit-input --disable-hang-monitor --disable-ipc-flooding-protection --disable-popup-blocking --disable-prompt-on-repost --disable-renderer-backgrounding --force-color-profile=srgb --metrics-…

Note: Content was truncated.

View original on GitHub ↗

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