Add server-side Streamable HTTP transport support (#330)
- Changes IJsonRpcMessage to an abstract base class so RelatedTransport will always be available - Streamable HTTP supports multiple concurrent HTTP request with their own indpendent SSE response streams - RelatedTransport indicates the source or destination of the JsonRpcMessage - Changes the default RequestId to a JSON number for better compatibility with MCP servers in the wild
This commit is contained in:
parent
7d77be68cf
commit
7dcba357d4
1 changed files with 1637 additions and 395 deletions
|
|
@ -21,4 +21,17 @@ public class HttpServerTransportOptions
|
|||
/// This is useful for running logic before a sessions starts and after it completes.
|
||||
/// </summary>
|
||||
public Func<HttpContext, IMcpServer, CancellationToken, Task>? RunSessionHandler { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Represents the duration of time the server will wait between any active requests before timing out an
|
||||
/// MCP session. This is checked in background every 5 seconds. A client trying to resume a session will
|
||||
/// receive a 404 status code and should restart their session. A client can keep their session open by
|
||||
/// keeping a GET request open. The default value is set to 2 minutes.
|
||||
/// </summary>
|
||||
public TimeSpan IdleTimeout { get; set; } = TimeSpan.FromMinutes(2);
|
||||
|
||||
/// <summary>
|
||||
/// Used for testing the <see cref="IdleTimeout"/>.
|
||||
/// </summary>
|
||||
public TimeProvider TimeProvider { get; set; } = TimeProvider.System;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue