McpServerPrimitiveCollection needs transactions/updates

Đang mở
#433 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
48/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
csharp
Lĩnh vực
backend-api-design

Hướng nghiên cứu

Bắt đầu bằng cách xác định McpServerPrimitiveCollection và McpServerOptions, sau đó theo dõi cách Clear và các cập nhật riêng lẻ của collection phát ra các thông báo prompt-list-changed. Hoàn thành có nghĩa là có sẵn một thao tác thay thế collection cho các cập nhật được hỗ trợ bởi cơ sở dữ liệu và thao tác thay thế chỉ tạo ra một thông báo.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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

Ngôn ngữ chính
C#
Star
4.5k
Fork
814
Merge trung bình
9 ngày 19 giờ
Pull request đã merge (30 ngày)
4

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của modelcontextprotocol/csharp-sdk

Tất cả issue của modelcontextprotocol/csharp-sdk

Issue tương tự

Thêm issue về C#

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.