-
Couldn't load subscription status.
- Fork 551
Description
Is your feature request related to a problem? Please describe.
I'm looking at how to integrate with .NET Aspire, where I have an MCP server on HTTP and then I want to consume that from an application using McpClient.
Aspire allows me to pass through the endpoint using service discovery on the HttpClient, so I can have an endpoint like https+http://mcp, but this endpoint can't be set to SseClientTransport.Endpoint due to this validation on the setter:
csharp-sdk/src/ModelContextProtocol.Core/Client/SseClientTransportOptions.cs
Lines 24 to 27 in 1e8fb04
| if (value.Scheme != Uri.UriSchemeHttp && value.Scheme != Uri.UriSchemeHttps) | |
| { | |
| throw new ArgumentException("Endpoint must use HTTP or HTTPS scheme.", nameof(value)); | |
| } |
Describe the solution you'd like
I want to be able to provide a HttpClient instance to the SseClientTransport without also having to provide the endpoint, since the HttpClient has the endpoint known (and it's resolved via service discovery).
Describe alternatives you've considered
My only solution is that I have to manually configure the endpoint, which defeats some of the value of using .NET Aspire here.