How resources work
A typical resource flow is:- The client discovers resources with
resources/list. - The host or user selects relevant context.
- The client requests the content with
resources/read. - The server returns text or binary content and its metadata.
resources capability during initialization when they support this feature.
Resource URIs
Each resource has a URI that identifies it.urinametitledescriptionmimeTypesize- Icons and other metadata supported by the protocol version
Direct resources and resource templates
MCP supports two discovery patterns.Direct resources
A direct resource has a concrete URI. It can appear in aresources/list response.
Resource templates
A resource template describes a family of parameterized URIs.Resource content types
A read response can contain one or more resource contents.- Text content uses UTF-8 text and may represent Markdown, source code, JSON, logs, or other readable data.
- Binary content uses base64-encoded data and an appropriate MIME type.
Updates and subscriptions
A server can declare optional resource features:listChangedindicates that the server may notify the client when the available resource list changes.subscribeindicates that clients can subscribe to updates for individual resources.
Resources vs tools
Both resources and tools can help a model access information, but they express different intent.
Use a resource for addressable context that a client may browse, cache, or attach. Use a tool for search, computation, or an operation with arguments.
Examples of MCP resources
Design resources clearly
- Use stable and descriptive URIs.
- Include a useful name, title, description, and MIME type.
- Use templates for large or dynamic collections.
- Paginate large resource lists.
- Keep returned content focused enough for an AI context window.
- Define update and caching behavior.
- Return clear errors for unknown or unauthorized URIs.