-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Add OAuth 2.1 authentication for stdio mode with MCP URL elicitation and performance optimizations #1836
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
Draft
Copilot
wants to merge
18
commits into
main
Choose a base branch
from
copilot/implement-oauth-flow-in-stdio
base: main
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.
+1,654
−37
Draft
Add OAuth 2.1 authentication for stdio mode with MCP URL elicitation and performance optimizations #1836
Changes from 14 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
361bcb8
Initial plan
Copilot 13f9216
Add OAuth 2.1 PKCE flow for stdio mode
Copilot 7813b50
Add OAuth authentication documentation
Copilot f87313f
Address code review feedback
Copilot da260e1
Fix final code review issues
Copilot fc957af
Final validation - all checks passing
Copilot 7b5c1fe
Add device flow fallback for Docker environments
Copilot 3278eee
Improve OAuth documentation for easy configuration
Copilot 76defa8
Update OAuth examples to always include client secret
Copilot 5e50dfd
Compute OAuth scopes dynamically based on enabled tools
Copilot 88c632b
Allow server startup without token for future zero-config OAuth
Copilot 39b60d6
Implement OAuth with URL elicitation and lazy authentication
Copilot 70c4553
Optimize inventory building and add OAuth scope filtering
Copilot 2bcd1ee
fix(oauth): only elicit when browser fails to open
SamMorrowDrums e08df2e
chore: regenerate license files
github-actions[bot] 06d8b47
Delete test-oauth
SamMorrowDrums 6ea3eec
test(oauth): add comprehensive Manager tests
SamMorrowDrums 0a3fc25
fix(oauth): preserve GHEC tenant domains in OAuth endpoints
SamMorrowDrums File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot, this is actually a bit weak. We have both typed scopes, and ability to discern what is required based on tools the user will enable via provided configuration, so we should not hard code but instead possibly determine this between filtering tools and registering them with new server, so the flow is seamless, and minimum required scopes based on selected scopes are automatically requested.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Implemented dynamic scope computation in commit
5e50dfd. The OAuth flow now:RequiredScopesfrom all tools that will be available--oauth-scopesflagFor example:
--toolsets repos→ requests onlyreposcope--read-only --toolsets repos,issues→ minimal read scopesThis seamlessly integrates with the existing tool filtering system and automatically adapts when tool selection changes.