Skip to content

MCP SSE client hangs indefinitely on dropped connection #26368

Closed as duplicate

Description

@mudgesbot

Description

When using an MCP server over SSE transport (e.g., via Tailscale to a remote host), if the network connection drops mid-session, Claude Code hangs indefinitely when it next tries to call an MCP tool. The user must press Esc to cancel and manually reconnect the MCP server.

Steps to Reproduce

  1. Configure an MCP server with SSE transport (e.g., claude mcp add mem0-local --transport sse http://remote-host:8050/sse)
  2. Start a conversation and use MCP tools successfully
  3. Cause a network interruption (Tailscale hiccup, Wi-Fi drop, server restart, etc.)
  4. Try to use an MCP tool again — Claude Code hangs with no timeout or error

Expected Behavior

  • MCP tool call should timeout after a reasonable period (e.g., 30-60s)
  • Claude Code should display an error like "MCP server unreachable" and offer to reconnect
  • Ideally: automatic reconnection attempt before failing

Actual Behavior

  • Claude Code blocks indefinitely waiting for a response on the dead SSE connection
  • No timeout, no error message
  • User must press Esc to cancel, then manually reconnect the MCP (/mcp → reconnect)

Root Cause Analysis

  • TCP keepalive defaults on macOS are ~2 hours, so the OS doesn't detect the dead connection quickly
  • The MCP SSE client doesn't implement any request-level timeout
  • No SSE heartbeat/keepalive detection on the client side
  • Server-side SSE keepalive pings can help the server detect dead clients, but don't fix the client hanging

Environment

  • Claude Code CLI (latest)
  • macOS (Sequoia 15.3)
  • MCP server: SSE transport over Tailscale VPN
  • Reproducible with any SSE MCP server when network drops

Suggested Fix

  1. Add a configurable timeout to MCP tool calls over SSE (default ~30-60s)
  2. Detect stale SSE connections (e.g., expect periodic keepalive events)
  3. Auto-reconnect on connection failure before returning error to user

Activity

  1. github-actions commented on Feb 17, 2026

    @github-actions

    Found 3 possible duplicate issues:

    1. [BUG] SSE MCP server disconnection crashes session instead of graceful degradation #18557
    2. [BUG] MCP Server Timeout Configuration Ignored in Streamable SSE HTTP Connections #20335
    3. [CRITICAL] MCP Server Causes 16+ Hour Hang - No Timeout or Stuck Detection #15945

    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

  2. github-actions commented on Feb 21, 2026

    @github-actions

    This issue has been automatically closed as a duplicate of #18557.

    If this is incorrect, please re-open this issue or create a new one.

    🤖 Generated with Claude Code

  3. added
    duplicate
    on Feb 21, 2026
  4. github-actions commented on Mar 1, 2026

    @github-actions

    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.

  5. locked as resolved and limited conversation to collaborators on Mar 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicate

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions