modelcontextprotocol / modelcontextprotocol/csharp-sdk

McpServerPrimitiveCollection needs transactions/updates

Offen
#433 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

enhancement needs confirmation
Vorherrschende Sprache
C#
Sterne
4.5k
Forks
814
Ø Merge
9 T. 19 Std.
Gemergte PRs (30 T.)
4

Beschreibung

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

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne damit, McpServerPrimitiveCollection und McpServerOptions zu finden, und verfolge anschließend, wie Clear und einzelne Aktualisierungen der Collection prompt-list-changed-Benachrichtigungen auslösen. Als erledigt gilt die Aufgabe, wenn eine Collection-Ersetzungsoperation für datenbankgestützte Aktualisierungen verfügbar ist und für die Ersetzung nur eine Benachrichtigung erzeugt.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
csharp
Bereich
backend-api-design
Issue-Typ
Feature
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
48/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.