A resource is read only, URI identified data that the host (not the model) pulls and injects into context. Tools are model invoked and may have side effects; resources inform without acting.
Think of the AI app as someone with a library card. The librarian (the MCP server) keeps a catalog of documents, each with a unique address like a call number. When the app decides the model needs to see a document, the app goes to the librarian and asks for it. The model never walks to the shelves itself; only the app does. And nothing the app does to a document changes it: there is no write back, no edit, no delete. Resources are how MCP lets a server share read only context with the model without giving the model the keys to modify anything. Files, database rows, web pages, log snippets: any blob of data that should be read but never changed through this channel can be a resource.
Concept explanation~2 min read
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Concept explanation~2 min read
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
A resource is the MCP primitive for read only data. It sits alongside tools (which act) and prompts (which the user invokes) in the three primitive model the protocol defines. Of the three, resources are the most often confused because they look superficially like tools but behave very differently in practice.
This deep dive walks through what a resource is, the URI based identification scheme, the JSON-RPC methods that operate on resources, the host pull invocation model, the subscription pattern, and how resources differ from tools in design intent. By the end you should be able to look at a real world capability and confidently decide whether it should be a tool or a resource.
The definition, unpacked
A resource is a piece of read only data the server exposes to the host, identified by a URI, that the host can pull and inject into the model's context.
Four load bearing pieces sit in that definition. Read only means resources have no write operation by protocol design. The server returns content; nothing in the resource API modifies the underlying data. Server exposed means resources are declared by the server and advertised through the standard JSON-RPC methods; clients discover them via resources/list. URI identified means each resource has a unique URI (a file path, a database reference, a web URL, a server specific scheme); the URI is how clients and servers refer to the data. Host pulled means the host (not the model) decides when to fetch a resource and what to do with the content.
The contrast with tools is sharp on every axis. Tools have flat names; resources have URIs. Tools are model invoked; resources are host pulled. Tools may have side effects; resources are strictly read only. The asymmetry is intentional: the two primitives exist because read only data and side effecting actions deserve different invocation patterns and different policy gates.
Situations where this technique stops working.
2–4 min · Everything important, quickly.
Real products, models, and research that use this idea.
- Filesystem server exposes files under configured roots as `file:///path` resources; the host can read any file the server is allowed to see and inject it into conversation context.
- Postgres and SQLite servers expose table contents as `postgres://` resources, often using URI templates for browsing schemas and tables without listing every row.
What an interviewer would ask next. Try answering before peeking at the approach.
QWhy are resources host pulled and not model invoked?
Two reasons. First, it keeps the model from accidentally exfiltrating data it should not have access to; the host applies policy before injecting any resource content. Second, it matches a common UX pattern where the host or user decides which context to include based on application logic, not based on the model guessing the user's intent.
Red flags & common mistakes
The phrases that signal junior thinking. Click to expand.
Red flags & common mistakes
The phrases that signal junior thinking. Click to expand.
Believing the model invokes resources directly. The host pulls resources and decides when to inject the content; the model only sees what the host chose to include.
60 second bullets to scan on the way to the call.
Define an MCP resource using the read only and host pulled framing
Name the identification scheme used for resources (URIs)
Primary sources. Browse if you want the original framing.
Same topic, related formats. Practice these next.