Class HttpSseMcpClient
HTTP + SSE transport. POSTs JSON-RPC requests to the base URL, opens a parallel
SSE channel (GET) for server-initiated frames (notifications, tools/list_changed).
Bearer auth via .
public sealed class HttpSseMcpClient : McpClientBase, IMcpClient, IAsyncDisposable
Inheritance
Implements
Inherited Members
McpClientBase.CallToolAsync(string, JsonNode?, CancellationToken),McpClientBase.DisposeAsync(),McpClientBase.Initialize,McpClientBase.InitializeAsync(CancellationToken),McpClientBase.ListToolsAsync(CancellationToken),McpClientBase.Logger,McpClientBase.OnFrameReceived(string),McpClientBase.OnTransportFailed(string?),McpClientBase.SendFrameAsync(string, CancellationToken),McpClientBase.ServerName,McpClientBase.StartTransportAsync(CancellationToken),McpClientBase.Status,McpClientBase.StopTransportAsync()
Methods
SendFrameAsync(string, CancellationToken)
Writes a single JSON frame to the server. Implementations must serialize concurrent writes.
protected override Task SendFrameAsync(string frameJson, CancellationToken cancellationToken)
StartTransportAsync(CancellationToken)
Brings up the byte-level transport (e.g. spawn process, open HTTP/SSE channels).
protected override Task StartTransportAsync(CancellationToken cancellationToken)
StopTransportAsync()
Tears the transport down. Should not throw on already-stopped state.
protected override Task StopTransportAsync()
Constructors
HttpSseMcpClient(string, McpTransport, ILogger, HttpClient?)
Creates a new HTTP+SSE MCP client.