Skip to content

feat(resources): add resources/templates/list handler#130

Open
getlarge wants to merge 2 commits intoplatformatic:mainfrom
getlarge:feat/resource-templates-list
Open

feat(resources): add resources/templates/list handler#130
getlarge wants to merge 2 commits intoplatformatic:mainfrom
getlarge:feat/resource-templates-list

Conversation

@getlarge
Copy link
Copy Markdown
Contributor

@getlarge getlarge commented Apr 8, 2026

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/list method from the MCP resources spec.

Parameterized resources (URIs containing RFC 6570 {param} syntax) are now served via resources/templates/list instead of resources/list, matching the spec. Template detection is a simple regex check at query time — no API changes for resource registration.

Behavior

  • resources/list now filters out entries whose URI contains {param} placeholders
  • resources/templates/list returns the same entries with uri remapped to uriTemplate, per the ResourceTemplate shape in the MCP schema
  • resources/read continues to work for template resources (unchanged — matching happens via the existing base-URI + uriSchema flow merged in feat(resources): Add resources/subscribe and resources/unsubscribe support #98)

Test plan

  • npm run typecheck clean
  • test/resource-templates.test.ts — 5 new tests covering shape, filtering, empty list, read, mixed split
  • test/auth-compatibility.test.ts updated to use a concrete URI so it stays in resources/list after the filtering change
  • CI green

A follow-up PR will add DELETE /mcp for session termination (also spec-defined). They're independent and can land in either order.

getlarge and others added 2 commits April 8, 2026 21:39
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant