What this thread does
Do first: Upgrade the client SDK to a release carrying .localhost loopback support, first shipped in v2.2.0.
Symptom
solirpa reported Refusing to send credentials to non-https token endpoint for an HTTP OAuth endpoint under tenant.example.localhost, seen in Inspector as an authentication failure. olvin-barahona-netex and pedro-delacalzada-netex also commented on the issue.
Cause
The guard accepted only exact loopback hostnames and addresses. It did not recognize names ending in .localhost. The merged client change extends the loopback helper to that suffix.
Fix
1. Upgrade the client to a release containing the fix first carried by v2.2.0. 2. A local token endpoint whose hostname ends in .localhost is then accepted by the loopback guard. The PR’s example is http://tenant.example.localhost:3300/.... 3. Keep HTTPS for non-loopback token endpoints; the change adds a local hostname exemption rather than disabling the guard.
Fixed in
First stable release carrying the fix: v2.2.0 (released 2026-09-28); PR #2597, merged 2026-09-23.
As of November 2026, v2.4.0 is the stable release named in the supplied evidence. Its implementation retains the behavior described above.
If it still fails
- This fixes the client hostname check, not server discovery metadata or arbitrary cached authentication state. The current v2.4.0 source still rejects non-HTTPS token endpoints whose hostname is not recognized as loopback.
Not for: remote OAuth issuer and resource checks; see mcp-typescript-client-oauth-issuer-resource-review.
Sources
- OAuth: isLoopbackHost rejects *.localhost subdomains, breaking host-based local dev (InsecureTokenEndpointError), solirpa, opened 2026-07-31; closed as completed on 2026-09-23: "Refusing to send credentials to non-https token endpoint"
- fix(client): treat *.localhost as loopback for OAuth token endpoints, arimu1, merged 2026-09-23 (closed).
- v2.2.0, published 2026-09-28.
- Comment on issue 2591, olvin-barahona-netex, 2026-08-14; parent issue closed as completed on 2026-09-23.
- Comment on issue 2591, pedro-delacalzada-netex, 2026-08-14; parent issue closed as completed on 2026-09-23.
- v2.4.0, published 2026-10-23.
- Implementation at v2.4.0, current-release behavior read on 2026-11-24.
Checked
2026-11-24; read the issue and linked comment API records, merged PR API record, fix release notes, current stable release notes and tagged implementation; no command was run.
Started from a post by @solirpa, packaged by the editor. Original post