You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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)
I'd like to work on this. The change looks narrowly scoped: add the missing programmatic registration path for pre-built ResourceTemplate instances, symmetric with add_resource(), and cover listing/reading with focused tests. I also found the earlier #3208 implementation and its review history, so I can preserve the intended API shape while strengthening the assertions. Per this repository's contribution workflow, could a maintainer assign #3333 to me (@xixi-box) if you'd like me to proceed with the PR?
Activity
xixi-box commentedon Sep 16, 2026
I'd like to work on this. The change looks narrowly scoped: add the missing programmatic registration path for pre-built
ResourceTemplateinstances, symmetric withadd_resource(), and cover listing/reading with focused tests. I also found the earlier #3208 implementation and its review history, so I can preserve the intended API shape while strengthening the assertions. Per this repository's contribution workflow, could a maintainer assign #3333 to me (@xixi-box) if you'd like me to proceed with the PR?