Repository navigation
Description
Preflight Checklist
- I have searched existing issues and this hasn't been reported yet
- This is a single bug report (please file separate reports for different bugs)
- I am using the latest version of Claude Code
What's Wrong?
When an HTTP SSE connection to a Streamable HTTP MCP server drops while a tool call is in-flight, the pending Promise is never resolved or rejected. The tool hangs indefinitely until the user manually cancels (Escape). The connection remains broken afterward — the user must manually reconnect via /mcp for subsequent calls to work.
Steps to Reproduce
- Configure a Streamable HTTP MCP server (e.g., hosted on AWS Bedrock AgentCore)
- Use it normally for 30+ minutes (long enough for a server-side session timeout or network blip)
- Trigger a tool call right as the HTTP connection drops (or force a drop by restarting the server)
- The tool call hangs indefinitely with "still running (30s elapsed)..." messages
- Only recovery: press Escape to cancel, then manually run
/mcpto reconnect
Expected Behavior
When the HTTP SSE connection drops, all pending request Promises should be immediately rejected with an error (e.g., "connection lost"), and the client should automatically reconnect for subsequent calls.
Actual Behavior
09:50:02 — Tool 'workspace_load' dispatched
09:50:04 — HTTP connection dropped after 2820s uptime
09:50:04 — Connection error: Received a response for an unknown message ID (server's -32010 error for dead session)
09:50:32 — Tool 'workspace_load' still running (30s elapsed)
09:50:41 — user-cancel after 38s (only way to recover)
After cancel, the connection remains broken. User must manually /mcp reconnect (~9 min later in this case):
09:57:59 — User triggers /mcp reconnect (settings.local.json change detected)
09:59:45 — "HTTP transport closed/disconnected, attempting automatic reconnection"
09:59:48 — "HTTP reconnection successful after 3182ms (attempt 1)"
09:59:53 — workspace_load succeeds in 17s
Once reconnected, everything works normally (subsequent calls: 5s, 1s, 12s).
Root Cause
The MCP SDK's StreamableHTTPClientTransport detects the connection drop but doesn't:
- Reject Promises for requests that were in-flight on the old connection
- Automatically trigger reconnection after the drop
The timeoutMs: 60000 option only applies to connection setup, not to individual tool calls. There is no per-request timeout.
Proposed Fix
- When the HTTP connection drops (SSE stream closes), immediately reject all pending request Promises with a connection error
- Automatically trigger reconnection after a connection drop (don't wait for user to run
/mcp) - Optionally, expose a configurable per-tool-call timeout (e.g.,
MCP_TOOL_TIMEOUT) that races eachcallToolwith a deadline
Related Issues
- Plugin MCP tools hang indefinitely with no timeout or error #43342 — Plugin MCP tools hang indefinitely with no timeout or error
- [FEATURE] Make MCP tool call timeout configurable (MCP_TOOL_TIMEOUT) #47076 — Make MCP tool call timeout configurable (MCP_TOOL_TIMEOUT)
- [BUG] MCP Streamable HTTP client does not re-initialize after server-side session invalidation #27142 — Streamable HTTP client does not re-initialize after session invalidation
- MCP tools silently disappear mid-session with no reconnection capability #15758 — MCP tools silently disappear mid-session
- MCP servers should auto-reconnect when disconnected mid-session #36308 — MCP servers should auto-reconnect when disconnected
Environment Info
- Platform: darwin (macOS)
- Version: 2.1.126
- Transport: Streamable HTTP (
"type": "http") - MCP server: Custom server on AWS Bedrock AgentCore Runtime
Activity
github-actions commentedon May 4, 2026
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
github-actions commentedon May 8, 2026
This issue has been automatically closed as a duplicate of #44006.
If this is incorrect, please re-open this issue or create a new one.
🤖 Generated with Claude Code
github-actions commentedon Jun 27, 2026
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.