modelcontextprotocol / modelcontextprotocol/csharp-sdk
McpServerPrimitiveCollection needs transactions/updates
Nessuno ha ancora preso questa issue.
- Lingua principale
- C#
- Stelle
- 4.5k
- Fork
- 814
- Merge medio
- 9g 19h
- PR unite (30g)
- 4
Descrizione
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
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia individuando McpServerPrimitiveCollection e McpServerOptions, quindi traccia il modo in cui Clear e i singoli aggiornamenti della collection emettono notifiche prompt-list-changed. Il lavoro è completato quando è disponibile un’operazione di sostituzione della collection per gli aggiornamenti basati sul database e la sostituzione produce una sola notifica.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- csharp
- Ambito
- backend-api-design
- Tipo di issue
- Funzionalità
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 48/100