Skip to content

McpServerPrimitiveCollection needs transactions/updates #433

@nschuessler

Description

@nschuessler

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions