Skip to content

SSE transport hangs indefinitely on long-running requests (Mixpanel segmentation queries) #226

@TweedBeetle

Description

@TweedBeetle

Summary

When using mcp-remote to connect to Mixpanel's hosted MCP server (mcp.mixpanel.com/mcp), tool calls frequently hang for 5-55+ minutes before the user cancels them. The exact same queries return in 1-3 seconds when immediately retried, suggesting the SSE transport drops or stalls rather than the upstream server being slow.

Environment

  • Client: Claude Code (CLI)
  • Transport: npx mcp-remote https://mcp.mixpanel.com/mcp --static-oauth-client-metadata '{"scope":"..."}' --allow-http
  • Platform: macOS

Reproduction

  1. Configure Mixpanel MCP via mcp-remote as shown above
  2. Issue a run_segmentation_query tool call with a group-by parameter (e.g., segment chat_started by properties["is_returning_user"])
  3. Observe the call hangs indefinitely (no response, no error)
  4. Cancel and retry the identical call — it completes in 1-3 seconds

Observed behavior

Over a single session (~65 Mixpanel MCP calls), 6 calls hung indefinitely:

Query Hang duration Retry time
Segmentation with group-by 46 min 1.4s
Same + filter 1.8 min ~1s
get_events (list all) 12.3 min 5.8s
Segmentation, 2-month range, group-by 4.4 min 1.9s
Segmentation, group-by error_type 4.4 min ~1s
Two parallel segmentation queries with type: "unique" 55.8 min each ~1s

The remaining ~59 calls completed in 1-5 seconds normally.

Pattern

  • Calls with group-by clauses and parallel execution seem more susceptible
  • When 2-3 calls are issued simultaneously, one completes while others hang
  • No error is ever returned — the call simply never resolves
  • Instant success on retry rules out upstream API slowness

Possible relation to #107

Issue #107 describes SSE connections being terminated after 5 minutes of inactivity, with undici's idle-body timeout being the culprit. This may be related — perhaps the response stream stalls briefly and the connection enters a broken state without propagating an error, causing the call to hang forever instead of timing out.

Expected behavior

Requests should either complete or fail with a timeout error within a reasonable window (30-60 seconds), not hang indefinitely.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions