Skip to content

InspectorClient.disconnect() never terminates a Streamable HTTP session (no DELETE) #2924

Closed

Description

@cliffhall

The problem

InspectorClient.disconnect() (core/mcp/inspectorClient.ts) closes the SDK client and its local streams but never calls the Streamable HTTP transport's terminateSession(), so no DELETE with the Mcp-Session-Id reaches the server. The spec says a client that no longer needs a session SHOULD send one. A stateful server therefore keeps every session the Inspector opened until its own idle cleanup runs.

This affects every surface that disconnects: web, TUI, CLI and mcpdo. Load testing makes it most visible. --load-connections leaves N server-side sessions behind per run, and --load-churn (#2912, PR #2923) leaves one behind for every session it opens and closes. On a server with a session cap, that exhausts the cap instead of exercising teardown.

Expected

On disconnect over Streamable HTTP with a session id, send the session-terminating DELETE (best effort: a 405 from a server that does not support it is fine, and other failures must not block local cleanup), then close.

Notes

Raised by the Copilot review on PR #2923 (#2923 (comment)). It was declined there as out of scope, because this is pre-existing InspectorClient behavior shared by all surfaces, not something the churn mode introduced. Once fixed, the load engine's churn closeFailed count will pick up termination failures automatically, because it counts a throwing disconnect().

Activity

  1. added this to the v2.15.0 milestone on Nov 5, 2026
  2. added
    bug
    v2
    on Nov 5, 2026
  3. cliffhall commented on Nov 5, 2026

    @cliffhall
    MemberAuthor

    Triage: Priority Medium (total 6)

    • Severity 3: server-side sessions leak until the server expires them; under load they can exhaust a session cap
    • Urgency 2: wanted soon, nothing blocked on it
    • Bonuses: +1 bug label
  4. self-assigned this
    on Nov 5, 2026
  5. cliffhall commented on Nov 5, 2026

    @cliffhall
    MemberAuthor

    Fixed by #2926 (merged into v2/main as 2a1fb91).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugv2

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions