part…
Building governance for MCP?
The gateway applies what the guide teaches: policies on discovery, invocation and authorisation.
The gateway applies what the guide teaches: policies on discovery, invocation and authorisation.
Resources expose context data identified by URI: files, schemas, documents, records. They are application-driven: the host decides how to incorporate them (picker, search, automatic inclusion).
{ "capabilities": { "resources": { "listChanged": true, "subscribe": true } } }
listChanged: it will emit notifications/resources/list_changed.subscribe: it accepts resourceSubscriptions in subscriptions/listen and emits notifications/resources/updated.Both, one or neither may be declared ("resources": {}). Same invariants as tools: the set does not vary by connection, and may vary by authorisation.
resources/listPageable and cacheable. Returns Resource[].
resources/read{ "method": "resources/read", "params": { "uri": "file:///project/src/main.rs" } }
Result: contents[] (one or several; e.g. a directory may return several files), ttlMs, cacheScope. Supports input_required (MRTR). If the URI is https://, the client may fetch it directly from the web.
resources/templates/listRFC 6570 templates (file:///{path}), pageable and cacheable, with autocompletion via completion/complete.
subscriptions/listen with notifications.resourceSubscriptions: [uri, …]; the server sends notifications/resources/updated with uri and subscriptionId. (Legacy: resources/subscribe/unsubscribe.)
Resourceuri, name, title?, description?, mimeType?, size? (bytes), icons?, annotations?, _meta?.
{ "uri": "file:///example.txt", "mimeType": "text/plain", "text": "…" }
{ "uri": "file:///example.png", "mimeType": "image/png", "blob": "base64…" }
audience: ["user"], ["assistant"] or both.priority: 0.0–1.0 (1 = effectively required).lastModified: ISO 8601.Clients use them to filter, prioritise context and sort.
https://: only if the client can fetch the resource without the server; if the server downloads it itself, use another scheme.file://: file system or similar; XDG MIME types such as inode/directory for non-regular files.git://.-32602 (Invalid params), with data.uri recommended. Clients SHOULD also accept -32002 from older servers.-32603.contents: [] for a non-existent resource (ambiguous).Servers MUST validate all URIs and sanitise file:// paths against directory traversal; binary data MUST be encoded correctly; access control and permission checks SHOULD be applied to sensitive resources.
audience; redaction or blocking of sensitive content; size limits (size is a hint, not a guarantee).cacheScope: "private" on resources/read is the norm; never share that cache across authorisation contexts.resources/updated just like list_changed (lesson 5.3). Towards legacy servers, translate to resources/subscribe.-32002 into -32602 towards modern hosts.1. Which code does a modern server return when the resource does not exist?
-32602; and never an empty contents, which is ambiguous.
2. How does a modern client subscribe to changes on a specific resource?
resources/subscribe is legacy; in 2026-07-28 the listen filter is used.
3. When is the https:// scheme appropriate for a resource?
If the server is the one downloading the content, it must use another scheme.