-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Support GitHub MCP in-box #2051
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
Conversation
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.
Pull Request Overview
This PR adds built-in support for the GitHub MCP (Model Context Protocol) Server to the extension. The feature is disabled by default and requires explicit opt-in via configuration. It supports both GitHub.com and GitHub Enterprise with configurable toolsets, readonly mode, and lockdown mode.
Key changes:
- New
GitHubMcpDefinitionProviderthat provides MCP server definitions based on configuration - Configuration settings for enabling GitHub MCP Server and controlling its behavior (toolsets, readonly, lockdown)
- Refactored
authProviderIdfunction to common authentication module for reuse - Enhanced test infrastructure to fire configuration change events
Reviewed Changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/extension/githubMcp/common/githubMcpDefinitionProvider.ts | Core provider implementation that generates MCP server definitions with dynamic configuration |
| src/extension/githubMcp/vscode-node/githubMcp.contribution.ts | Contribution that registers the MCP definition provider when enabled |
| src/extension/githubMcp/test/node/githubMcpDefinitionProvider.spec.ts | Comprehensive unit tests covering provider behavior and configuration changes |
| src/platform/configuration/common/configurationService.ts | Adds four new configuration keys for GitHub MCP Server settings |
| src/platform/authentication/common/authentication.ts | Adds authProviderId helper function moved from session.ts |
| src/platform/authentication/vscode-node/session.ts | Removes authProviderId function (moved to common) |
| src/platform/authentication/vscode-node/authenticationService.ts | Updates import to use authProviderId from common module |
| src/platform/configuration/test/common/inMemoryConfigurationService.ts | Fires configuration change events when config is set |
| src/extension/extension/vscode-node/contributions.ts | Registers GitHubMcpContrib in contribution list |
| package.json | Adds MCP server definition provider contribution, configuration schema, and disables githubRepo tool when MCP is enabled |
| package.nls.json | Adds localized descriptions for new configuration settings |
| return new GitHubMcpDefinitionProvider( | ||
| accessor.get(IConfigurationService), | ||
| accessor.get(IAuthenticationService), | ||
| accessor.get(ILogService) | ||
| ); |
Copilot
AI
Nov 20, 2025
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.
According to the coding guidelines (CodingGuidelineID: 1000002), tests should use IInstantiationService to create instances with mocks rather than manually passing dependencies. This ensures proper dependency injection. Change to: const instantiationService = accessor.get(IInstantiationService); return instantiationService.createInstance(GitHubMcpDefinitionProvider);
9ee3481
Fixes microsoft/vscode#254836
This allows the GitHub MCP Server to be readily available in-box.
To start, you must enable it with:
After that you should see it in your tool picker and if you have already signed in to Copilot Chat with the bigger token (to do codesearch, CCA, etc) no further auth should be required.
Oh, and if you're using GHE.com, that works too.
There's some configuration settings:
which align with https://github.com/github/github-mcp-server/blob/main/docs/remote-server.md#optional-headers
Oh, and if you enable this,
#githubRepois disabled since they are redundant.Next steps
Blocker
GitHub MCP is rolling out upscoping ...which is what we need to really support this. They've laid a foundation down with the
search_orgstool which will say you needread:orgsto query it if you give it a token that does not have that but:resource_metadatais currently wrong (small fix)So both those things, along with rolling it out to all tools, should be done before this could be enabled by default.