-
Notifications
You must be signed in to change notification settings - Fork 624
Description
Is your feature request related to a problem? Please describe.
When an MCP session ends, the SSE event streams stored by ISseEventStreamStore for that session are not proactively cleaned up. They persist until cache expiration removes them. This wastes storage, especially in high-throughput scenarios with many short-lived sessions.
Describe the solution you'd like
Add a DeleteStreamsForSessionAsync(string sessionId, CancellationToken) method to ISseEventStreamStore that deletes all stored streams and their associated events for a given session.
Describe alternatives you've considered
An alternative is to rely solely on cache expiration to keep resource consumption low. Since it is relatively easy to catch session terminations (with RunSessionHandler), it seems reasonable to provide a means to delete the streams for this session since they are known to be no longer needed.
Additional context