feat: implement automatic OAuth flow with dynamic client registration#26
Open
mvaled wants to merge 1 commit intonicobailon:mainfrom
Open
feat: implement automatic OAuth flow with dynamic client registration#26mvaled wants to merge 1 commit intonicobailon:mainfrom
mvaled wants to merge 1 commit intonicobailon:mainfrom
Conversation
Add full OAuth 2.0 authorization code flow with PKCE: - New oauth-flow.ts: Complete OAuth implementation - Discovery via .well-known/oauth-authorization-server - Dynamic client registration at /register endpoint - PKCE code verifier/challenge generation - Local HTTP callback server with random port - Automatic browser opening for authorization - Token exchange and storage - Enhanced oauth-handler.ts: - Automatic token refresh when expired - Uses refresh_token to get new access_token - Stores authorization metadata (server, clientId) - Updated types.ts: - Added scopes, clientId, authorizationServer fields - Updated commands.ts: - /mcp-auth now runs full OAuth flow instead of showing instructions - Step-by-step progress notifications - Updated server-manager.ts: - Async token loading with automatic refresh Fixes: OAuth servers like Notion that require dynamic client registration now work automatically without manual setup.
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.
Disclaimer: This was fully vibed with
piandkimi-k2.5. I don't have yet the time to devote a full revision. I have successfully registered Notion's and Sentry's MCPs with this. In particular Sentry provide tokens with refresh of 15 minutes, which makes this auto-refresh a nice addition.Add full OAuth 2.0 authorization code flow with PKCE:
New oauth-flow.ts: Complete OAuth implementation
Enhanced oauth-handler.ts:
Updated types.ts:
Updated commands.ts:
Updated server-manager.ts:
Fixes: OAuth servers like Notion that require dynamic client registration now work automatically without manual setup.