using ModelContextProtocol.Protocol; using System.Net.ServerSentEvents; namespace ModelContextProtocol.Server; /// /// Provides read access to an SSE event stream, allowing events to be consumed asynchronously. /// public interface ISseEventStreamReader { /// /// Gets the session ID associated with the stream being read. /// string SessionId { get; } /// /// Gets the ID of the stream. /// /// /// This value is guaranteed to be unique on a per-session basis. /// string StreamId { get; } /// /// Gets the messages from the stream as an . /// /// A token to cancel the operation. /// An of containing JSON-RPC messages. /// /// If the stream's mode is set to , the returned /// messages will only include the currently-available events starting at the last event ID specified /// when the reader was created. Otherwise, the returned messages will continue until the associated /// is disposed. /// IAsyncEnumerable> ReadEventsAsync(CancellationToken cancellationToken = default); }