3.0.0
Some MCP clients only support tools. They cannot list or read resources directly because they lack resource protocol support. The ResourcesAsTools transform bridges this gap by generating tools that provide access to your server’s resources.
When you add ResourcesAsTools to a server, it creates two tools that clients can call instead of using the resource protocol:
list_resourcesreturns JSON describing all available resources and templatesread_resourcereads a specific resource by URI
Basic Usage
Pass your server toResourcesAsTools when adding the transform. The transform queries that server for resources whenever the generated tools are called.
list_resources and read_resource.
Static Resources vs Templates
Resources come in two forms, and thelist_resources tool distinguishes between them in its JSON output.
Static resources have fixed URIs. They represent concrete data that exists at a known location. In the listing output, static resources include a uri field containing the exact URI to request.
Resource templates have parameterized URIs with placeholders like {user_id}. They represent patterns for accessing dynamic data. In the listing output, templates include a uri_template field showing the pattern with its placeholders.
When a client calls list_resources, it receives JSON like this:
uri for static resources, uri_template for templates.
Reading Resources
Theread_resource tool accepts a single uri argument. For static resources, pass the exact URI. For templates, fill in the placeholders with actual values.
user://42/profile, it matches against the user://{user_id}/profile template, extracts user_id=42, and calls your resource function with that parameter.
Binary Content
Resources that return binary data (like images or files) are automatically base64-encoded when read through theread_resource tool. This ensures binary content can be transmitted as a string in the tool response.

