What is Resource (MCP)?
Also called MCP Resource.
A resource in the Model Context Protocol is a piece of readable context that a server exposes to a client, identified by a URI and returned on request. Resources are one of the protocol's primitives alongside tools and prompts. Unlike a tool, reading a resource is intended to supply information rather than to perform an action with side effects.
Each resource carries a URI, and typically a name, description, and media type, so the client knows what it is before reading it. Clients discover what is available by listing resources, then request the contents of a specific one. Servers may also expose templated URIs, letting a client construct an address for a family of items rather than enumerating every one.
The distinction from tools is about intent and control. A tool call is an action a model may decide to invoke, potentially with consequences. A resource read is a retrieval, which makes it natural for the application or the user to choose what gets included in context, rather than leaving that selection entirely to the model.
Contents are returned as text or binary data with a declared media type, which lets the client decide how to render or embed them. Servers may support subscriptions so a client is notified when a resource changes, and may notify the client when the overall list of resources changes, though these are optional capabilities rather than requirements.
The security question is what the URI can reach. A server exposing files, database rows, or internal endpoints as resources decides the boundary of what any connected client can read, so path handling and access checks belong on the server side. Resource contents are untrusted input to whatever consumes them, and should never be treated as instructions.
Key points
- Readable context identified by a URI
- One of the protocol primitives beside tools and prompts
- Retrieval, not an action with side effects
- Optional subscriptions signal content or list changes
- Contents are untrusted data, never instructions
In practice
A documentation server exposes each published page as a resource with a URI, a title, and a plain text media type. The client lists what is available and shows the user a picker. The user selects two pages, the client reads those URIs, and their contents are attached to the conversation as reference material. Nothing was executed, and the model did not choose what to include.