Add AspNetCoreSseServer sample (#81)

* Add AspNetCoreSseMcpTransport sample

* Fix build errors after rebase

* React to McpServerFactory changes

* Make Utf8JsonWriter non thread static

* Fix test errors caused by not rebasing the HttpLister changes on factory overhaul commit
This commit is contained in:
Stephen Halter 2025-03-18 03:56:44 -07:00 • committed by GitHub
commit 90dfc35fbd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -9,36 +9,36 @@ namespace McpDotNet.Server;
/// protocol version.
/// <see href="https://spec.modelcontextprotocol.io/specification/2024-11-05/basic/lifecycle/">See the protocol specification for details on capability negotiation</see>
/// </summary>
public record McpServerOptions
public class McpServerOptions
{
/// <summary>
/// Information about this server implementation.
/// </summary>
public required Implementation ServerInfo { get; init; }
public required Implementation ServerInfo { get; set; }
/// <summary>
/// Server capabilities to advertise to the server.
/// </summary>
public ServerCapabilities? Capabilities { get; init; }
public ServerCapabilities? Capabilities { get; set; }
/// <summary>
/// Protocol version to request from the server.
/// </summary>
public string ProtocolVersion { get; init; } = "2024-11-05";
public string ProtocolVersion { get; set; } = "2024-11-05";
/// <summary>
/// Timeout for initialization sequence.
/// </summary>
public TimeSpan InitializationTimeout { get; init; } = TimeSpan.FromSeconds(60);
public TimeSpan InitializationTimeout { get; set; } = TimeSpan.FromSeconds(60);
/// <summary>
/// Optional server instructions to send to clients
/// </summary>
public string ServerInstructions { get; init; } = string.Empty;
public string ServerInstructions { get; set; } = string.Empty;
/// <summary>
/// Gets or sets the handler for get completion requests.
/// </summary>
[JsonIgnore]
public Func<RequestContext<CompleteRequestParams>, CancellationToken, Task<CompleteResult>>? GetCompletionHandler { get; init; }
public Func<RequestContext<CompleteRequestParams>, CancellationToken, Task<CompleteResult>>? GetCompletionHandler { get; set; }
}