Add MCP event discovery and subscriptions (#37494)

## What changed

- Expose hosted Plugin Runtime event definitions through `McpResourceClient::list_events`.
- Add cancellable `events/stream` subscriptions that route lifecycle notifications to the matching request and cancel when the stream is dropped.
- Bound event notification and queue sizes, time out stalled response headers, and close streamable HTTP responses locally on cancellation.

## Testing

- Add streamable HTTP integration coverage for isolated concurrent subscriptions, local cancellation, and stalled response-header timeouts.

GitOrigin-RevId: 98c6fffa8f004eb2638c1b0705f659222cbbdfdb
This commit is contained in:
Evan Fannin authored and copyberry committed 2026-08-07 19:36:52 +00:00
1 parent 2b1811e562
commit 41014b11bd
8 files changed
+837 -30

No files matched your search

@@ -156,7 +156,10 @@ impl McpConnectionSet {
.with_context(|| format!("resources/read failed for `{server}` ({uri})"))
}
async fn client_by_name(&self, name: &str) -> Result<(ManagedClient, Option<Duration>)> {
pub(crate) async fn client_by_name(
&self,
name: &str,
) -> Result<(ManagedClient, Option<Duration>)> {
let view = self
.servers
.get(name)