Explain OAuth client-registration failures during login (e.g. Figma 403) instead of leaking SDK JSON parse errors#298
Merged
Conversation
Logging in to a server that refuses Dynamic Client Registration (e.g. Figma's remote MCP server, which 403s any client not on its allow-list with a plain-text body) surfaced the SDK's raw JSON parse error: HTTP 403: Invalid OAuth error response: SyntaxError: Unexpected token 'F', "Forbidden" is not valid JSON. Raw body: Forbidden performOAuthFlow now rewrites registration-phase failures (detected via the SDK's typed OAuthError plus a reachedAuthorization flag set at the authorization redirect) into actionable guidance pointing at --client-id / --client-metadata-url. Allow-list wording is used only for 401/403 or OAuth-coded client rejections; other registration failures (5xx outages, rejected metadata) are reported honestly, and the server's underlying response stays visible in the message. Post-redirect errors pass through unchanged. Supersedes #297. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AP2pmUcWvR8rNypXqNEqtk
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
mcpc loginagainst a server that refuses Dynamic Client Registration (e.g. Figma's remote MCP server, which returns a plain-text403 Forbiddenfor clients not on its allow-list) surfaced the SDK's raw parse error (HTTP 403: Invalid OAuth error response: SyntaxError: ... Raw body: Forbidden). Registration-phase failures are now rewritten into actionable guidance pointing at--client-id/--client-metadata-url.OAuthErrorplus areachedAuthorizationflag; post-redirect errors pass through unchangedloginprints onlyerror.messageFixes #296, supersedes #297.
https://claude.ai/code/session_01AP2pmUcWvR8rNypXqNEqtk
Generated by Claude Code