Skip to content

Conversation

automaton82
Copy link
Contributor

Motivation and Context

Visual Studio Code MCP server (and others) inject other grant types in OAuth request that are superfluous and can be ignored. As long as authorization_code and refresh_token are present this should be sufficient to work without erroring out.

How Has This Been Tested?

I tested this locally in Visual Studio Code itself, and was able to have OAuth work successfully with these changes.

Breaking Changes

No breaking changes.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Additional context

@automaton82
Copy link
Contributor Author

This should solve #1379

@automaton82 automaton82 changed the title Issue 1379 patch Issue 1379 patch - Fix MCP server OAuth not working with Visual Studio Code and others with extra grant_types Sep 19, 2025
@pcarleton
Copy link
Member

overall looks good, please add a test to make sure we keep this behavior in any future refactors

@automaton82
Copy link
Contributor Author

overall looks good, please add a test to make sure we keep this behavior in any future refactors

Thank you @pcarleton. Done in 3b7419e

@automaton82
Copy link
Contributor Author

Hi just following up @pcarleton @ochafik is there anything else you need to merge this? Let me know happy to help.

Thank you!

@mkschreder
Copy link

This will be very appreciated.

@felixweinberger felixweinberger added needs more eyes Needs alignment among maintainers whether this is something we want to add auth Issues and PRs related to Authentication / OAuth labels Sep 26, 2025
pcarleton
pcarleton previously approved these changes Sep 26, 2025
Copy link
Member

@pcarleton pcarleton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for this!

@automaton82
Copy link
Contributor Author

automaton82 commented Sep 26, 2025

thanks for this!

@pcarleton thank you for the approval! Unfortunately there was a merge conflict due to main drift in the test class. I rebased to resolve, but you need to approve again. There were no changes since the previous approval. Thanks!

@pcarleton pcarleton merged commit 9323efa into modelcontextprotocol:main Sep 29, 2025
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auth Issues and PRs related to Authentication / OAuth needs more eyes Needs alignment among maintainers whether this is something we want to add
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants