Repository navigation
fix(server): deliver resource updates to modern listen subscriptions - #1976
Open
Coding-Professional wants to merge 1 commit into
Open
Coding-Professional wants to merge 1 commit into
Coding-Professional wants to merge 1 commit into
Conversation
Contributor
Author
|
CI update: The initial Ubuntu Debug run timed out after seven minutes of test inactivity during the existing StdioClientTransportTests.CreateAsync_ValidProcessInvalidServer_StdErrCallbackInvoked test. A fresh run on commit 7e3560d completed successfully: all six build/test matrix jobs, analysis, markdown checks, and coverage publishing are green. No rerun is needed. |
Coding-Professional
force-pushed
the
fix/1930-resource-update-subscriptions
branch
from
October 30, 2026 09:50
cb8c825 to
7e3560d
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
A server can call
SendNotificationAsync(NotificationMethods.ResourceUpdatedNotification, ...)to inform legacyresources/subscribeclients that a resource changed. On a 2026-07-28 connection, clients instead request a URI throughsubscriptions/listen'sresourceSubscriptionsfilter, but the built-in server handler only fans out*/list_changed. The application-sent resource update is not delivered on those listen streams.Change
Route an application-sent
notifications/resources/updatedto each active, built-insubscriptions/listenstream that was granted its URI. Each delivery uses the listen request's transport and_meta["io.modelcontextprotocol/subscriptionId"]; unrelated subscriptions and clients without a listen stream receive nothing. Clone the notification params per delivery so the application's metadata remains intact and multiple subscriptions do not share a parentedJsonNode.Legacy sessions continue to receive their session-wide notification. A custom
SubscriptionsListenHandlerremains a full replacement, and the built-in stateless HTTP handler continues to grant no subscriptions. The resource guide documents these boundaries.Regression tests cover two matching streams, an unrelated URI, application metadata, no active listener, absence of the subscribe capability, and legacy delivery. The no-listener test first sends an ordinary modern request because
server/discoveris only a probe and does not commit the session's protocol version.Validation
SubscriptionsListenTests: 7 passed on .NET 10 and 7 passed on .NET 8 (Windows).ModelContextProtocol.Corebuilds fornet8.0,net9.0,net10.0, andnetstandard2.0with 0 warnings and 0 errors.Fixes #1930