[BUG] Background subagents cannot access MCP tools

Resolved 💬 21 comments Opened Dec 7, 2025 by BloodyFrag Closed Mar 2, 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?

When spawning subagents with run_in_background: true, the subagents do not have access to MCP tools. They report that MCP tools are unavailable, even though these tools work correctly in the main context.

When spawning the same subagents with run_in_background: false (synchronous mode), MCP tools work correctly.

What Should Happen?

Subagents running in background mode should have the same access to MCP tools as subagents running in synchronous mode and the main context.

Error Messages/Logs

With run_in_background: true (FAILS):

I don't have access to the Jira MCP tools in this environment.
The MCP (Model Context Protocol) tools need to be configured and
available in your Claude Code setup for me to use them.

The tools I have access to are:
- Bash (for terminal commands)
- File operations (Read, Write, Edit, Glob, Grep)
- Web fetching
...

The MCP tools that would allow me to interact with Jira are not
currently loaded or available in this session.

With run_in_background: false (WORKS):
Subagents successfully call MCP tools and return expected data.

Steps to Reproduce

  1. Configure any MCP server (e.g., Jira MCP, custom HTTP MCP server, etc.)
  2. Verify MCP tools work in main context
  3. Spawn multiple subagents with run_in_background: true:

``xml
<invoke name="Task">
<parameter name="subagent_type">general-purpose</parameter>
<parameter name="description">Get user info</parameter>
<parameter name="prompt">Use mcp__jira__atlassianUserInfo to get user details...</parameter>
<parameter name="run_in_background">true</parameter>
</invoke>
<invoke name="Task">
<parameter name="subagent_type">general-purpose</parameter>
<parameter name="description">Get projects</parameter>
<parameter name="prompt">Use mcp__jira__getVisibleJiraProjects to list projects...</parameter>
<parameter name="run_in_background">true</parameter>
</invoke>
``

  1. Wait for agents to complete using AgentOutputTool
  2. Result: All agents report MCP tools unavailable
  1. Spawn same subagents with run_in_background: false:

``xml
<invoke name="Task">
<parameter name="subagent_type">general-purpose</parameter>
<parameter name="description">Get user info</parameter>
<parameter name="prompt">Use mcp__jira__atlassianUserInfo to get user details...</parameter>
<parameter name="run_in_background">false</parameter>
</invoke>
``

  1. Result: Agent has MCP access and returns data

Claude Model

Opus

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.0.60

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

iTerm2

Additional Information

_No response_

View original on GitHub ↗

21 Comments

github-actions[bot] · 7 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/7296
  2. https://github.com/anthropics/claude-code/issues/2169
  3. https://github.com/anthropics/claude-code/issues/5465

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

DavidPoliakoff · 7 months ago

I think it might be more pathologically weird, or I have a different bug, or a different manifestation. If I tell Claude Code (2.0.64 (Claude Code)), to "spawn a backgrounded agent to do X" (where X involves an MCP) it performs magnificently.

Tell it to spawn two agents with the same instructions at the same time, and it falls on its face (this isn't https://github.com/anthropics/claude-code/issues/7296 , as I'm not using a stdio MCP server).

I'm not sure whether the problem is backgrounding or parallelism of the agents or what.

This is a shame, because right now my workflow is roughly "poll for new bugs, every fifteen minutes spawn a skills-based agent per bug to do first-level analysis and report out to me." I can do every part of this sans the batching, which is okay, but really limiting. My development flow is pretty hosed by it, as that really needs the parallelism.

BloodyFrag · 7 months ago

@DavidPoliakoff,
this problem occurred exclusively in version 2.0.60, and the subagent running in the background did indeed lose access to MCP it simply could not see them. However, this has been working perfectly since version 2.0.61, so I think this issue can be closed.

DavidPoliakoff · 7 months ago

@BloodyFrag : the version I experienced this under was 2.0.64. Should I open a new bug? Once I'm in at work, I can also try to just re-validate after pulling whatever version is out this morning

DavidPoliakoff · 7 months ago

Huh, I think I figured this out. I'm guessing that it's the case that if you claude --continue after an update you might still get some bugs from the old version. I'm not sure how that's happening. But this morning, if I claude --continue from my old session, I'm still hosed. But if I run a fresh session, we're all good. Think it's safe to keep this closed, but just a rec for anybody who sees this to spawn a completely fresh session

BloodyFrag · 7 months ago

@DavidPoliakoff,
I think it's something else. My parallel agents worked on version 2.0.60, but they couldn't use MCP tools.
But I checked again, and MCP tools stopped working again in parallel sub-agents running in the background, which is annoying. Version 2.0.65

⏺ Task Output a2df0f0
Get Jira user info (30 lines)

  Prompt:
    Use the mcp__jira__atlassianUserInfo tool to get the current Atlassian user information. Just call the tool once and report what you find.

  Response:
    [Tool: Bash] {"command":"echo Checking available MCP tools for Jira","description":"Check environment for MCP tools"}
    [Tool: Bash] {"command":"echo Checking available MCP tools for Jira","description":"Check environment for MCP tools"}

    --- RESULT ---
    I apologize, but I don't have access to a tool called mcp__jira__atlassianUserInfo. Looking at my available tools, I have:

    - Bash (for terminal commands)
    - Glob (for file pattern matching)
    - Grep (for code search)
    - Read (for reading files)
    - Edit (for editing files)
    - Write (for writing files)
    - NotebookEdit (for Jupyter notebooks)
    - WebFetch (for fetching web content)
    - TodoWrite (for task management)
    - WebSearch (for web searches)

    I don't have any Jira or Atlassian-specific MCP tools available in my current environment.
DavidPoliakoff · 7 months ago

Yep, you're right. My previous, I launched two parallel agents, but they weren't backgrounded. Now launching backgrounded ones...

● Excellent! Now I can confirm that both agents actually made glean_chat invocations. Looking at the outputs:

  Agent a5d7966:
  [Tool: {redacted}__glean_chat] {"query":"What is {redacted}?"}
  [Tool: {redacted}__glean_chat] {"query":"What is {redacted}?"}

  Agent a47f0e3:
  [Tool: {redacted}__glean_chat] {"query":"What is {redacted}?"}
  [Tool: {redacted}__glean_chat] {"query":"What is {redacted}?"}

  Both agents did attempt to invoke glean_chat (each made 2 attempts), but unfortunately both failed because the MCP tool wasn't available in their execution
   environment.
DavidPoliakoff · 7 months ago

Yep, and it's backgrounding, not parallelism. One backgrounded agent fails similarly

acidtech · 7 months ago

Just a confirmation this bug happens in 2.0.61(what I am currently running) as well so its been happening for a little while.

ovidiul · 7 months ago

Confirmed, I have the same problem, so the same prompt, I've tried them both and Claude reported:

| Mode | MCP Access | Behavior |
|-------------------------|------------|--------------------------------------------------------|
| run_in_background=false | ✅ Works | Subagent has direct MCP tool access |
| run_in_background=true | ❌ Fails | Subagent tries to use Bash to call claude mcp commands |

fkesheh · 6 months ago

happening to me on 2.0.72

konarkm · 6 months ago

+1

jemshit · 6 months ago

@ovidiul how do you invoke run_in_background=false ? It doesn't seem to be working for me, i instructed the command to spawn an agent using run_in_background=false but agent still can't write to file.

ovidiul · 6 months ago
how do you invoke run_in_background=false

@jemshit I am asking Claude in the prompt to d that, not sure if something changed in between Claude Code updates

gsunjka · 6 months ago

same here. 2.0.76

NeonWizard · 6 months ago
@DavidPoliakoff, this problem occurred exclusively in version 2.0.60, and the subagent running in the background did indeed lose access to MCP it simply could not see them. However, this has been working perfectly since version 2.0.61, so I think this issue can be closed.

Recreated this on 2.0.61. Not resolved.

shyney7 · 5 months ago

Still present on 2.1.14

jhopper28 · 5 months ago

Still present on v2.1.19

github-actions[bot] · 4 months ago

Closing for now — inactive for too long. Please open a new issue if this is still relevant.

michabbb · 4 months ago

dear anthropic, please reopen this, subagents using MCP is a fundamental part of this software.... 😢

github-actions[bot] · 4 months ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.