-
Notifications
You must be signed in to change notification settings - Fork 568
feat: route SEP-2260 associated server requests to the originating SSE stream #1029
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
alexhancock
merged 12 commits into
modelcontextprotocol:main
from
gocamille:sep-2260-transport-association
Jul 23, 2026
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
003314a
feat: implement SEP-2260 require server requests to associate with cl…
alexhancock 4256250
feat(service): attach originating request id to in-handler outbound r…
gocamille 4736211
feat(transport): route associated server requests to originating SSE …
gocamille e0f0f11
test: end-to-end SEP-2260 stream routing over streamable HTTP
gocamille 98a51ac
test: register SEP-2260 routing test with required-features; drop dea…
gocamille 7618d2b
docs: document SEP-2260 association requirement and stream routing
gocamille f2bae31
docs: fix redundant explicit link on OriginatingRequestId
gocamille 3eced5e
docs: note marker is role-agnostic; add reason to deprecated expect
gocamille c6f7aea
docs: condense inline comments to repo convention
gocamille 5a5de82
docs: condense SEP-2260 rustdoc sections
gocamille cdce2a0
docs: single-source SEP-2260 caller requirements on OriginatingRequestId
gocamille 4039fd9
feat(service): reject unassociated server-to-client requests on the c…
gocamille File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason we don't also do this in
service/client.rs? Trying to figure out where this part of the spec is implemented:I think it may be missing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes @alexhancock it wasn't implemented anywhere, good catch. SEP-2260 defines no wire field, so the exact association is only seen at the transport layer and our streamable HTTP client merges the standalone GET stream and POST-response SSE streams into one flat stream before the service layer sees anything. On
stdiothere's no channel separation at all.In f0b7fd3 if the client receives one of these requests with no outbound request in flight, it now responds with -32602. This only applies when the negotiated protocol is 2026-07-28+, and
pingis exempt. The check lives in a new receive-sideServiceRole::enforce_peer_request_associationhook, mirroring the send-side one from #1027.For now the check is intentionally loose: with a request in flight we can't tell which outbound request the server request belongs to, so we accept it. Doing this properly (rejecting these requests when they arrive on the standalone GET stream, even while unrelated requests are in flight) needs the client transport to keep track of which stream each message came in on. If it's helpful I can file a follow-up so this PR stays scoped to routing plus the coarse check.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That sounds good to me for now, yes. Thanks for the updated commit.