-
Notifications
You must be signed in to change notification settings - Fork 600
Streamable HTTP resumability + redelivery + SSE polling via server-side disconnect #1077
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
Open
MackinnonBuck
wants to merge
38
commits into
main
Choose a base branch
from
mbuck/resumability-redelivery
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+2,675
−246
Conversation
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
halter73
reviewed
Dec 9, 2025
src/ModelContextProtocol.Core/Protocol/JsonRpcMessageContext.cs
Outdated
Show resolved
Hide resolved
src/ModelContextProtocol.Core/Server/StreamableHttpServerTransport.cs
Outdated
Show resolved
Hide resolved
tests/ModelContextProtocol.AspNetCore.Tests/Utils/InMemoryEventStore.cs
Outdated
Show resolved
Hide resolved
stephentoub
reviewed
Dec 9, 2025
src/ModelContextProtocol.AspNetCore/HttpServerTransportOptions.cs
Outdated
Show resolved
Hide resolved
src/ModelContextProtocol.Core/Client/StreamableHttpClientSessionTransport.cs
Outdated
Show resolved
Hide resolved
src/ModelContextProtocol.Core/Client/StreamableHttpClientSessionTransport.cs
Show resolved
Hide resolved
mikekistler
reviewed
Dec 11, 2025
Contributor
mikekistler
left a comment
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.
I didn't get through all of this but want to share the comments I've made so far.
348fac0 to
493062a
Compare
MackinnonBuck
commented
Dec 17, 2025
src/ModelContextProtocol.AspNetCore/McpEndpointRouteBuilderExtensions.cs
Show resolved
Hide resolved
src/ModelContextProtocol.Core/Server/StreamableHttpServerTransport.cs
Outdated
Show resolved
Hide resolved
halter73
reviewed
Dec 18, 2025
src/ModelContextProtocol.AspNetCore/McpEndpointRouteBuilderExtensions.cs
Show resolved
Hide resolved
src/ModelContextProtocol.Core/Server/StreamableHttpServerTransport.cs
Outdated
Show resolved
Hide resolved
src/ModelContextProtocol.Core/Server/StreamableHttpServerTransport.cs
Outdated
Show resolved
Hide resolved
tests/ModelContextProtocol.AspNetCore.Tests/Utils/KestrelInMemoryTest.cs
Outdated
Show resolved
Hide resolved
src/ModelContextProtocol.Core/Server/StreamableHttpServerTransport.cs
Outdated
Show resolved
Hide resolved
src/ModelContextProtocol.Core/Client/HttpClientTransportOptions.cs
Outdated
Show resolved
Hide resolved
halter73
reviewed
Dec 18, 2025
src/ModelContextProtocol.Core/Server/StreamableHttpPostTransport.cs
Outdated
Show resolved
Hide resolved
…s.cs Co-authored-by: Stephen Halter <[email protected]>
halter73
reviewed
Jan 7, 2026
src/ModelContextProtocol.Core/Server/StreamableHttpServerTransport.cs
Outdated
Show resolved
Hide resolved
src/ModelContextProtocol.Core/Server/StreamableHttpPostTransport.cs
Outdated
Show resolved
Hide resolved
tests/ModelContextProtocol.AspNetCore.Tests/SseEventStreamStoreTests.cs
Outdated
Show resolved
Hide resolved
MackinnonBuck
commented
Jan 9, 2026
tests/ModelContextProtocol.AspNetCore.Tests/StreamableHttpServerConformanceTests.cs
Show resolved
Hide resolved
scutuatua-crypto
approved these changes
Jan 10, 2026
halter73
reviewed
Jan 12, 2026
src/ModelContextProtocol.Core/Client/StreamableHttpClientSessionTransport.cs
Outdated
Show resolved
Hide resolved
src/ModelContextProtocol.Core/Client/StreamableHttpClientSessionTransport.cs
Show resolved
Hide resolved
src/ModelContextProtocol.Core/Server/StreamableHttpPostTransport.cs
Outdated
Show resolved
Hide resolved
src/ModelContextProtocol.Core/Server/StreamableHttpPostTransport.cs
Outdated
Show resolved
Hide resolved
src/ModelContextProtocol.Core/Server/StreamableHttpServerTransport.cs
Outdated
Show resolved
Hide resolved
src/ModelContextProtocol.Core/Server/StreamableHttpServerTransport.cs
Outdated
Show resolved
Hide resolved
tests/ModelContextProtocol.AspNetCore.Tests/ResumabilityIntegrationTests.cs
Show resolved
Hide resolved
…onTransport.cs Co-authored-by: Stephen Halter <[email protected]>
halter73
previously approved these changes
Jan 14, 2026
Contributor
halter73
left a comment
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.
This looks really good. Thanks for responding to all the feedback!
src/ModelContextProtocol.Core/Server/StreamableHttpPostTransport.cs
Outdated
Show resolved
Hide resolved
src/ModelContextProtocol.Core/Server/StreamableHttpPostTransport.cs
Outdated
Show resolved
Hide resolved
src/ModelContextProtocol.Core/Server/StreamableHttpPostTransport.cs
Outdated
Show resolved
Hide resolved
halter73
approved these changes
Jan 15, 2026
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.
Overview
This PR implements the following features:
Last-Event-IDheaderISseEventStreamStoreabstraction to allow for storage and replay of SSE eventsLast-Event-IDheaderEach of these features has been split into its own commit for ease of review.
Description
There are two disconnection scenarios covered by this PR:
If a network error occurs, and an
ISseEventStreamStoreis configured, then the client may attempt to reconnect by making a GET request with aLast-Event-IDheader. The server will then replay stored events before continuing to use the new GET response to stream remaining events. If further disconnections happen, the client may continue to make new GET requests to resume the stream. This applies for both client-initiated requests (POST) and the unsolicited message stream (GET).However, the server can also initiate a disconnection and force the client to poll for updates. This is useful for avoiding long-running streams. This can be done via the new
RequestContext<TParams>.EnablePollingAsync(TimeSpan retryInterval, CancellationToken cancellationToken = default)API. When the client reconnects via GET with aLast-Event-ID, the response will only contain events currently available in theISseEventStreamStorebefore completing. The client must continue initiating new GET requests at the specifiedretryIntervaluntil the final response is received.Fixes #510
Fixes #1020