Back to catalog / MCP resources
Expose versioned read-only documents through MCP resource URIs
Expose documents as stable URI resources so clients can discover and read them without write access.
Goal
Let an agent read traceable read-only documents by explicit resource URI.
Steps
- Select documents appropriate for clients and define versioning and access scope. [mcp-resources]
- Register a reader with
@mcp.resource("docs://{doc_id}"); the URI placeholder must match the function parameter name. [mcp-resources] - Declare the correct
mime_typefor text, JSON, or binary output; resource code runs onresources/read, not on listing. [mcp-resources] - Preserve reviewable provenance with versioned URIs or explicit version metadata when documents change. [mcp-resources]
- List and read resources with a client; verify the expected version and that source files remain unchanged. [mcp-resources]
How to verify
The client should discover and read a specific version and receive a safe error for missing or unauthorized resources.
Troubleshooting
If a resource cannot be read, check URI normalization, MIME type, and authorization on both list and read handlers.
Permissions
Prerequisites
- Python 3.10+ and the MCP Python SDK compatible with the pinned revision
Permissions
- Use a local or isolated test environment; use least privilege and approval for external data or side effects
Limitations
SDK behavior varies by version. Check the pinned revision against your agent or client, then review data retention, authorization, and side effects before production use.
Pinned upstream source
- Repository
- modelcontextprotocol/python-sdk
- File path
- docs/servers/resources.md
- Pinned commit
754254c08fe1c3eda18b69da3d336106fe8d72d6- Source checked
- 2026-10-14 · Reviewed against the pinned upstream source
Repository metrics
These values describe the upstream repository, not popularity or likes for an individual skill or playbook.
- Stars
- Not collected
- Forks
- Not collected
- Observed at
- Not collected
No metrics snapshot is available yet.
License: MIT