Fix support for sending server notifications with request-specific McpServer instances used outside their original scope. (#832)

* Fix support for sending server notifications with request-specific McpServer instances used outside their original scope.

* Address feedback.

* Update src/ModelContextProtocol.Core/Server/SseWriter.cs
This commit is contained in:
Eirik Tsarpalis 2025-10-06 18:50:33 +03:00 • committed by GitHub
commit 93834d1aec
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -131,6 +131,7 @@ public sealed class StreamableHttpServerTransport : ITransport
throw new InvalidOperationException("Unsolicited server to client messages are not supported in stateless mode.");
}
// If the underlying writer has been disposed, just drop the message.
await _sseWriter.SendMessageAsync(message, cancellationToken).ConfigureAwait(false);
}