Skip to content

Fix streamable HTTP SSE exhaustion#2517

Open
pradeep-ramola wants to merge 2 commits into
modelcontextprotocol:mainfrom
pradeep-ramola:fix-streamable-http-sse-exhaustion
Open

Fix streamable HTTP SSE exhaustion#2517
pradeep-ramola wants to merge 2 commits into
modelcontextprotocol:mainfrom
pradeep-ramola:fix-streamable-http-sse-exhaustion

Conversation

@pradeep-ramola

Copy link
Copy Markdown

Fixes #2098

Summary

Updates StreamableHTTPClientTransport so the standalone GET SSE channel does not silently become unusable after reconnect exhaustion.

This change:

  • raises the default Streamable HTTP SSE reconnection retry count from 2 to 10
  • records when the standalone GET SSE stream exhausts reconnect attempts
  • fails subsequent sends immediately with a clear error instead of POSTing into a dead response channel
  • preserves existing per-request stream exhaustion behavior via onRequestStreamEnd
  • includes response text in failed SSE-open errors when statusText is empty

Testing

  • corepack pnpm --filter @modelcontextprotocol/client exec vitest run test/client/streamableHttp.test.ts
  • corepack pnpm --filter @modelcontextprotocol/client typecheck
  • corepack pnpm --filter @modelcontextprotocol/client build
  • corepack pnpm --filter @modelcontextprotocol/client exec prettier --ignore-path ../../.prettierignore --check src/client/streamableHttp.ts test/client/streamableHttp.test.ts
  • corepack pnpm --filter @modelcontextprotocol/client exec eslint src/client/streamableHttp.ts

@pradeep-ramola
pradeep-ramola requested a review from a team as a code owner July 19, 2026 06:21
@changeset-bot

changeset-bot Bot commented Jul 19, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: ce7a5be

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 6 packages
Name Type
@modelcontextprotocol/client Patch
@modelcontextprotocol/core Patch
@modelcontextprotocol/server Patch
@modelcontextprotocol/server-legacy Patch
@modelcontextprotocol/codemod Patch
@modelcontextprotocol/core-internal Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@pkg-pr-new

pkg-pr-new Bot commented Jul 19, 2026

Copy link
Copy Markdown

Open in StackBlitz

@modelcontextprotocol/client

npm i https://pkg.pr.new/@modelcontextprotocol/client@2517

@modelcontextprotocol/codemod

npm i https://pkg.pr.new/@modelcontextprotocol/codemod@2517

@modelcontextprotocol/core

npm i https://pkg.pr.new/@modelcontextprotocol/core@2517

@modelcontextprotocol/server

npm i https://pkg.pr.new/@modelcontextprotocol/server@2517

@modelcontextprotocol/server-legacy

npm i https://pkg.pr.new/@modelcontextprotocol/server-legacy@2517

@modelcontextprotocol/express

npm i https://pkg.pr.new/@modelcontextprotocol/express@2517

@modelcontextprotocol/fastify

npm i https://pkg.pr.new/@modelcontextprotocol/fastify@2517

@modelcontextprotocol/hono

npm i https://pkg.pr.new/@modelcontextprotocol/hono@2517

@modelcontextprotocol/node

npm i https://pkg.pr.new/@modelcontextprotocol/node@2517

commit: ce7a5be

@pradeep-ramola
pradeep-ramola force-pushed the fix-streamable-http-sse-exhaustion branch from 614cb47 to 0ace7f6 Compare July 19, 2026 06:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

StreamableHTTPClientTransport: 2-retry SSE reconnect ceiling + silent-success after exhaustion

1 participant