modelcontextprotocol / modelcontextprotocol/java-sdk
Resource templates should support handlers
まだ誰も着手していません。
- 主要言語
- Java
- スター
- 3.7k
- フォーク
- 1.1k
- 平均マージ
- 1日 15時間
- マージ済み PR(30日)
- 9
説明
Expected Behavior
There should be a ResourceTemplateSpecification, similar to (A)syncResourceSpecification, so that we can have access to an exchange and handle requests properly.
Current Behavior
Currently unlike resources or prompts, there's no way to define a handler for resource templates. The same spec is used in all contexts, but doesn't allow supplying a handler.
Context
This is a serious limitation which defeats the concept of resource templates. For example, we would like to implement something like this in Micronaut MCP:
@ResourceTemplate(uriTemplate = "file://my-resource/{item}", description="A templated resource")
String templated(String item) {
return "Hello, " + item;
}
That is, the content of the template depends on the URI parameters. Today there's no way to do this because the only thing we can do is register resource templates, but no handlers. Therefore, in order to serve the resources, we have to register all of them as regular resources, which makes the templating redundant. This also assumes that we can know in advance all the combinations of valid path elements values, which is obviously not possible.
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず、既存の (A)syncResourceSpecification と、リソースおよび prompts に使用されている登録経路を特定します。resource-template のリクエストがどのように処理されるかを追跡し、そのうえで、ハンドラーに対応できる仕様が URI パラメータについて何を公開する必要があるかを定義します。テンプレート化されたリソースがリクエストパラメータを解決してコンテンツを提供でき、すべての URI を事前登録する必要がなくなれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- java
- 領域
- api, backend-api-design
- issue の種類
- 機能追加
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 42/100