Skip to content

Conversation

@TylerLeonhardt
Copy link
Member

@TylerLeonhardt TylerLeonhardt commented Nov 17, 2025

Fixes microsoft/vscode#254836

This allows the GitHub MCP Server to be readily available in-box.

To start, you must enable it with:

"github.copilot.chat.githubMcpServer.enabled": true

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:

  "github.copilot.chat.githubMcpServer.toolsets": ["default"],
  "github.copilot.chat.githubMcpServer.readonly": false,
  "github.copilot.chat.githubMcpServer.lockdown": false,

which align with https://github.com/github/github-mcp-server/blob/main/docs/remote-server.md#optional-headers

Oh, and if you enable this, #githubRepo is disabled since they are redundant.

Next steps

  1. We don't want to enable this by default because it influences token usage... but we want it to be discoverable. Since we are disabled by default, we can solve this in another PR. Ideas: allow me to "uncheck" an MCP Server by default, make this a single virtual tool somehow
  2. With GitHub being available from the MCP Registry, what should we do about the conflict there?
  3. Should there be alignment with what scopes we enable in Copilot CLI?

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_orgs tool which will say you need read:orgs to query it if you give it a token that does not have that but:

  1. the resource_metadata is currently wrong (small fix)
  2. it tells you the scope you're missing but it should instead return that scope added to the scopes that your token already had

So both those things, along with rolling it out to all tools, should be done before this could be enabled by default.

@TylerLeonhardt TylerLeonhardt self-assigned this Nov 17, 2025
@TylerLeonhardt TylerLeonhardt marked this pull request as ready for review November 20, 2025 00:31
Copilot AI review requested due to automatic review settings November 20, 2025 00:31
@vs-code-engineering vs-code-engineering bot added this to the November 2025 milestone Nov 20, 2025
Copilot finished reviewing on behalf of TylerLeonhardt November 20, 2025 00:33
Copy link
Contributor

Copilot AI left a 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 GitHubMcpDefinitionProvider that provides MCP server definitions based on configuration
  • Configuration settings for enabling GitHub MCP Server and controlling its behavior (toolsets, readonly, lockdown)
  • Refactored authProviderId function 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

Comment on lines +118 to +122
return new GitHubMcpDefinitionProvider(
accessor.get(IConfigurationService),
accessor.get(IAuthenticationService),
accessor.get(ILogService)
);
Copy link

Copilot AI Nov 20, 2025

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);

Copilot generated this review using guidance from repository custom instructions.
karthiknadig
karthiknadig previously approved these changes Nov 20, 2025
@TylerLeonhardt TylerLeonhardt added this pull request to the merge queue Nov 20, 2025
DonJayamanne
DonJayamanne previously approved these changes Nov 20, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to a conflict with the base branch Nov 20, 2025
@TylerLeonhardt TylerLeonhardt changed the title Support GitHub MCP inbox Support GitHub MCP in-box Nov 20, 2025
@microsoft microsoft deleted a comment from Copilot AI Nov 20, 2025
@TylerLeonhardt TylerLeonhardt added this pull request to the merge queue Nov 20, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 20, 2025
@TylerLeonhardt TylerLeonhardt added this pull request to the merge queue Nov 20, 2025
Merged via the queue into main with commit 6cea1c0 Nov 20, 2025
16 checks passed
@TylerLeonhardt TylerLeonhardt deleted the tyler/poor-termite branch November 20, 2025 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Contribute GitHub MCP Server from GitHub built in extension

5 participants