Choose static resources or templates
Use a static resource for one known URI. Use a resource template when the URI contains a variable segment.
Resources are best for readable content. If the model should decide to perform work, use a tool instead.
Register a static resource
Register a static resource when the URI is fixed and the callback can return the current content for that URI.inventory://, docs://, or app://. Keep the URI meaningful enough that a client can display it without extra context.
Register a resource template
Register a resource template when clients should read many related resources through one URI pattern.Add autocomplete for template parameters
Use completion callbacks when a client can help users choose valid URI values.Return content with helpers
Use response helpers to return resource content. They set the MCP-compatible content shape and MIME metadata for common cases.Notify clients when resources change
When a resource changes after clients have listed or subscribed to resources, notify clients so they can refresh.sendResourcesListChanged() when the set of available resources changes. Use notifyResourceUpdated(uri) when content at an existing URI changes and subscribers should read it again.
See Resource Subscriptions and Notifications for update workflows.
Test resources locally
Run the development server and inspect resources in the Inspector.http://localhost:3000/inspector, select the Resources tab, read each resource, and test both successful reads and not-found cases.
Next steps
Resources API reference
Look up resource definitions, callback signatures, template types, and annotations.
Response Helpers
Choose helpers for text, JSON, Markdown, media, and mixed content.
Resource Subscriptions
Notify subscribed clients when resource content changes.
Tools
Use tools for actions, lookups, mutations, and workflows.