fastmcp.client.mixins.resources
Resource-related methods for FastMCP Client.
Classes
ClientResourcesMixin
Mixin providing resource-related methods for Client.
Methods:
list_resources_mcp
cursor: Optional pagination cursor from a previous request’s nextCursor.
- mcp.types.ListResourcesResult: The complete response object from the protocol, containing the list of resources and any additional metadata.
RuntimeError: If called while the client is not connected.McpError: If the request results in a TimeoutError | JSONRPCError
list_resources
- list[mcp.types.Resource]: A list of all Resource objects.
RuntimeError: If called while the client is not connected.McpError: If the request results in a TimeoutError | JSONRPCError
list_resource_templates_mcp
cursor: Optional pagination cursor from a previous request’s nextCursor.
- mcp.types.ListResourceTemplatesResult: The complete response object from the protocol, containing the list of resource templates and any additional metadata.
RuntimeError: If called while the client is not connected.McpError: If the request results in a TimeoutError | JSONRPCError
list_resource_templates
- list[mcp.types.ResourceTemplate]: A list of all ResourceTemplate objects.
RuntimeError: If called while the client is not connected.McpError: If the request results in a TimeoutError | JSONRPCError
read_resource_mcp
uri: The URI of the resource to read. Can be a string or an AnyUrl object.meta: Request metadata (e.g., for SEP-1686 tasks). Defaults to None.
- mcp.types.ReadResourceResult: The complete response object from the protocol, containing the resource contents and any additional metadata.
RuntimeError: If called while the client is not connected.McpError: If the request results in a TimeoutError | JSONRPCError
read_resource
read_resource
read_resource
uri: The URI of the resource to read. Can be a string or an AnyUrl object.version: Specific version to read. If None, reads highest version.meta: Optional request-level metadata.task: If True, execute as background task (SEP-1686). Defaults to False.task_id: Optional client-provided task ID (auto-generated if not provided).ttl: Time to keep results available in milliseconds (default 60s).
- list[mcp.types.TextResourceContents | mcp.types.BlobResourceContents] | ResourceTask: A list of content objects if task=False, or a ResourceTask object if task=True.
RuntimeError: If called while the client is not connected.McpError: If the request results in a TimeoutError | JSONRPCError

