Register a static resource
A static callback receives the requestedURL and request context:
{ contents: [...] } resource envelope. Each entry identifies
its own URI and contains either text or a base64 blob with an appropriate MIME
type.
Register a resource template
A template callback receives(uri, params, ctx). Inferred template values
are string | string[] because RFC 6570 expressions can expand one or many
values.
complete map.
Use a string array for fixed suggestions or a callback for live lookup.
Return several content entries
One resource read may return several entries:Notify listeners
Publish a list invalidation when the available resources or templates change:Test resources
Runmcp-use dev, then use the built-in inspector to list resources, read
static and templated URIs, exercise autocomplete, and verify successful and
not-found results.