Skip to content

Conversation

@LucaButBoring
Copy link
Contributor

@LucaButBoring LucaButBoring commented Feb 10, 2026

Fixes server-initiated requests (roots/list, sampling, elicitation) hanging over sHTTP when not issued as part of a client-to-server request. The client now retries opening the GET SSE stream after receiving a session ID during initialization.

Motivation and Context

Without this fix, sending requests to the client (particularly roots/elicitation requests) hangs on the server unless that is bounded by some other request, like a tool call. Naturally, this doesn't guarantee compatibility with any other SDK, but at least ensures that using the client and server from this SDK together works as intended.

How Has This Been Tested?

Updated unit/integration tests.

Breaking Changes

None.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Additional context

Should fix #1167
v1 backport: #1520

Add 6 tests for roots/list bidirectional request flow:
- Successful request/response with client handler
- Empty roots list handling
- Multiple roots array
- Optional name and _meta fields
- sendRootsListChanged notification
- Handler context verification
@LucaButBoring LucaButBoring requested a review from a team as a code owner February 10, 2026 22:57
@changeset-bot
Copy link

changeset-bot bot commented Feb 10, 2026

⚠️ No Changeset found

Latest commit: df95456

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
Copy link

pkg-pr-new bot commented Feb 10, 2026

Open in StackBlitz

@modelcontextprotocol/client

npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/client@1521

@modelcontextprotocol/server

npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/server@1521

@modelcontextprotocol/express

npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/express@1521

@modelcontextprotocol/hono

npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/hono@1521

@modelcontextprotocol/node

npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/node@1521

commit: df95456

Fixes server-initiated requests (roots/list, sampling, elicitation)
hanging over HTTP transport. The client now retries opening the GET SSE
stream after receiving a session ID during initialization.

Fixes: modelcontextprotocol#1167
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.

Support roots/list request from server to client

1 participant