Resources
Resources in MCP provide structured access to information that AI models need to understand context. They represent data sources that can be retrieved and used by AI applications, such as files, database records, API responses, or any other structured information.What are Resources?
Resources are context data sources with:- URI-based identification for consistent addressing
- Structured access patterns with defined schemas
- Multiple content types (text, JSON, binary data)
- Dynamic or static content that can change over time
- Configuration files and documents
- Database records and query results
- API responses and external data
- Calendar events and schedules
- User preferences and settings
Types of Resources
Direct Resources
Static resources with fixed URIs that always return the same type of content.Resource Templates
Dynamic resources that accept parameters to generate different content based on input.Listing Available Resources
To see what resources are available from a connected MCP server:Automatic Resource List Update
When servers sendResourceListChangedNotification
, it signals that the resource list has changed. The list_resources()
method always fetches fresh data from the server, ensuring you get up-to-date information.
Important: Always use await session.list_resources()
instead of the deprecated session.resources
property to ensure you get fresh data:
Reading Resources
Resources are accessed using theread_resource
method with their URI: