Restrict built-in OAuth apps to explicitly allowed integrations - #2079
Closed
RayTCosgrove wants to merge 1 commit into
Closed
RayTCosgrove wants to merge 1 commit into
RayTCosgrove wants to merge 1 commit into
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
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.
GitHub MCP can select the cloud
first-party:githubapp because it sharesgithub.comOAuth endpoints with GitHub REST. That app uses GitHub App user tokens with fixed permissions and repository installation access; selecting it does not grant the classic OAuth scopes an integration may expect. Today the SDK also accepts that client/integration pairing directly throughoauth.start.Add an optional
allowedIntegrationspolicy and restrict the cloud GitHub App togithub_rest, the integration currently named in its registration. The existingintegrationsfield remains a ranking hint, preserving host matching for other deployments and providers.This is a guard against selecting an unsupported shared app. It does not grant private repository access or repair existing GitHub App installations. Supporting GitHub MCP through this app still requires configuring and approving its repository permissions and installation access, then expanding the allow-list. GitHub documents the user-token permission limits here.
Validation: 116 focused tests pass (79 SDK OAuth flow/scope tests, 31 picker tests, 6 cloud configuration tests). The two targeted cloud e2e scenarios pass: the supported REST flow still redirects, and a different integration sharing GitHub's endpoints is rejected by the API and offers Register app in the browser. Full
typecheckpasses across 45 packages;lintandformat:checkpass. The fulltestgate stopped on two 15-second MCP test timeouts; both files passed on a separate run with two workers (15 tests). The entire unit suite has not completed successfully, so this remains a draft.Browser evidence uses a fresh synthetic workspace and no production credentials: