McpServerPrimitiveCollection needs transactions/updates

オープン
#433 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
48/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
csharp

調査の方向性

まず McpServerPrimitiveCollection と McpServerOptions の場所を特定し、次に Clear とコレクションの個別更新が prompt-list-changed 通知をどのように発行するかを追跡します。データベースに基づく更新でコレクションの置換操作を利用でき、その置換によって通知が 1 件だけ生成されれば完了です。

索引モデルが issue の本文から書いたものです。

説明

enhancement needs confirmation

Is your feature request related to a problem? Please describe.
I have 1.2 preview.1 and configured client and server to communicate prompt list changed notifications.

   // A saved copy of the prompts specified in McpServerOptions custom config.
   public static McpServerPrimitiveCollection<McpServerPrompt> Prompts { get; set; }

By adding a prompt here it sends a prompt changed notification to client just fine.
If you are reading from a database though, Clear will send one followed by one for each entry in the database.
That is a lot of network traffic while the prompt list is updated.

It doesn't seem the changed notification has added/removed for individual items so the full list would need to be asked for each change notification.

Describe the solution you'd like
There should be a Reset or Replace or Set option that takes a collection (i.e. IReadOnlyList<McpServerPrompt>) so only one changed notification is sent to client.

Describe alternatives you've considered
I don't see an alternative because once the McpServerOptions have been configured at startup you can't replace the prompt collection.

Additional context
n/a

主要言語
C#
スター
4.5k
フォーク
814
平均マージ
9日 19時間
マージ済み PR(30日)
4

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

modelcontextprotocol/csharp-sdk のほかの issue

modelcontextprotocol/csharp-sdk の issue をすべて見る

似ている issue

C# の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。