Skip to main content
MCP has three server primitives. Tools are the ones the model calls; resources and prompts round out the set. A resource is addressable content a host can read by URI: reference docs, a data file, a live-generated report. Where a tool is an action, a resource is a document.
server.ts
registerResource returns the server, so it chains next to your tool registrations. The handler runs when the host reads the URI and returns the content: text for text, blob (base64) for binary.
Register resources up front, at startup. Adding or removing them at runtime relies on list_changed notifications, which the stateless JSON transport can’t deliver, so hosts won’t see the change.

Static vs. dynamic

A static resource lives at one fixed uri. A dynamic resource uses a template, an RFC 6570 URI template, to cover a family of URIs that share a shape:
server.ts
The template’s handler receives the resolved variables as its second argument.
The ui://views/ namespace is reserved for the view resources Skybridge registers for you. Registering a resource under it throws.

Completions

A dynamic resource can help the host discover and complete its URIs. The ResourceTemplate constructor takes two callbacks:
server.ts
list is required: pass undefined to opt out, so a template is never accidentally unlistable. complete is optional, one callback per template variable, returning the candidate values for what the user has typed so far.

Register Prompts

The third primitive: reusable prompts users can invoke.

Go Further

registerResource

Full config and handler reference

Register Prompts

Ship reusable prompts

Register Tools

The action primitive