Skip to content

Fix streamable HTTP SSE tests for Node v26.7.0+ (Fixes #2661) - #2707

Open
mukktinaadh wants to merge 1 commit into
modelcontextprotocol:mainfrom
mukktinaadh:main
Open

Fix streamable HTTP SSE tests for Node v26.7.0+ (Fixes #2661)#2707
mukktinaadh wants to merge 1 commit into
modelcontextprotocol:mainfrom
mukktinaadh:main

Conversation

@mukktinaadh

Copy link
Copy Markdown

Summary

This PR fixes the streamable HTTP SSE tests that were failing on Node v26.7.0+.

Problem

On Node v26.7.0+, the fetch API can deliver SSE events in separate chunks rather than delivering multiple SSE events in a single chunk. The existing tests assumed that multiple SSE events would arrive in a single reader.read() call, causing them to fail when events were split across multiple chunks.

Changes

  1. Batch request SSE test (should handle batch request messages with SSE stream for responses): Updated to read from the SSE stream in a loop until all expected responses are received or a timeout occurs.

  2. Notification replay test (should store and replay MCP server tool notifications): Updated both the initial read and the reconnect read to keep reading until the expected notifications are received.

Testing

  • All existing tests pass (99 tests in streamableHttp.test.ts)
  • The modified tests now correctly handle SSE events that arrive in separate chunks

Related Issues

Fixes #2661

…otocol#2661)

- Update batch request SSE test to read until all responses received
- Update notification replay test to read until expected notifications received
- Both tests now handle Node v26.7.0+ where SSE events may arrive in separate chunks

Fixes modelcontextprotocol#2661
@mukktinaadh
mukktinaadh requested a review from a team as a code owner August 24, 2026 06:47
@changeset-bot

changeset-bot Bot commented Aug 24, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 26e943b

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@pkg-pr-new

pkg-pr-new Bot commented Aug 24, 2026

Copy link
Copy Markdown

Open in StackBlitz

@modelcontextprotocol/client

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

@modelcontextprotocol/codemod

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

@modelcontextprotocol/core

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

@modelcontextprotocol/server

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

@modelcontextprotocol/server-legacy

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

@modelcontextprotocol/express

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

@modelcontextprotocol/fastify

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

@modelcontextprotocol/hono

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

@modelcontextprotocol/node

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

commit: 26e943b

@claude claude Bot added the v2 Ideas, requests and plans for v2 of the SDK which will incorporate major changes and fixes label Aug 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v2 Ideas, requests and plans for v2 of the SDK which will incorporate major changes and fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Streamable HTTP SSE tests assume multiple events share one fetch chunk

1 participant