Class HttpServerTransportOptions
- Namespace
- ModelContextProtocol.AspNetCore
- Assembly
- ModelContextProtocol.AspNetCore.dll
Configuration options for McpEndpointRouteBuilderExtensions.MapMcp. which implements the Streaming HTTP transport for the Model Context Protocol. See the protocol specification for details on the Streamable HTTP transport. https://modelcontextprotocol.io/specification/2025-03-26/basic/transports#streamable-http
public class HttpServerTransportOptions
- Inheritance
-
HttpServerTransportOptions
- Inherited Members
Properties
ConfigureSessionOptions
Gets or sets an optional asynchronous callback to configure per-session McpServerOptions with access to the HttpContext of the request that initiated the session.
public Func<HttpContext, McpServerOptions, CancellationToken, Task>? ConfigureSessionOptions { get; set; }
Property Value
IdleTimeout
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.
public TimeSpan IdleTimeout { get; set; }
Property Value
RunSessionHandler
Gets or sets an optional asynchronous callback for running new MCP sessions manually. This is useful for running logic before a sessions starts and after it completes.
public Func<HttpContext, IMcpServer, CancellationToken, Task>? RunSessionHandler { get; set; }
Property Value
TimeProvider
Used for testing the IdleTimeout.
public TimeProvider TimeProvider { get; set; }