SseClientTransportOptions.Endpoint needs a way for a consumer to control if the corresponding Resource ends with a trailing slash or not
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
- 35/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
- authentication
Hướng nghiên cứu
Bắt đầu bằng cách xác định SseClientTransportOptions.Endpoint và phần xây dựng URL ủy quyền được mô tả trong issue. Kiểm tra các bài kiểm thử hiện có về giao thức truyền tải SSE và các tham số tài nguyên OAuth. Công việc được xem là hoàn tất khi consumer có thể kiểm soát dạng dấu gạch chéo ở cuối endpoint và tài nguyên ủy quyền được tạo ra nhất quán với dạng đó.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Is your feature request related to a problem? Please describe.
When creating an MCP client that connects to an OAuth-secured MCP server, the "Endpoint" may have different conventions regarding whether or not it ends with a trailing slash. SseClientTransportOptions.Endpoint being a URI makes this increasingly problematic, as the default behavior appends a trailing slash, even if the input string doesn't contain it:
var urlRawString = "https://example.com";
var uri = new Uri(urlRawString);
Console.WriteLine(urlRawString); // https://example.com
Console.WriteLine(uri.ToString()); // https://example.com/
Per spec, this is even in violation of their recommendation of whether or not to include the trailing slash:
Note: While both https://mcp.example.com/ (with trailing slash) and https://mcp.example.com (without trailing slash) are technically valid absolute URIs according to RFC 3986, implementations SHOULD consistently use the form without the trailing slash for better interoperability unless the trailing slash is semantically significant for the specific resource.
Describe the solution you'd like
I'd like for SseClientTransportOptions.Endpoint to be a string, and the internals can validate that it is a URI
Describe alternatives you've considered
If SseClientTransportOptions.Endpoint being Uri is strictly necessary, than a callback to format the resource prior to constructing the authorization url may be helpful. Or some option to eab This is probably more problematic, though, as it would allow implementers to violate the spec more easily.
Additional context
To work around the issue, I have had to do the following when writing an MCP client:
- Set
ClientOAuthOptions.AuthorizationRedirectDelegate - Override the resource query parameter of the authorization url with the trailing slash removed
- 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
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của modelcontextprotocol/csharp-sdk
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
modelcontextprotocol/csharp-sdk#1867 ·
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
modelcontextprotocol/csharp-sdk#1840 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
modelcontextprotocol/csharp-sdk#1836 ·
-
enhancement needs confirmation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
modelcontextprotocol/csharp-sdk#678 · 1 bình luận ·
-
enhancement needs confirmation P3 ready for work
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
modelcontextprotocol/csharp-sdk#515 · 6 bình luận · 3 reaction ·
Tất cả issue của modelcontextprotocol/csharp-sdk
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
nightscout/nocturne#1379 ·
-
release-notes in .NET 11 RC2 Đang mởpriority-0
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 78/100
StackExchange/StackExchange.Redis#3249 ·
-
[Feat] 조합 영역 구분선 개선 Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
-
documentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100