Skip to content

Resources: subscriptions/listen model on modern servers (era fork) #1630

Closed

Description

@cliffhall

Stack: SDK V2 + New Spec — 7 of 10 (tab era-fork; needs era model from card 3).

Fork Resource subscriptions by era. On modern servers resources/subscribe/unsubscribe and the session-scoped subscription model are replaced by entries in a single long-lived subscriptions/listen stream.

Scope

  • Legacy era: keep resources/subscribe/unsubscribe and the current ResourceSubscriptionsState (button already gated on resources.subscribe — see Hide Subscribe/Unsubscribe button and Subscriptions section when server doesn't support resource subscriptions #1478 precedent).
  • Modern era: model subscriptions as a filter over one subscriptions/listen stream — { toolsListChanged, promptsListChanged, resourcesListChanged, resourceSubscriptions: [uris] }. The state store becomes "one listen stream + filter set + acknowledged state + reconnect-by-re-listen" (no resumability; a broken stream re-lists). Notifications arrive tagged _meta["io.modelcontextprotocol/subscriptionId"].
  • Reflect that request-scoped notifications never appear on the listen stream (they ride the originating request).

Key files

core/mcp/state/resourceSubscriptionsState.ts, core/react/useResourceSubscriptions.ts, clients/web/src/components/screens/ResourcesScreen/*, core/mcp/inspectorClient.ts (client.listen(filter) / McpSubscription).

Acceptance

  • Legacy subscribe/unsubscribe unchanged.
  • Modern subscriptions modeled as a listen filter; acknowledged + reconnect-by-re-listen handled.
  • npm run ci green.

Ref: specification/v2_new_spec_impact.md §7.4, §8.2(notifications), §9.3(Resources), §9.5(5).

Activity

  1. self-assigned this
    on Jul 9, 2026
  2. cliffhall commented on Jul 20, 2026

    @cliffhall
    MemberAuthor

    Merged via #1730 (squash 320daf2 into v2/main).

  3. added this to the v2.0.0 milestone on Jul 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

v2Issues and PRs for v2

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions