Streamable HTTP resumability + redelivery + SSE polling via server-side disconnect (#1077)
Co-authored-by: Stephen Halter <halter73@gmail.com>
This commit is contained in:
parent
4cb2fd4655
commit
b8311756b4
1 changed files with 2675 additions and 246 deletions
|
|
@ -41,10 +41,12 @@ public static class McpEndpointRouteBuilderExtensions
|
|||
|
||||
if (!streamableHttpHandler.HttpServerTransportOptions.Stateless)
|
||||
{
|
||||
// The GET and DELETE endpoints are not mapped in Stateless mode since there's no way to send unsolicited messages
|
||||
// for the GET to handle, and there is no server-side state for the DELETE to clean up.
|
||||
// The GET endpoint is not mapped in Stateless mode since there's no way to send unsolicited messages.
|
||||
// Resuming streams via GET is currently not supported in Stateless mode.
|
||||
streamableHttpGroup.MapGet("", streamableHttpHandler.HandleGetRequestAsync)
|
||||
.WithMetadata(new ProducesResponseTypeMetadata(StatusCodes.Status200OK, contentTypes: ["text/event-stream"]));
|
||||
|
||||
// The DELETE endpoint is not mapped in Stateless mode since there is no server-side state for the DELETE to clean up.
|
||||
streamableHttpGroup.MapDelete("", streamableHttpHandler.HandleDeleteRequestAsync);
|
||||
|
||||
// Map legacy HTTP with SSE endpoints only if not in Stateless mode, because we cannot guarantee the /message requests
|
||||
|
|
|
|||
Loading…
Reference in a new issue