Skip to content

Allow HttpClient BaseAddress as transport endpoint#1710

Open
lntutor wants to merge 1 commit into
modelcontextprotocol:mainfrom
lntutor:feat/httpclient-base-address-515
Open

Allow HttpClient BaseAddress as transport endpoint#1710
lntutor wants to merge 1 commit into
modelcontextprotocol:mainfrom
lntutor:feat/httpclient-base-address-515

Conversation

@lntutor

@lntutor lntutor commented Jul 19, 2026

Copy link
Copy Markdown

Summary

  • allow HttpClientTransportOptions.Endpoint to be omitted when an injected HttpClient has a BaseAddress
  • pass the resolved endpoint explicitly through auto-detect, SSE, and Streamable HTTP session transports
  • preserve explicit endpoint precedence and support Aspire-style logical base-address schemes handled by custom HTTP handlers

Testing

  • dotnet test tests/ModelContextProtocol.Tests/ModelContextProtocol.Tests.csproj --filter FullyQualifiedName~HttpClientTransportTests
  • dotnet build tests/ModelContextProtocol.Tests/ModelContextProtocol.Tests.csproj --no-restore

Fixes #515

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SseClientTransport.Endpoint should be nullable when HttpClient is provided

1 participant