Exposing Resources: Read-Only Data via Stable URIs
~10 min read
Resources expose read-only content — files or generated text — through a stable URI that clients can fetch at any time during a session, distinct from Tools' action-triggering role.
Exposing Resources: Read-Only Data via Stable URIs is a Pro topic
Sign in, then upgrade to Pro or Power to unlock this topic and the full AI Engineering curriculum.
Key points
- •Resources expose read-only content (files, generated text) through a stable URI, unlike Tools which trigger actions with potential side effects
- •Clients can fetch a resource's content at any time during a session via its stable URI
- •This maps to the general Resources primitive covered elsewhere (app-controlled, passive read-only data) — this subtopic covers how it's declared specifically in mcp-use
- •In mcp-use, resource registration mirrors the declarative shape of tool registration: a URI pattern mapped to a callback
- •Reach for a Resource when the agent needs to read something; reach for a Tool when the agent needs to do something