using ModelContextProtocol.Protocol; namespace ModelContextProtocol.Server; /// /// Provides configuration options for the MCP server. /// public class McpServerOptions { /// /// Gets or sets information about this server implementation, including its name and version. /// /// /// This information is sent to the client during initialization to identify the server. /// It's displayed in client logs and can be used for debugging and compatibility checks. /// public Implementation? ServerInfo { get; set; } /// /// Gets or sets server capabilities to advertise to the client. /// /// /// These determine which features will be available when a client connects. /// Capabilities can include "tools", "prompts", "resources", "logging", and other /// protocol-specific functionality. /// public ServerCapabilities? Capabilities { get; set; } /// /// Gets or sets the protocol version supported by this server, using a date-based versioning scheme. /// /// /// The protocol version defines which features and message formats this server supports. /// This uses a date-based versioning scheme in the format "YYYY-MM-DD". /// public string ProtocolVersion { get; set; } = "2024-11-05"; /// /// Gets or sets a timeout used for the client-server initialization handshake sequence. /// /// /// This timeout determines how long the server will wait for client responses during /// the initialization protocol handshake. If the client doesn't respond within this timeframe, /// the initialization process will be aborted. /// public TimeSpan InitializationTimeout { get; set; } = TimeSpan.FromSeconds(60); /// /// Gets or sets optional server instructions to send to clients. /// /// /// These instructions are sent to clients during the initialization handshake and provide /// guidance on how to effectively use the server's capabilities. They can include details /// about available tools, expected input formats, limitations, or other helpful information. /// Client applications typically use these instructions as system messages for LLM interactions /// to provide context about available functionality. /// public string? ServerInstructions { get; set; } /// /// Gets or sets whether to create a new service provider scope for each handled request. /// /// /// The default is . When , each invocation of a request /// handler will be invoked within a new service scope. /// public bool ScopeRequests { get; set; } = true; /// /// Gets or sets preexisting knowledge about the client including its name and version to help support /// stateless Streamable HTTP servers that encode this knowledge in the mcp-session-id header. /// /// /// /// When not specified, this information is sourced from the client's initialize request. /// /// public Implementation? KnownClientInfo { get; set; } }