Skip to content

fix(mcp): preserve all-interface HTTP hosts - #42953

Closed
Bennett Payoyo (Yahiro025) wants to merge 1 commit into
microsoft:mainfrom
Yahiro025:fix/mcp-http-host-all-interfaces-42952
Closed

Bennett Payoyo (Yahiro025) wants to merge 1 commit into
microsoft:mainfrom
Yahiro025:fix/mcp-http-host-all-interfaces-42952

Conversation

@Yahiro025

Copy link
Copy Markdown

Description

addressToString(..., { normalizeLoopback: true }) was rewriting bind hosts 0.0.0.0 and [::] to localhost. That breaks MCP HTTP mode when started with --host 0.0.0.0 (including the documented Docker setup), because the advertised URL / allowed host becomes loopback-only.

Only true loopbacks (127.0.0.1, [::1]) are normalized to localhost now. Adds regression coverage in tests/mcp/http.spec.ts.

Fixes #42952

Only normalize true loopback addresses in MCP HTTP URLs.

Fixes: microsoft#42952
@Yahiro025

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

@dgozman

Copy link
Copy Markdown
Collaborator

Closing in favor of #42993.

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.

[Bug]: MCP: 0.0.0.0 is incorrectly translated to loopback for http mode, breaking non-loopback use

2 participants