Skip to content

Fix MCP OAuth redirects for browser navigation - #1918

Merged
Hydralerne merged 1 commit into
mainfrom
fix/mcp-oauth-navigation-1914
Nov 29, 2026
Merged

Hydralerne merged 1 commit into
mainfrom
fix/mcp-oauth-navigation-1914

Conversation

@Hydralerne

Copy link
Copy Markdown
Member

Summary

A browser navigation can receive JSON from Better Auth when its Accept header also advertises JSON. Request HTML for GET navigations on the MCP authorization endpoint and its legacy alias so Better Auth sends the signed 302 redirect itself. Programmatic calls continue to use Better Auth's existing response negotiation.

Thanks to @chbndrhnns for reporting and investigating this in #1913.

Closes #1914.

Verification

  • Both new navigation tests returned 200 before the fix and 302 afterward.
  • 94 tests passed across the MCP provider, desktop MCP, OAuth redirect, and OIDC suites. The signed consent from a browser redirect also exchanged successfully for a token.
  • API typecheck and the error boundary audit passed.

@Hydralerne
Hydralerne merged commit 0bd0696 into main Nov 29, 2026
24 checks passed
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.

MCP OAuth authorization endpoint returns JSON instead of browser redirect

1 participant