-
Notifications
You must be signed in to change notification settings - Fork 3.9k
fix(mcp): Upgrade SDK and add redirectUri config for OAuth callback #5940
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
christso
wants to merge
4
commits into
sst:dev
Choose a base branch
from
EntityProcess:feat/oauth-public-client-fallback
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
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
Contributor
Author
|
Future Enhancement Note: Dynamic port allocation (binding to port |
3eef5d6 to
01fb104
Compare
Update MCP SDK to get latest OAuth improvements including better public client support. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add support for OAuth public clients (no client secret) with configurable redirect URI. This enables MCP servers that don't support dynamic client registration to work with pre-registered public OAuth clients. Changes: - Add redirectUri option to McpOAuthConfig for flexible callback configuration - Add parseRedirectUri() helper to extract port/path from URI string - Update oauth-callback server to accept redirectUri parameter - Support public clients via token_endpoint_auth_method: "none" - Update config schema and CLI debug command The redirectUri approach is cleaner than separate port/path options and matches standard OAuth library patterns, making debugging easier. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add test coverage for McpOAuthCallback.ensureRunning() including: - Default port/path behavior - Custom redirectUri parsing - Server restart on config change - Idempotent behavior - Start/stop lifecycle 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
ed54e4f to
914d122
Compare
- Remove redundant tests (duplicate default/isRunning checks) - Add dedicated parseRedirectUri unit tests for port/path parsing - Test edge cases: http/https defaults, invalid URIs 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This was referenced Dec 28, 2025
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.
Closes #5766
Summary
redirectUrifor OAuth callback (simpler than separate port/path)Problem
Wrong authorization URL: MCP SDK 1.15.1 incorrectly constructs the authorization URL by appending
/authorizeto the issuer URL instead of usingauthorization_endpointfrom OAuth metadata.No callback config: Users cannot configure the OAuth callback URL to match what's registered on their OAuth server.
Solution
Upgrade MCP SDK to 1.25.1 which correctly reads
authorization_endpointfrom OAuth discovery metadata.Add
redirectUriconfig option: A single URI string that specifies the full callback URL. This is cleaner than separate port/path options and matches standard OAuth library patterns.User Configuration
If
redirectUriis not specified, the defaulthttp://127.0.0.1:19876/mcp/oauth/callbackis used.Why
redirectUriinstead ofcallbackPort/callbackPath?Test plan
ensureRunningbehavior with custom URIs🤖 Generated with Claude Code