AI Hints
Home›MCP Tutorial›More Resources
MCP · Lesson 37 of 120

Resource Updates

Changed notifications.

⏱ 2 min read▶ Video at 33:34🎓 Free
Watch this lesson in the MCP courseWatch on YouTube ↗Full MCP course

Resources change. A price list is updated, or a new help page appears. MCP servers can notify clients, so they fetch the new version instead of using an old copy.

Resource Updates
From the video: Resource Updates
  • Resources change
  • Notify clients
  • Fetch the new version

Keeping clients fresh

The client subscribes to a resource it cares about. The data changes on the server. The server sends a resource updated notice. The client reads the resource again. And for added or removed resources, a list changed notice says to list them again.

  1. Subscribe
  2. Data changes
  3. Updated notice
  4. Read again
  5. List changed
Keeping clients fresh
From the video: Keeping clients fresh

In the SDK

Servers advertise that they support subscriptions. Inside a tool, the context can send notify resource updated, or notify resources changed. Clients can also rely on cache hints, which we'll meet later.

keyvalue
Capabilitysubscribe
One resourcenotify_resource_updated
The listnotify_resources_changed
Clientsubscribe_resource

Summary

Servers can tell clients when a resource or the resource list changes. Next, binary resources.

Key takeaways
  • Subscribe
  • Updated
  • List changed
Next up: Binary Resources — images and PDFs