go-sdk/mcp/testdata/public
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Jonathan Amsterdam c1524fe934 internal/mcp: implement resource templates
Provide support for resource templates on the client and server.

Adding, removing and listing resource templates looks just like those
operations on resources.

Although the spec provides no guidance on the unique ID for resource
templates, we follow most existing SDKs, as well as the parallel with
resources, and index on the URI template rather than the name.

As the spec recommends, the server verifies an incoming URI in a
ReadResource request against its list of resources and resource
templates, to make sure the URI came from one of them. The main
technical challenge here is the need to check that a URI template could
have produced a particular URI.

I wrote a very simplified version of this check. At some point
we should switch to github.com/yosida95/uritemplate/v3.

Change-Id: I1e34dd01c8f2171123c68c045ad62f5e85c05e7c
Reviewed-on: https://go-review.googlesource.com/c/tools/+/680158
Auto-Submit: Jonathan Amsterdam <jba@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Robert Findley <rfindley@google.com>
2025-06-09 10:59:01 -07:00
..
dir internal/mcp: implement resource templates 2025-06-09 10:59:01 -07:00
file1.txt internal/mcp: implement resource templates 2025-06-09 10:59:01 -07:00
file2.txt internal/mcp: implement resource templates 2025-06-09 10:59:01 -07:00