claude-code - 💡(How to fix) Fix Windows: `claude --continue` does not re-spawn stdio MCP servers [2 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#57794Fetched 2026-05-11 03:25:14
View on GitHub
Comments
2
Participants
2
Timeline
9
Reactions
0
Timeline (top)
labeled ×4commented ×2cross-referenced ×2closed ×1

On Windows, claude --continue (session resume) does not re-spawn stdio MCP child processes that were registered in the previous session. The session reports "Failed to reconnect to <server>" in /mcp output, the tools are not available in the session (not even as deferred), but claude mcp list reports the server as ✓ Connected.

Root Cause

  • Fresh restart of the MCP server's underlying process — no effect (server was healthy all along).
  • Removing a startup-blocking warmup probe from the bridge so the read loop wakes immediately — no effect, because the harness never spawns the bridge in the first place.

Fix Action

Fix / Workaround

Workarounds attempted

Workarounds that probably help

Code Example

[12:51:47] bridge starting   ← my manual probe before /exit
[12:51:48] bridge exiting
/exit, then `claude --continue`, then /mcp Reconnect
                              ← no bridge spawn at all
[12:54:34] bridge starting   ← `claude mcp list` (separate process)
RAW_BUFFERClick to expand / collapse

Summary

On Windows, claude --continue (session resume) does not re-spawn stdio MCP child processes that were registered in the previous session. The session reports "Failed to reconnect to <server>" in /mcp output, the tools are not available in the session (not even as deferred), but claude mcp list reports the server as ✓ Connected.

Repro

  1. Configure a stdio MCP server in ~/.claude.json (any working command/args will do).
  2. Run claude in any project, use the MCP server's tools successfully.
  3. /exit.
  4. claude --continue in the same project.
  5. Type /mcp.

Expected: server reconnects, tools available. Actual: /mcp prints Failed to reconnect to <server>, no mcp__<server>__* tools registered for this session.

Evidence (specific to my setup)

I have a stdio MCP server emacs-mcp whose stdio bridge logs every spawn to /tmp/emacs-mcp.log. After a clean /exit followed by claude --continue, the log shows no new bridge spawn during the resume — i.e. the harness never even started the child process. A subsequent claude mcp list (which spawns its own probe out-of-band) does produce a log entry and reports ✓ Connected. /mcp's in-session "Reconnect" button also produces no spawn.

[12:51:47] bridge starting   ← my manual probe before /exit
[12:51:48] bridge exiting
                              ← /exit, then `claude --continue`, then /mcp Reconnect
                              ← no bridge spawn at all
[12:54:34] bridge starting   ← `claude mcp list` (separate process)

Driving the bridge manually outside the harness (echo '<initialize-rpc>' | bash bridge.sh) returns the full tool list normally — the server itself is healthy.

Environment

  • Claude Code 2.1.138
  • Windows 11 Pro 26200 (Git Bash + MSYS, native Emacs daemon)
  • Stdio server config: { "type":"stdio", "command":"bash", "args":["…/bridge.sh"] }

Workarounds attempted

  • Fresh restart of the MCP server's underlying process — no effect (server was healthy all along).
  • Removing a startup-blocking warmup probe from the bridge so the read loop wakes immediately — no effect, because the harness never spawns the bridge in the first place.

Workarounds that probably help

  • claude --continue --fork-session (forces a new session ID; expected to trigger fresh MCP init — untested).
  • claude (fresh session, no resume) — confirmed-working, but loses prior conversation context.

Notes

  • Other stdio servers (perplexity, obsidian-mcp-tools) seem to reconnect fine, so this may be specific to bash-spawned bridges or to scripts that print to stderr during startup. Worth checking whether stdio servers spawned via bash <script> (as opposed to native .exe) are the trigger.
  • MCP_TIMEOUT env var did not appear to affect the outcome.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING