feat(resources): add resources/templates/list handler#130
Open
getlarge wants to merge 2 commits intoplatformatic:mainfrom
Open
feat(resources): add resources/templates/list handler#130getlarge wants to merge 2 commits intoplatformatic:mainfrom
getlarge wants to merge 2 commits intoplatformatic:mainfrom
Conversation
Parameterized resources (URIs with RFC 6570 {param} syntax) are now
served via resources/templates/list instead of resources/list, per the
MCP spec. Template detection happens at query time using a simple regex.
The ResourceTemplate response shape maps uri to uriTemplate.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Covers: - resources/list excludes template URIs - resources/templates/list shape (uri -> uriTemplate mapping) - empty list when no templates - resources/read still works for template resources - mixed concrete + template resources are split correctly across the two lists Also updates auth-compatibility test to use a concrete URI so it stays in resources/list after the template-filtering change. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Small note upfront: I'm riding the momentum from seeing activity picking back up on the repo to empty out my bag of goodies from running this plugin in production for the past ~4 months. Happy to slow-roll any of these if the review queue gets busy.
Adds support for the
resources/templates/listmethod from the MCP resources spec.Parameterized resources (URIs containing RFC 6570
{param}syntax) are now served viaresources/templates/listinstead ofresources/list, matching the spec. Template detection is a simple regex check at query time — no API changes for resource registration.Behavior
resources/listnow filters out entries whose URI contains{param}placeholdersresources/templates/listreturns the same entries withuriremapped touriTemplate, per theResourceTemplateshape in the MCP schemaresources/readcontinues to work for template resources (unchanged — matching happens via the existing base-URI +uriSchemaflow merged in feat(resources): Add resources/subscribe and resources/unsubscribe support #98)Test plan
npm run typecheckcleantest/resource-templates.test.ts— 5 new tests covering shape, filtering, empty list, read, mixed splittest/auth-compatibility.test.tsupdated to use a concrete URI so it stays inresources/listafter the filtering changeA follow-up PR will add
DELETE /mcpfor session termination (also spec-defined). They're independent and can land in either order.