[BUG] Claude Desktop (macOS): "Run new tasks in the cloud" breaks config-file MCP servers bridged via mcp-remote — SSE stream terminated on task attach, session lost after 502/404 reconnect
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?
With Settings > Cowork > "Run new tasks in the cloud" ON, a config-file MCP server bridged via mcp-remote fails at task start. The connector attaches successfully (initialize, tools/list, prompts/list, resources/list all return), then the SSE stream to the remote MCP server is terminated. Reconnection gets a 502, then a 404 (session gone), and mcp-remote gives up after its 2-attempt limit. The UI shows "Couldn't attach connectors to this task. Claude will retry automatically" followed by "Couldn't start this task. Try again in a moment."
Turning cloud tasks OFF fully resolves it: same config, same server, tasks start reliably.
The identical command spawned manually in Terminal is completely stable (single client held open 5 minutes with no drop; two concurrent clients on the same token both stable), so the server and network path are fine. The failure only occurs when the process is spawned by Claude Desktop with cloud task execution enabled.
Environment
Claude Desktop 1.22209.3, macOS (Apple Silicon), personal account (not Team/Enterprise), Cowork remote sessions enabled
Node v24.13.0, npm 11.6.2 at /usr/local/bin (pkg installer, not Homebrew)
mcp-remote 0.1.38 (also reproduced on 0.1.29)
Affected server: an internal remote Streamable HTTP MCP gateway, bridged locally via mcp-remote with a static bearer token header. Config shape:
json
"gateway": {
"command": "npx",
"args": ["-y", "mcp-remote", "https://<internal-gateway>/mcp",
"--header", "Authorization:Bearer <REDACTED>"]
}
Six other config-file servers (Google Sheets, Google Docs, Puppeteer, DataForSEO, Firecrawl, Google Analytics) are unaffected
Bisect (done on a clean reinstall: moved ~/Library/Application Support/Claude aside, let the app rebuild, signed in, re-added config incrementally)
Empty config: tasks start fine
Gateway as the only server: tasks fail
All servers except gateway: tasks fine
Full config with gateway: fails
Ruled out
Header format (env var vs fully inline), explicit PATH in the env block
mcp-remote 0.1.29 and 0.1.38
Clearing ~/.mcp-auth repeatedly
Server count (fails with the gateway as the sole entry)
Plugins disabled
Chrome extension pairing, Dispatch, Cowork scheduled tasks (each toggled off individually)
Duplicate app instances (one PID confirmed); duplicate config files (only claude_desktop_config.json declares mcpServers)
Network filtering: third-party firewall, VPN, ad blocker, and endpoint security all disabled/removed during testing — no change
Server side: gateway operator rotated the API key and stripped resource_metadata from WWW-Authenticate — no change
Session collision: two concurrent Terminal clients on the same token are stable
Node version: a colleague runs the same gateway successfully with no Node on the shell PATH (Homebrew Node 22)
Additional observations
Claude Desktop spawns two live node mcp-remote clients per configured server (confirmed after full quit, pkill of stragglers, fresh launch). A working setup elsewhere shows the same doubling, so that appears normal.
A colleague with cloud tasks ON and the same gateway (different role, smaller role-filtered toolset) reports no problem, so rollout state, toolset size, or timing may be a factor.
Onset ~21 July 2026 with no local change; #79926 reports a local-stdio regression with the same onset window.
Working theory
Config-file MCP servers are local stdio processes. With cloud execution ON, attaching them to a remote session goes through a desktop-app bridge. Something in that attach path terminates the child process's in-flight SSE connection to the upstream server (TypeError: terminated is undici's connection-killed error). The upstream returns 502 on first reconnect and 404 on second (session already evicted), and mcp-remote's 2-attempt cap makes recovery impossible. Local execution never involves the bridge, which is why the toggle fixes it and Terminal is always stable.
What Should Happen?
The task starts and the config-file connector is bridged to the session. If local (config-file) MCP servers are not supported in cloud-executed tasks, they should be excluded gracefully with a clear message rather than failing task start entirely, and the SSE stream of the local child process should not be terminated during task attach.
Error Messages/Logs
# ~/Library/Logs/Claude/mcp-server-<gateway>.log
SSE stream disconnected: TypeError: terminated
StreamableHTTPError: Failed to open SSE stream: Bad Gateway
Failed to reconnect SSE stream: ... Bad Gateway
StreamableHTTPError: Failed to open SSE stream: Not Found
Maximum reconnection attempts (2) exceeded
# mcp.log shows the handshake completing first:
# initialize, tools/list, prompts/list, resources/list all return successfully
# before the stream drops, so the failure is post-attach.
# UI banners:
# "Couldn't attach connectors to this task. Claude will retry automatically"
# "Couldn't start this task. Try again in a moment."
Steps to Reproduce
In claude_desktop_config.json, add a config-file MCP server that bridges a remote Streamable HTTP MCP server via mcp-remote with a bearer token header:
json
"gateway": {
"command": "npx",
"args": ["-y", "mcp-remote", "https://<any-streamable-http-mcp-server>/mcp",
"--header", "Authorization:Bearer <TOKEN>"]
}
Enable Settings > Cowork > "Run new tasks in the cloud"
Fully quit and relaunch Claude Desktop
Start a new Cowork task
Observe the two error banners and the log signature above. Toggle "Run new tasks in the cloud" OFF, restart, repeat step 4: the task starts normally.
Happy to share the actual gateway URL and full logs privately with an Anthropic engineer.
Claude Model
None
Is this a regression?
Yes, this worked in a previous version
Last Working Version
Unknown. Onset ~21 July 2026; likely coincides with the staged rollout of Cowork remote session execution rather than a specific app version. Desktop auto-updates, so the prior version string wasn't captured.
Claude Code Version
Claude Desktop 1.22209.3 (desktop app, not the CLI; claude --version not applicable)
Platform
Other
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
_No response_