Expose the middleware chain on MCPServer and stop sending unrequested change notifications (#3201)
This commit is contained in:
parent
528e366558
commit
c9c431b71a
1 changed files with 234 additions and 28 deletions
|
|
@ -21,6 +21,7 @@ from mcp_types import (
|
|||
)
|
||||
|
||||
__all__ = [
|
||||
"LISTEN_STREAM_METHODS",
|
||||
"SUBSCRIPTION_ID_META_KEY",
|
||||
"PromptsListChanged",
|
||||
"ResourceUpdated",
|
||||
|
|
@ -79,6 +80,10 @@ _LIST_CHANGED_EVENTS: dict[str, ServerEvent] = {
|
|||
"notifications/resources/list_changed": ResourcesListChanged(),
|
||||
}
|
||||
|
||||
LISTEN_STREAM_METHODS: frozenset[str] = frozenset({*_LIST_CHANGED_EVENTS, "notifications/resources/updated"})
|
||||
"""The notification methods that ride `subscriptions/listen` streams at 2026-07-28
|
||||
(and, at that era, nowhere else): the change-notification vocabulary."""
|
||||
|
||||
|
||||
def event_from_wire(method: str, params: Mapping[str, Any] | None) -> ServerEvent | None:
|
||||
"""The event a raw listen-stream frame announces, or None if it carries none.
|
||||
|
|
|
|||
Loading…
Reference in a new issue