Table of Contents

Class InitializeResult

Namespace
ModelContextProtocol.Protocol
Assembly
ModelContextProtocol.Core.dll

Represents the result of a Initialize request sent to the server during connection establishment.

public class InitializeResult
Inheritance
InitializeResult
Inherited Members

Remarks

The InitializeResult is sent by the server in response to an InitializeRequestParams message from the client. It contains information about the server, its capabilities, and the protocol version that will be used for the session.

After receiving this response, the client should send an InitializedNotification notification to complete the handshake.

See the schema for details.

Properties

Capabilities

Gets or sets the server's capabilities.

[JsonPropertyName("capabilities")]
public required ServerCapabilities Capabilities { get; init; }

Property Value

ServerCapabilities

Remarks

This defines the features the server supports, such as "tools", "prompts", "resources", or "logging", and other protocol-specific functionality.

Instructions

Gets or sets optional instructions for using the server and its features.

[JsonPropertyName("instructions")]
public string? Instructions { get; init; }

Property Value

string

Remarks

These instructions provide guidance to clients on how to effectively use the server's capabilities. They can include details about available tools, expected input formats, limitations, or any other information that helps clients interact with the server properly.

Client applications often use these instructions as system messages for LLM interactions to provide context about available functionality.

ProtocolVersion

Gets or sets the version of the Model Context Protocol that the server will use for this session.

[JsonPropertyName("protocolVersion")]
public required string ProtocolVersion { get; init; }

Property Value

string

Remarks

This is the protocol version the server has agreed to use, which should match the client's requested version. If there's a mismatch, the client should throw an exception to prevent communication issues due to incompatible protocol versions.

The protocol uses a date-based versioning scheme in the format "YYYY-MM-DD".

See the protocol specification for version details.

ServerInfo

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

[JsonPropertyName("serverInfo")]
public required Implementation ServerInfo { get; init; }

Property Value

Implementation

Remarks

This information identifies the server during the initialization handshake. Clients may use this information for logging, debugging, or compatibility checks.