[BUG] v2.1.105: ESC during MCP tool call kills MCP server process (regression from v2.1.104)
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?
Pressing ESC to cancel a long-running MCP tool call in v2.1.105 kills the MCP server process entirely. All tools from
that server become unavailable and it shows as "failed" in the /mcp dialog.
What Should Happen?
ESC should cancel the tool call (mark as "rejected by user") while keeping the MCP server alive and all tools
available — which is exactly how v2.1.104 behaves
Error Messages/Logs
"The following MCP servers have disconnected: meshcode-meshcode-self-improve-backend"
"The following deferred tools are no longer available (their MCP server disconnected)"
Steps to Reproduce
- Have any MCP server with a long-running async tool (e.g., a tool that awaits for 60+ seconds)
- Call that tool from Claude Code
- While the tool is running, press ESC to cancel it
- The MCP server process is killed — all tools become unavailable
- /mcp dialog shows the server as failed
Claude Model
Opus
Is this a regression?
Yes, this worked in a previous version
Last Working Version
2.1.104
Claude Code Version
2.1.105
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
Verified with the exact same MCP server code on both versions:
- v2.1.104: ESC cancels tool, server stays alive ✅
- v2.1.105: ESC cancels tool, server killed ❌
Tested with multiple server code variations (with/without signal handlers, with/without atexit hooks, minimal
mcp.run() only) — all crash on v2.1.105, all survive on v2.1.104.
mcp Python package v1.27.0 (also tested v1.26.0 — same result on v2.1.105).
4 Comments
status? this needs to get fixed asap, plus took away like 20% of my weekly sesh tokens finding out it was Anthropic's bug and not my code's ....give it back... lol.
Update — bug persists through v2.1.111 (6 releases later).
Just spent ~8 hours confirming + bisecting on v2.1.111. Filed a follow-up with
a minimal 30-line Python repro + full ruleout matrix → #49479.
Headlines:
specific server. The 30-line
esc_test.pyin the new issue reproduces inisolation — no custom logic, no lifespan, no imports beyond stdlib +
mcp.ignore)
installed beforemcp.run()doesn't help and never fires. Points to
SIGKILL` or stdin-close from Claude Code's side.mcp.run()in `while True: try:mcp.run() except BaseException: continue` doesn't survive either. The
subprocess actually exits.
@playwright/mcp@latest(Node) survives the same ESC gesture cleanly. OnlyPython dies.
claude.ai Gmail/Calendar(remoteHTTP/SSE) unaffected by architecture. Any stdio Python MCP affected.
Please bump priority — blocks any Python MCP with multi-second tool calls
(mesh coordinators, wait loops, long queries, data pipelines). Workaround is
pinning to
2.1.104, which isn't viable for users who want model updates.Happy to pair-debug with an Anthropic engineer. Repro ready, bisection data
documented.
⚠️ Accidentally closed this issue — the bug is NOT resolved. GitHub does
not let the reporter reopen after a "closed as completed" so requesting a
maintainer reopen.
Bug persists through v2.1.111 (6 releases later). Filed a follow-up with a
minimal 30-line Python repro + full ruleout matrix → #49479.
Headlines:
specific server. The 30-line
esc_test.pyin #49479 reproduces in isolation —no custom logic, no lifespan, no imports beyond stdlib +
mcp.ignore)
installed beforemcp.run()doesn't help and never fires. Points to
SIGKILL` or stdin-close from Claude Code's side.mcp.run()in `while True: try:mcp.run() except BaseException: continue` doesn't survive either. The
subprocess actually exits.
@playwright/mcp@latest(Node) survives the same ESC gesture cleanly. OnlyPython dies.
claude.ai Gmail/Calendar(remoteHTTP/SSE) unaffected by architecture. Any stdio Python MCP affected.
Please bump priority and reopen — blocks any Python MCP with multi-second tool
calls (mesh coordinators, wait loops, long queries, data pipelines).
Workaround is pinning to
2.1.104, which isn't viable for users who wantmodel updates.
Happy to pair-debug with an Anthropic engineer. Repro ready, bisection data
documented.
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.