Skip to content

Implement Support for Resource Templates #502

Closed

Description

@KuechA

Target: server
Component: sdk-server
Scenarios: resources-templates-read
Specification: https://modelcontextprotocol.io/specification/2025-11-25/server/resources#resource-templates

Is your feature request related to a problem? Please describe.

The MCP specification discusses the possibility of using resource templates. In my understanding, these would be useful to access/traverse resources. In my case, I'd love to use this to make a graph representation of https://github.com/Fraunhofer-AISEC/cpg available to an agent. However, these are currently not supported by the kotlin-sdk, so I was wondering how to support them.

Describe the solution you'd like
I would like to have resource templates implemented in the kotlin-sdk for MCP.

Describe alternatives you've considered
Alternatives are:

  • Using tools instead of resources/resource templates
  • Using resources and them parsing arguments in the code itself (see the suggestion here)

Additional context
I tried to start with a prototypical implementation in #503 and would love to discuss alternative solutions, ideas on the design and implementation of this system and suggestions thereof.

Current state

The SDK's Server / FeatureRegistry does not implement addResourceTemplate() with URI pattern matching. Resources are looked up by exact URI, so a request for test://template/123/data does not match the registered template test://template/{id}/data.

Activity

  1. added this to the 0.10 milestone on Feb 17, 2026
  2. KuechA commented on Feb 19, 2026

    @KuechA
    Author

    Hi @devcrocod and @kpavlov ,

    thanks for scheduling the issue for milestone and enabling an initial run of the tests in the CI pipeline. I'm wondering how I can proceed with the PR (besides that I have to test it with some client supporting resource templates). Could you please have an initial look at the implementation, so that I know how I can continue with the development, and if it fits your overall idea for the design?

  3. self-assigned this
    on Mar 13, 2026
  4. added a commit that references this issue on Mar 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions