Table of Contents

Class McpServerOptions

Namespace
ModelContextProtocol.Server
Assembly
ModelContextProtocol.dll

Provides configuration options for the MCP server.

public class McpServerOptions
Inheritance
McpServerOptions
Inherited Members

Properties

Capabilities

Gets or sets server capabilities to advertise to the client.

public ServerCapabilities? Capabilities { get; set; }

Property Value

ServerCapabilities

Remarks

These determine which features will be available when a client connects. Capabilities can include "tools", "prompts", "resources", "logging", and other protocol-specific functionality.

InitializationTimeout

Gets or sets a timeout used for the client-server initialization handshake sequence.

public TimeSpan InitializationTimeout { get; set; }

Property Value

TimeSpan

Remarks

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.

ProtocolVersion

Gets or sets the protocol version supported by this server, using a date-based versioning scheme.

public string ProtocolVersion { get; set; }

Property Value

string

Remarks

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".

ScopeRequests

Gets or sets whether to create a new service provider scope for each handled request.

public bool ScopeRequests { get; set; }

Property Value

bool

Remarks

The default is true. When true, each invocation of a request handler will be invoked within a new service scope.

ServerInfo

Gets or sets information about this server implementation, including its name and version.

public Implementation? ServerInfo { get; set; }

Property Value

Implementation

Remarks

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.

ServerInstructions

Gets or sets optional server instructions to send to clients.

public string? ServerInstructions { get; set; }

Property Value

string

Remarks

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.