Table of Contents

Class SseClientTransportOptions

Namespace
ModelContextProtocol.Client
Assembly
ModelContextProtocol.Core.dll

Provides options for configuring SseClientTransport instances.

public sealed class SseClientTransportOptions
Inheritance
SseClientTransportOptions
Inherited Members

Properties

AdditionalHeaders

Gets custom HTTP headers to include in requests to the SSE server.

public IDictionary<string, string>? AdditionalHeaders { get; set; }

Property Value

IDictionary<string, string>

Remarks

Use this property to specify custom HTTP headers that should be sent with each request to the server.

ConnectionTimeout

Gets or sets a timeout used to establish the initial connection to the SSE server. Defaults to 30 seconds.

public TimeSpan ConnectionTimeout { get; set; }

Property Value

TimeSpan

Remarks

This timeout controls how long the client waits for:

  • The initial HTTP connection to be established with the SSE server
  • The endpoint event to be received, which indicates the message endpoint URL
If the timeout expires before the connection is established, a TimeoutException will be thrown.

Endpoint

Gets or sets the base address of the server for SSE connections.

public required Uri Endpoint { get; set; }

Property Value

Uri

Name

Gets or sets a transport identifier used for logging purposes.

public string? Name { get; set; }

Property Value

string

OAuth

Gets sor sets the authorization provider to use for authentication.

public ClientOAuthOptions? OAuth { get; set; }

Property Value

ClientOAuthOptions

TransportMode

Gets or sets the transport mode to use for the connection. Defaults to AutoDetect.

public HttpTransportMode TransportMode { get; set; }

Property Value

HttpTransportMode

Remarks

When set to AutoDetect (the default), the client will first attempt to use Streamable HTTP transport and automatically fall back to SSE transport if the server doesn't support it.

Streamable HTTP transport specification. HTTP with SSE transport specification.