Write "event: message" to SSE response (#192)

* Write "event: message" to SSE response
* Rename McpJsonRpcEndpoint to McpEndpoint
* Remove unused McpServerConfig.Arguments property
This commit is contained in:
Stephen Halter 2025-04-02 13:26:39 -07:00 • committed by GitHub
commit 9b4db350c3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -76,7 +76,8 @@ public sealed class SseResponseStreamTransport(Stream sseResponseStream, string
throw new InvalidOperationException($"Transport is not connected. Make sure to call {nameof(RunAsync)} first.");
}
await _outgoingSseChannel.Writer.WriteAsync(new SseItem<IJsonRpcMessage?>(message), cancellationToken);
// Emit redundant "event: message" lines for better compatibility with other SDKs.
await _outgoingSseChannel.Writer.WriteAsync(new SseItem<IJsonRpcMessage?>(message, SseParser.EventTypeDefault), cancellationToken);
}
/// <summary>