Repository navigation
docs: correct the 401 scope note and test the refresh-token dead-end - #48
Merged
Merged
Conversation
A 401 names scopes when the server adds them, which mcp-handler's withMcpAuth does, so the README line was wrong for Next.js. The e2e tokens had no refresh_token, so nothing exercised the SDK 1.x client refreshing instead of redirecting. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Caution Review failedThe pull request is closed. Walkthrough
Merge Risk:
|
Fold the scopes_supported fallback into one sentence, and scope the first-connection claim to 401s that name no scopes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
manovotny
marked this pull request as ready for review
November 6, 2026 22:32
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.
Summary
Two gaps from reviewing clerk/clerk#3786. The README said a
401usually names no scope, which is wrong for Next.js servers onmcp-handler. The step-up e2e test also never gave the client a refresh token, so it missed the case where the MCP SDK 1.x client can't step up.Changes
401names scopes only when the server adds them, asmcp-handler'swithMcpAuthdoes from itsrequiredScopes. Otherwise,scopes_supportedis what a client requests on first connection.test/step-up.test.ts: adds a client holding a refresh token. The SDK 1.x client refreshes instead of redirecting, gets the same scopes back, and throwsServer returned 403 after trying upscoping, so the user never reaches consent. Clerk issues refresh tokens by default, so real clients on 1.x land here.The new test pins current SDK behavior. It fails if a 1.x backport lands, and that's the cue to flip it to expect the redirect.
References
🤖 Generated with Claude Code