21 KiB
title, intro, shortTitle, versions, defaultTool, topics, redirect_from, contentType, category
| title | intro | shortTitle | versions | defaultTool | topics | redirect_from | contentType | category | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Setting up the GitHub MCP Server | Learn how to configure the GitHub Model Context Protocol (MCP) server. | Set up the GitHub MCP Server |
|
vscode |
|
|
how-tos |
|
The {% data variables.product.github %} MCP server is available to all {% data variables.product.github %} users regardless of plan type. However, specific tools within the MCP server inherit the same access requirements as their corresponding {% data variables.product.github %} features. If a feature requires a paid {% data variables.product.github %} or {% data variables.product.prodname_copilot_short %} license, the equivalent MCP tool will require the same subscription. For example, tools that interact with {% data variables.product.prodname_copilot_short %} Coding Agent require a paid {% data variables.product.prodname_copilot_short %} license.
{% vscode %}
{% data reusables.copilot.mcp.about-github-mcp-server %}
Prerequisites
- A {% data variables.product.github %} account.
- {% data variables.product.prodname_vscode %}.
- {% data reusables.copilot.mcp-policy-requirement %}
Setting up the {% data variables.product.github %} MCP server in {% data variables.product.prodname_vscode %}
The {% data variables.product.github %} MCP server in {% data variables.product.prodname_vscode %} can be configured remotely or locally. The remote {% data variables.product.github %} MCP server is hosted by {% data variables.product.github %} and is the recommended option for most users. The local {% data variables.product.github %} MCP server is hosted on your machine and is recommended for users who want to customize their setup or have specific security requirements.
The steps below describe remote configuration through the MCP marketplace in {% data variables.product.prodname_vscode %}'s extension panel. The MCP marketplace is powered by the {% data variables.product.github %} MCP Registry. See MCP Registry.
For information on manually configuring the remote or local {% data variables.product.github %} MCP server, see the {% data variables.product.github %} MCP server documentation.
- In {% data variables.product.prodname_vscode %}, open the extensions panel by clicking the extensions icon in the sidebar or pressing Ctrl+Shift+X (Windows/Linux) / Command+Shift+X (Mac).
- In the extensions search bar, click the filter icon and select MCP Server from the dropdown.
- If it is your first time using the MCP Servers Marketplace, follow the prompts on screen to enable the Marketplace.
- In the search bar, type
githuband select the {% data variables.product.github %} MCP server from the search results. - On the {% data variables.product.github %} MCP server configuration page, click Install.
- To check that the {% data variables.product.github %} MCP server is configured correctly, open the command palette by pressing Ctrl+Shift+P (Windows/Linux) / Command+Shift+P (Mac).
- Type and select MCP: List Servers. You should see
githublisted as a configured server.
Tool configuration
The {% data variables.product.github %} MCP server supports installing individual toolsets, either in read-only mode or with full read/write access, via the --toolsets flag. For more information, see Tool Configuration in the GitHub MCP server documentation.
{% endvscode %}
{% visualstudio %}
{% data reusables.copilot.mcp.about-github-mcp-server %}
Prerequisites
- Access to {% data variables.product.prodname_copilot_short %}. {% data reusables.copilot.subscription-prerequisite %}
- {% data variables.product.prodname_vs %} version 17.14 or later. For more information on installing {% data variables.product.prodname_vs %}, see the {% data variables.product.prodname_vs %} downloads page.
- Sign in to {% data variables.product.company_short %} from {% data variables.product.prodname_vs %}.
- {% data reusables.copilot.mcp-policy-requirement %}
Setting up the {% data variables.product.github %} MCP server in {% data variables.product.prodname_vs %}
The instructions below guide you through setting up the {% data variables.product.github %} MCP server in {% data variables.product.prodname_vs %}. Other MCP-compatible editors may have similar steps, but the exact process may vary.
The remote {% data variables.product.github %} MCP server uses one-click OAuth authentication by default, but you can also manually configure it to use a {% data variables.product.pat_generic %} (PAT) for authentication. If you use OAuth, the MCP server can only access the scopes you approve during sign-in. In organization-owned contexts, access may also be limited by admin policies that control which scopes and apps are permitted. If you use a PAT, the MCP server will have access to the scopes granted by the PAT, which is also subject to any PAT restrictions configured by the organization.
Note
If you are an {% data variables.product.prodname_emu %}, then PAT is disabled by default, unless enabled by an enterprise administrator. If PAT is disabled, you won't be able to use PAT authentication. If you have OAuth access policy restrictions, you will need the OAuth App for each client (MCP host application) to be enabled (except {% data variables.product.prodname_vscode %} and {% data variables.product.prodname_vs %}).
For information on setting up the {% data variables.product.github %} MCP server locally, see the GitHub MCP server documentation.
Remote MCP server configuration with OAuth
You do not need to create a PAT or install any additional software to use the remote {% data variables.product.github %} MCP server with OAuth. You can set it up directly in {% data variables.product.prodname_vs %}.
-
In the {% data variables.product.prodname_vs %} menu bar, click View, then click {% data variables.copilot.copilot_chat %}.
-
At the bottom of the chat panel, select Agent from the mode dropdown.
-
In the {% data variables.copilot.copilot_chat_short %} window, click the tools icon, then click the plus icon in the tool picker window.
-
In the "Configure MCP server" pop-up window, fill out the fields.
- For "Server ID", type
github. - For "Type", select "HTTP/SSE" from the dropdown.
- For "URL", type
https://api.githubcopilot.com/mcp/.
- For "Server ID", type
-
Click Save. The configuration in the
mcp.jsonfile should look like this:{ "servers": { "github": { "url": "https://api.githubcopilot.com/mcp/" } } } -
In the
mcp.jsonfile, click Auth from the CodeLens above the server to authenticate to the server. A pop-up will come up allowing you to authenticate with your {% data variables.product.github %} account.
Remote MCP server configuration with PAT
To configure the remote {% data variables.product.github %} MCP server with a PAT, ensure you have created a PAT with the necessary scopes for the access you want to grant to the MCP server. For more information, see AUTOTITLE.
-
In the {% data variables.product.prodname_vs %} menu bar, click View, then click {% data variables.copilot.copilot_chat %}.
-
At the bottom of the chat panel, select Agent from the mode dropdown.
-
In the {% data variables.copilot.copilot_chat_short %} window, click the tools icon, then click the plus icon in the tool picker window.
-
In the "Configure MCP server" pop-up window, fill out the fields.
- For "Server ID", type
github. - For "Type", select "HTTP/SSE" from the dropdown.
- For "URL", type
https://api.githubcopilot.com/mcp/. - Add a new header under "Headers", called "Authorization" and set to the value
Bearer YOUR_GITHUB_PAT, replacing "YOUR_GITHUB_PAT" with your PAT.
- For "Server ID", type
-
Click Save. The configuration in the
mcp.jsonfile should look like this:{ "servers": { "github": { "url": "https://api.githubcopilot.com/mcp/", "requestInit": { "headers": { "Authorization": "Bearer YOUR_GITHUB_PAT" } } } } }
For more information on configuring MCP servers in {% data variables.product.prodname_vs %}, see Use MCP servers in {% data variables.product.prodname_vs %} (Preview) in the {% data variables.product.prodname_vs %} documentation.
{% endvisualstudio %}
{% jetbrains %}
{% data reusables.copilot.mcp.about-github-mcp-server %}
Prerequisites
-
Access to {% data variables.product.prodname_copilot_short %}. {% data reusables.copilot.subscription-prerequisite %}
-
A compatible JetBrains IDE. {% data variables.product.prodname_copilot %} is compatible with the following IDEs:
{% data reusables.copilot.jetbrains-compatible-ides %} {% data reusables.copilot.jetbrains-plugin-prerequisites %}
-
{% data reusables.copilot.mcp-policy-requirement %}
Setting up the {% data variables.product.github %} MCP server in JetBrains IDEs
The instructions below guide you through setting up the {% data variables.product.github %} MCP server in JetBrains IDEs. Other MCP-compatible editors may have similar steps, but the exact process may vary.
The remote {% data variables.product.github %} MCP server uses one-click OAuth authentication by default, but you can also manually configure it to use a {% data variables.product.pat_generic %} (PAT) for authentication. If you use OAuth, the MCP server can only access the scopes you approve during sign-in. In organization-owned contexts, access may also be limited by admin policies that control which scopes and apps are permitted. If you use a PAT, the MCP server will have access to the scopes granted by the PAT, which is also subject to any PAT restrictions configured by the organization.
Note
If you are an {% data variables.product.prodname_emu %}, then PAT is disabled by default, unless enabled by an enterprise administrator. If PAT is disabled, you won't be able to use PAT authentication. If you have OAuth access policy restrictions, you will need the OAuth App for each client (MCP host application) to be enabled (except {% data variables.product.prodname_vscode %} and {% data variables.product.prodname_vs %}).
For information on setting up the {% data variables.product.github %} MCP server locally, see the GitHub MCP server documentation.
Remote MCP server configuration with OAuth
You do not need to create a PAT or install any additional software to use the remote {% data variables.product.github %} MCP server with OAuth. You can set it up directly in JetBrains IDEs.
{% data reusables.copilot.jetbrains-mcp-setup-steps %}
-
In the
mcp.jsonfile, add the following configuration:{% data reusables.copilot.github-mcp-oauth-config-other-ides %}
-
In the "{% data variables.product.prodname_copilot %}" popup that says the "MCP server definition wants to authenticate to {% data variables.product.github %}, click Allow.
-
If you have not yet authorized the {% data variables.product.prodname_copilot %} plugin, in the browser popup, click Continue next to your personal account.
Remote MCP server configuration with PAT
To configure the remote {% data variables.product.github %} MCP server with a PAT, ensure you have created a PAT with the necessary scopes for the access you want to grant to the MCP server. For more information, see AUTOTITLE.
{% data reusables.copilot.jetbrains-mcp-setup-steps %}
- In the
mcp.jsonfile, add the following configuration, replacingYOUR_GITHUB_PATwith the PAT you created:
{
"servers": {
"github": {
"url": "https://api.githubcopilot.com/mcp/",
"requestInit": {
"headers": {
"Authorization": "Bearer YOUR_GITHUB_PAT"
}
}
}
}
}
{% endjetbrains %}
{% xcode %}
{% data reusables.copilot.mcp.about-github-mcp-server %}
Prerequisites
- Access to {% data variables.product.prodname_copilot_short %}. {% data reusables.copilot.subscription-prerequisite %}
- {% data variables.product.prodname_copilot %} for Xcode extension. See AUTOTITLE.
- {% data reusables.copilot.mcp-policy-requirement %}
Setting up the {% data variables.product.github %} MCP server in Xcode
The instructions below guide you through setting up the {% data variables.product.github %} MCP server in Xcode. Other MCP-compatible editors may have similar steps, but the exact process may vary.
The remote {% data variables.product.github %} MCP server uses one-click OAuth authentication by default, but you can also manually configure it to use a {% data variables.product.pat_generic %} (PAT) for authentication. If you use OAuth, the MCP server can only access the scopes you approve during sign-in. In organization-owned contexts, access may also be limited by admin policies that control which scopes and apps are permitted. If you use a PAT, the MCP server will have access to the scopes granted by the PAT, which is also subject to any PAT restrictions configured by the organization.
Note
If you are an {% data variables.product.prodname_emu %}, then PAT is disabled by default, unless enabled by an enterprise administrator. If PAT is disabled, you won't be able to use PAT authentication. If you have OAuth access policy restrictions, you will need the OAuth App for each client (MCP host application) to be enabled (except {% data variables.product.prodname_vscode %} and {% data variables.product.prodname_vs %}).
For information on setting up the {% data variables.product.github %} MCP server locally, see the GitHub MCP server documentation.
Remote MCP server configuration with OAuth
You do not need to create a PAT or install any additional software to use the remote {% data variables.product.github %} MCP server with OAuth. You can set it up directly in Xcode.
{% data reusables.copilot.xcode-mcp-setup-steps %}
-
Add the following configuration:
{% data reusables.copilot.github-mcp-oauth-config-other-ides %}
-
In the "{% data variables.product.prodname_copilot %}" popup that says the "MCP Server Definition wants to authenticate to {% data variables.product.github %}", click Continue.
-
If you have not yet authorized the {% data variables.product.prodname_copilot %} plugin, in the browser popup, click Continue next to your personal account.
Remote MCP server configuration with PAT
To configure the remote {% data variables.product.github %} MCP server with a PAT, ensure you have created a PAT with the necessary scopes for the access you want to grant to the MCP server. For more information, see AUTOTITLE.
{% data reusables.copilot.xcode-mcp-setup-steps %}
- Add the following configuration, replacing
YOUR_GITHUB_PATwith the PAT you created:
{
"servers": {
"github": {
"url": "https://api.githubcopilot.com/mcp/",
"requestInit": {
"headers": {
"Authorization": "Bearer YOUR_GITHUB_PAT"
}
}
}
}
}
{% endxcode %}
{% eclipse %}
{% data reusables.copilot.mcp.about-github-mcp-server %}
Prerequisites
{% data reusables.copilot.eclipse-prerequisites %}
- Latest version of the {% data variables.product.prodname_copilot %} extension. Download this from the Eclipse Marketplace. For more information, see AUTOTITLE.
- Sign in to {% data variables.product.company_short %} from Eclipse.
Setting up the {% data variables.product.github %} MCP server in Eclipse
The instructions below guide you through setting up the {% data variables.product.github %} MCP server in Eclipse. Other MCP-compatible editors may have similar steps, but the exact process may vary.
The remote {% data variables.product.github %} MCP server uses one-click OAuth authentication by default, but you can also manually configure it to use a {% data variables.product.pat_generic %} (PAT) for authentication. If you use OAuth, the MCP server can only access the scopes you approve during sign-in. In organization-owned contexts, access may also be limited by admin policies that control which scopes and apps are permitted. If you use a PAT, the MCP server will have access to the scopes granted by the PAT, which is also subject to any PAT restrictions configured by the organization.
Note
If you are an {% data variables.product.prodname_emu %}, then PAT is disabled by default, unless enabled by an enterprise administrator. If PAT is disabled, you won't be able to use PAT authentication. If you have OAuth access policy restrictions, you will need the OAuth App for each client (MCP host application) to be enabled (except {% data variables.product.prodname_vscode %} and {% data variables.product.prodname_vs %}).
For information on setting up the {% data variables.product.github %} MCP server locally, see the GitHub MCP server repository.
Remote MCP server configuration with OAuth
You do not need to create a PAT or install any additional software to use the remote {% data variables.product.github %} MCP server with OAuth. You can set it up directly in Eclipse.
{% data reusables.copilot.eclipse-mcp-setup-steps %}
-
Add the following configuration under "Server Configurations":
{% data reusables.copilot.github-mcp-oauth-config-other-ides %}
-
Click Apply.
-
In the "{% data variables.product.prodname_copilot %}" popup that says the "MCP Server Definition wants to authenticate to {% data variables.product.github %}", click OK.
-
If you have not yet authorized the {% data variables.product.prodname_copilot %} plugin, in the browser popup, click Continue next to your personal account.
Remote MCP server configuration with PAT
To configure the remote {% data variables.product.github %} MCP server with a PAT, ensure you have created a PAT with the necessary scopes for the access you want to grant to the MCP server. For more information, see AUTOTITLE.
{% data reusables.copilot.eclipse-mcp-setup-steps %}
- Add the following configuration under "Server Configurations", replacing
YOUR_GITHUB_PATwith the PAT you created:
{
"servers": {
"github": {
"url": "https://api.githubcopilot.com/mcp/",
"requestInit": {
"headers": {
"Authorization": "Bearer YOUR_GITHUB_PAT"
}
}
}
}
}
{% endeclipse %}
Next steps
To learn how to use the {% data variables.product.github %} MCP server in {% data variables.product.prodname_vscode %}, see AUTOTITLE.