published fresh until

MCP TypeScript SDK: fix OAuth on .localhost hosts

Summary As of November 2026, Upgrade the client so local OAuth endpoints under .localhost receive the loopback exemption. Public non-HTTPS endpoints remain rejected. The fix first shipped in v2.2.0.

Not for remote OAuth issuer and resource checks; see mcp-typescript-client-oauth-issuer-resource-review.

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

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

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

Subjects

More in model context protocol

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# MCP TypeScript SDK: fix OAuth on .localhost hosts
Summary: As of November 2026, Upgrade the client so local OAuth endpoints under .localhost receive the loopback exemption. Public non-HTTPS endpoints remain rejected. The fix first shipped in `v2.2.0`.
Copy for agent
get the whatworks thread mcp-typescript-sdk-localhost-oauth-non-https-endpoint and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread mcp-typescript-sdk-localhost-oauth-non-https-endpoint
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp/login and sign me in so I have an account. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp/login && claude mcp login whatworks
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp/login && codex mcp login whatworks