Skip to content

MCP: let the application turn resource subscriptions off #1751

Done

Description

@jlouvel

Follow-up to #1700. Found while moving an MCP server onto org.restlet.ext.mcp (naftiko/ikanos#838).

As soon as an McpServerAdapter has a resource or a resource template, server/discover advertises capabilities.resources.subscribe: true. The application can't turn it off: McpModernFeatures.Resources.supportsSubscribe() returns true unconditionally, and the SDK's ResourcesFeature passes it on to the capabilities.

A server that serves resources but never broadcasts resource updates then makes a false promise. A client that reads the capability subscribes to a resource and waits for notifications/resources/updated that never come, instead of polling or re-reading.

The other subscription fields are already under the application's control: getSubscriptions() declares the application's own fields, and setSubscriptionRestriction narrows what a client may subscribe to. Only this capability flag is fixed.

Delivery:

  1. Let the application say whether resource subscriptions are served, for example a setter on McpServerAdapter (default true, so nothing changes for existing applications), read by Resources.supportsSubscribe().
  2. When it is off, server/discover advertises resources without subscribe, and a subscriptions/listen that asks for resource updates is answered as for any field the server doesn't honour.
  3. Check what the legacy 2025-11-25 edge advertises in initialize and answers to resources/subscribe, so both eras agree.
  4. Document the setting next to getChanges() in the McpServerAdapter javadoc.

Activity

  1. added a commit that references this issue on Nov 30, 2026
    27ff24c
  2. self-assigned this
    on Dec 1, 2026
  3. jlouvel commented on Dec 1, 2026

    @jlouvel
    CollaboratorAuthor

    Fixed by #1775, merged into 3.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions