Resources expose data to MCP clients. Unlike tools (which perform actions), resources provide read-only access to content like files, database records, or live data.Documentation Index
Fetch the complete documentation index at: https://docs.mcp-use.com/llms.txt
Use this file to discover all available pages before exploring further.
Example
Anatomy of a Resource
When a client callsresources/list, the server returns metadata for each resource. Resources with URI templates (like {section}) are returned via resources/templates/list instead.
Here’s the JSON-RPC response that the example above produces when a client calls resources/templates/list:
| Python | MCP Schema | Notes |
|---|---|---|
uri="config://{section}" | "uriTemplate" | {section} makes it a template; without it, it would be a static "uri" |
name="app_config" | "name" | Falls back to function name if omitted |
title="Application Config" | "title" | Human-readable display name |
description="Get configuration..." | "description" | Falls back to docstring if omitted |
mime_type="application/json" | "mimeType" | Tells clients how to interpret the content |
section: str | (extracted from URI) | Parameter matched from the URI template |
Static Resources
Resources without URI parameters are static — they always return at the same URI:Resource Templates
Use{param} placeholders in the URI to create dynamic resources:
user://123 and the function receives user_id="123".
Multiple Parameters
Templates support multiple parameters:Async Resources
Resources can be async for I/O operations:Binary Resources
Return bytes for binary content:Resource Subscriptions
Clients can subscribe to resources and receive notifications when they change. This follows the MCP resource subscriptions spec.How It Works
- Client sends
resources/subscribewith a resource URI - Your server updates the resource and calls
notify_resource_updated() - All subscribed clients receive a
notifications/resources/updatednotification - Clients re-read the resource to get the new content
notify_resource_updated() when your resource changes.
Example
data://price and then any client calls update_price, all subscribers receive the notification and can re-read the resource.
Subscriptions are session-scoped — they’re automatically cleaned up when a client disconnects. If the server restarts, clients need to re-subscribe.
Common MIME Types
| MIME Type | Use Case |
|---|---|
text/plain | Plain text content |
application/json | JSON data |
text/markdown | Markdown documents |
text/html | HTML content |
image/png | PNG images |
Resources vs Tools
| Aspect | Resources | Tools |
|---|---|---|
| Purpose | Expose data | Perform actions |
| Side effects | None (read-only) | May modify state |
| Caching | Can be cached | Generally not cached |
| Use case | Configuration, files, status | Operations, calculations |