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
Contributor

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

@lntutor
lntutor force-pushed the feat/httpclient-base-address-515 branch 2 times, most recently from e4eef7d to cdc98ae Compare July 26, 2026 10:00
@lntutor
lntutor force-pushed the feat/httpclient-base-address-515 branch from cdc98ae to c4d7b1c Compare July 26, 2026 10:19
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