On this page:
33.1 Subscription filter authorization

33 Discovery of notification support🔗ℹ

For each installed tool, prompt or resource category, discovery advertises listChanged: true. Resources also advertise subscribe: true. These flags describe the runtime’s installed subscription broker and publication path; a category with no declarations remains absent. Applications can publish list changes through publish-change! from mcp/subscription, using the runtime’s subscription hub. Resource dependency changes use the existing freshness path. The flags do not make external application mutations observable automatically.

The independent Go fixtures in dev/subscription-server.rkt and dev/interop/subscriptions.go exercise automatic listener creation on discovery, acknowledgement filters, tagged changes, server-requested closure, continued calls and fresh connections over stdio and HTTP. They supplement the scenario tests that directly assert the subscription completion result.

33.1 Subscription filter authorization🔗ℹ

Known list-change filter fields must be booleans; resourceSubscriptions must be an array of strings. Invalid known fields produce -32602 before registration, including fields for an unavailable category. Unsupported categories remain omitted from the accepted filter, and duplicate resource URIs are collapsed.

Before acknowledgement, each accepted list-change filter requires authorization for its corresponding list operation. Each accepted resource URI requires resources/read authorization, including scopes preserved by URI remapping and views. Tasks retain their operation and ownership checks. A denied target rejects the subscription with -32001; no acknowledgement or listener is installed. These checks resolve declaration policy without running resource readers.

Before each subsequent event, the runtime rechecks the target operation’s policy and principal expiry; task events also recheck ownership. Events denied by current policy are suppressed. Restoring permission permits later eligible events on the same listener; suppressed events are not replayed. This applies even when an application publishes directly through the runtime’s subscription hub. The generic standalone hub has no application authorization policy of its own.

Subscription scope preflight includes the union of scopes for the listen operation and its supported targets: configured list-operation scopes, resource-read scopes (including declaration/view requirements), and each stored task’s operation scopes. HTTP checks this union before starting SSE. A token lacking those scopes receives HTTP 403 with an insufficient_scope challenge, the required scope list and protected-resource metadata URL, without a subscription acknowledgement. Local and stdio dispatch use the same scope calculation. Authorization callbacks and task ownership are still checked separately; knowing the required scopes does not grant access to another principal’s task.