Skip to main content
Resource subscriptions let clients opt in to updates for specific resource URIs. Use them when a client should refresh a known resource after the server changes its content. This guide focuses on the server workflow. Use the MCPServer API reference for the exact notifyResourceUpdated() signature and related session behavior.

Use subscriptions for resource-specific updates

Subscriptions are for resource content changes, not general status events. Clients subscribe to a resource URI. Your server notifies subscribers after that resource changes. Clients then read the resource again.

Define the resource

Start with a resource that returns the current content for a stable URI.
Use a stable URI. Subscribers are attached to the URI, so changing the URI changes what clients must subscribe to.

Notify subscribers after updates

When server state changes, call server.notifyResourceUpdated(uri).
The notification tells subscribed clients that the content changed. It does not include the new resource body. Clients should call resources/read for the URI again.

Notify list changes separately

Use sendResourcesListChanged() only when the available resource set changes.
If only the content at an existing URI changed, use notifyResourceUpdated(uri) instead.

Design for stateful sessions

Resource subscriptions depend on connected sessions. They are not a durable queue. Use subscriptions when:
  • Clients are connected through stateful MCP sessions.
  • Missing an update is acceptable because the client can read the resource again.
  • The resource URI is stable.
Do not use subscriptions as the only persistence mechanism for background jobs, audit trails, or critical delivery.

Test resource updates locally

Use a stateful MCP client that can send resources/subscribe.
In another terminal, subscribe to the settings://app resource URI and keep the connection open. In a third terminal, call the update_settings tool with theme=dark. Verify these cases:
  • The resource can be read before any updates.
  • The update tool calls notifyResourceUpdated() after changing state.
  • The client receives the update notification and can read the new content.

Next steps

Resources

Create static resources and resource templates.

Notifications

Send custom status, progress, and list-changed notifications.

MCPServer API reference

Look up notifyResourceUpdated() and resource notification methods.

MCP resources specification

Read the protocol-level subscription behavior.