Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Support using WithStreamServerTransport for multiple in-process mcp servers

Đang mở
#1,172 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ó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
csharp
Lĩnh vực
backend

Hướng nghiên cứu

Bắt đầu từ đăng ký builder.Services.AddSingleton(new StreamServerTransport(inputStream, outputStream)) và kiểm tra cách StreamServerTransport được kết nối với một MCP Server trong cùng tiến trình. Theo dõi các giả định về kênh và vòng đời dịch vụ, sau đó xác minh rằng có thể khai báo nhiều lớp MCP Server trong cùng tiến trình với các kênh riêng biệt.

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

Mô tả

enhancement needs confirmation P3

The current implementation register the stream support as a singleton:

builder.Services.AddSingleton<ITransport>(new StreamServerTransport(inputStream, outputStream));

This prevents declaring multiple MCP Server classes in-process and using them with a separate channels.

Reasons for this choice:

  • creating MCP servers in a separate class library so that they can be instantiated in-process or out-of-process depending on the app
  • ability to clearly separate the tools, prompts and resources. Currently I have to mix all the in-process prompts, resources and tools in a single MCP server to be used in-process.
  • avoid creating a separate process just because of the library limitation (performance reasons)

As I mentioned in a discussion, the Model Context Protocol adhere to the "transparency" principle, but the library makes it very difficult to reach. This is the reason why I tagged this as a bug.

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.