Add add_resource_template() to MCPServer
Author: okapiesCreated Aug 19, 2026Updated Sep 16, 2026
Labelsv2
Description
MCPServer and ResourceManager have add_resource() method for static Resources, but there is no way to handle ResourceTemplate without using @resource decorator.
I am implementing the following workaround using the decorator for my usecase, but it is a bit odd.
server = MCPServer("...")
# Configure resources (implemented in other files)
server.resource("resource://users")(resources.list_users)
server.resource("resource://users/{id}")(resources.get_user)References
It was implemented in #3208.
Source: modelcontextprotocol/python-sdk