Skip to content

Repo sync #38879

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

Merged
merged 2 commits into from
Jun 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/generate-code-scanning-query-lists.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ jobs:

- name: Build code scanning query list
run: |
for lang in "actions" "cpp" "csharp" "go" "java" "javascript" "python" "ruby" "swift"; do
for lang in "actions" "cpp" "csharp" "go" "java" "javascript" "python" "ruby" "rust" "swift"; do
echo "Generating code scanning query list for $lang"
npm run generate-code-scanning-query-list -- \
--verbose \
Expand Down
4 changes: 0 additions & 4 deletions .vscode/settings.json

This file was deleted.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 1 addition & 2 deletions content/copilot/customizing-copilot/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,14 @@ versions:
topics:
- Copilot
children:
- /using-model-context-protocol
- /extending-the-capabilities-of-github-copilot-in-your-organization
- /about-customizing-github-copilot-chat-responses
- /adding-personal-custom-instructions-for-github-copilot
- /adding-repository-custom-instructions-for-github-copilot
- /adding-organization-custom-instructions-for-github-copilot
- /customizing-the-development-environment-for-copilot-coding-agent
- /customizing-or-disabling-the-firewall-for-copilot-coding-agent
- /extending-copilot-chat-with-mcp
- /extending-copilot-coding-agent-with-mcp
- /managing-copilot-knowledge-bases
- /creating-a-custom-model-for-github-copilot
redirect_from:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ versions:
topics:
- Copilot
type: how_to
redirect_from:
- /copilot/customizing-copilot/extending-copilot-chat-with-mcp
---

>[!NOTE]
Expand Down Expand Up @@ -36,15 +38,16 @@ For information on some of the other currently available MCP servers, see [the M

To configure MCP servers in {% data variables.product.prodname_vscode %}, you need to set up a configuration script that specifies the details of the MCP servers you want to use. You can configure MCP servers for either:

* **A specific repository**. This will share MCP servers with anyone who opens the project in {% data variables.product.prodname_vscode %}. To do this, create a `.vscode/mcp.json` file in the root of your repository.
* **Your personal instance of {% data variables.product.prodname_vscode %}**. You will be the only person who has access to configured MCP servers. To do this, add the configuration to your `settings.json` file in {% data variables.product.prodname_vscode %}.
{% data reusables.copilot.mcp.mcp-configuration-location %}

>[!NOTE] We recommend you use only one location per server. Adding the same server to both locations may cause conflicts and unexpected behavior.

The steps below show how to configure the Fetch MCP server in your `.vscode/mcp.json` file. The Fetch MCP server is a simple MCP server that provides web content fetching capabilities. For more information on the Fetch MCP server, see [the Fetch directory](https://github.com/modelcontextprotocol/servers/tree/main/src/fetch) in the MCP Server repository.

You can use the same steps to configure MCP servers in your personal {% data variables.product.prodname_vscode %} settings. Details on how to configure other MCP servers are available in the [MCP servers repository](https://github.com/modelcontextprotocol/servers/tree/main).

For information on configuring the {% data variables.product.github %} MCP server, see [AUTOTITLE](/copilot/customizing-copilot/using-model-context-protocol/using-the-github-mcp-server).

1. Add the following configuration to your `.vscode/mcp.json` file:

```json copy
Expand Down Expand Up @@ -79,14 +82,12 @@ You can use the same steps to configure MCP servers in your personal {% data var

For more information on configuring MCP servers in {% data variables.product.prodname_vscode %}, see [Use MCP servers in {% data variables.product.prodname_vscode %} (Preview)](https://aka.ms/vscode-add-mcp) in the {% data variables.product.prodname_vscode %} documentation.

>[!IMPORTANT] Beginning April 4, 2025, the {% data variables.product.github %} MCP server, and installation instructions, will be publicly available in the [github-mcp-server](https://github.com/github/github-mcp-server) repository.

## Using MCP servers in {% data variables.copilot.copilot_chat_short %}

Once you have configured your MCP servers, you can use them in {% data variables.copilot.copilot_chat_short %} to access a wide range of tools and services. In the example below, we will use the Fetch MCP server to fetch details about a web page.

1. Open {% data variables.copilot.copilot_chat_short %} by clicking the {% octicon "copilot" aria-hidden="true" aria-label="copilot" %} icon in the title bar of {% data variables.product.prodname_vscode %}.
1. In the {% data variables.copilot.copilot_chat_short %} box, select **Agent** from the popup menu.
{% data reusables.copilot.open-chat-vs-code %}
{% data reusables.copilot.select-agent %}
1. In the file with the MCP configuration, check that the MCP server is running. If it is not running, click the "Start" button to start the MCP server.

![Screenshot of the MCP server configuration in {% data variables.product.prodname_vscode %}. The "Running" status is outlined in dark orange.](/assets/images/help/copilot/vsc-mcp-server-running.png)
Expand Down Expand Up @@ -200,3 +201,4 @@ For more information on creating and configuring your own MCP servers, see [the
## Further reading

* [AUTOTITLE](/copilot/customizing-copilot/extending-copilot-coding-agent-with-mcp)
* [AUTOTITLE](/copilot/customizing-copilot/using-model-context-protocol/using-the-github-mcp-server)
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ topics:
- Copilot
type: how_to
redirect_from:
- /copilot/customizing-copilot/extending-copilot-coding-agent-with-mcp
- /early-access/copilot/coding-agent/extending-copilot-coding-agent-with-model-context-protocol
---

Expand Down Expand Up @@ -276,6 +277,8 @@ If you want to allow {% data variables.product.prodname_copilot_short %} to acce
1. Under "Environment secrets", click **Add environment secret**.
1. Call the secret `COPILOT_MCP_GITHUB_PERSONAL_ACCESS_TOKEN`, enter your {% data variables.product.pat_generic %} in the "Value" field, then click **Add secret**.

For information on using the {% data variables.product.github %} MCP server in other environments, see [AUTOTITLE](/copilot/customizing-copilot/using-model-context-protocol/using-the-github-mcp-server).

## Best practices

* Enabling third-party MCP servers for use may impact the performance of the agent and the quality of the outputs. Review the third-party MCP server thoroughly and ensure that it meets your organization’s requirements.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
title: Using Model Context Protocol
shortTitle: Use MCP
intro: 'Model Context Protocol (MCP) is a protocol that allows you to extend the capabilities of {% data variables.product.prodname_copilot %} by integrating it with other systems.'
versions:
feature: copilot
topics:
- Copilot
children:
- /extending-copilot-chat-with-mcp
- /using-the-github-mcp-server
- /extending-copilot-coding-agent-with-mcp
---
Original file line number Diff line number Diff line change
@@ -0,0 +1,199 @@
---
title: Using the GitHub MCP Server
intro: "Learn how to use the GitHub Model Context Protocol (MCP) server to extend {% data variables.copilot.copilot_chat_short %}."
shortTitle: Use the GitHub MCP Server
versions:
feature: copilot
topics:
- Copilot
type: how_to
---

>[!NOTE]
> The {% data variables.product.github %} MCP server is currently in {% data variables.release-phases.public_preview %} and subject to change.

{% data reusables.copilot.mcp.about-github-mcp-server %}

## Setting up the {% data variables.product.github %} MCP server in {% data variables.product.prodname_vscode %}

The instructions below guide you through setting up the {% data variables.product.github %} MCP server in {% data variables.product.prodname_vscode %}. Other MCP-compatible editors may have similar steps, but the exact process may vary.

You can choose to set up the {% data variables.product.github %} MCP server either remotely or locally, depending on your needs and preferences. You can also configure your {% data variables.product.github %} MCP server for either:

{% data reusables.copilot.mcp.mcp-configuration-location %}

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 will have the same access as your personal account. If you use a PAT, the MCP server will have access to the scopes granted by the PAT.

> [!NOTE]
> If you are an {% data variables.product.prodname_emu %} with PAT restrictions, you won't be able to use PAT authentication. If you have OAuth access policy restrictions, you will need the OAuth apps for each client to be enabled (except {% data variables.product.prodname_vscode %} and {% data variables.product.prodname_vs %}).

* [Remote MCP server configuration with OAuth](#remote-mcp-server-configuration-with-oauth)
* [Remote MCP server configuration with PAT](#remote-mcp-server-configuration-with-pat)
* [Local MCP server setup](#local-mcp-server-setup)

### Remote MCP server configuration with OAuth

> [!NOTE]
> The remote {% data variables.product.github %} MCP server is not available to {% data variables.product.prodname_ghe_server %} users. If you are using {% data variables.product.prodname_ghe_server %}, you can install the {% data variables.product.github %} MCP server locally. See [Local MCP server setup](#local-mcp-server-setup).

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_vscode %}. You can also install individual toolsets, either in read-only mode or with full read/write access, allowing you to tailor the server's capabilities to your specific needs. For more information, see [Tool configuration](#tool-configuration).

1. In {% data variables.product.prodname_vscode %}, open the command palette by pressing <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>P</kbd> (Windows/Linux) / <kbd>Command</kbd>+<kbd>Shift</kbd>+<kbd>P</kbd> (Mac).
1. Type: `mcp: add server` and then press **Enter**.
1. From the list, select **HTTP (HTTP or Server-Sent Events)**.
1. In the **Server URL** field, enter `https://api.githubcopilot.com/mcp/`, and press **Enter**.
1. Under **Enter Server ID**, press **Enter** to use the default server ID, or enter a custom server ID.
1. Under **Choose where to save the configuration**, select where you want to save the MCP server configuration.

* {% data variables.product.prodname_vscode %} will open and add the configuration to the selected file in the editor, or create a new file if it doesn't exist.

1. In the **{% data variables.product.prodname_vscode %}** popup, to authorize the MCP server with OAuth, click **Allow** and select your personal account from the list.

### 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](/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token).

You will need to manually configure the MCP server in {% data variables.product.prodname_vscode %} to use the PAT for authorization.

1. In {% data variables.product.prodname_vscode %}, open the command palette by pressing <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>P</kbd> (Windows/Linux) / <kbd>Command</kbd>+<kbd>Shift</kbd>+<kbd>P</kbd> (Mac).
1. Type: `mcp: add server` and then press **Enter**.
1. From the list, select **HTTP (HTTP or Server-Sent Events)**.
1. In the **Server URL** field, enter `https://api.githubcopilot.com/mcp/`, and press **Enter**.
1. Under **Enter Server ID**, press **Enter** to use the default server ID, or enter a custom server ID.
1. Under **Choose where to save the configuration**, select where you want to save the MCP server configuration.

* {% data variables.product.prodname_vscode %} will open and add the configuration to the selected file in the editor, or create a new file if it doesn't exist.

1. In the **{% data variables.product.prodname_vscode %}** popup, to decline OAuth authorization, click **Cancel**.
1. You will need to manually edit the configuration file to use a PAT. In the configuration file, at the end of the `url` line, add the following:

```json copy
,
"headers": {
"Authorization": "Bearer ${input:github_token}"
}
},
},
"inputs": [
{
"id": "github_token",
"type": "promptString",
"description": "{% data variables.product.github %} {% data variables.product.pat_generic_title_case %}",
"password": true
}
]
}
```

1. A "Restart" button will appear in the file. Click "Restart" to restart the MCP server with the new configuration.

![Screenshot of the MCP server restart button in the configuration file. The "Restart" button is outlined in dark orange.](/assets/images/help/copilot/vsc-mcp-server-restart.png)

1. In the command palette, you will see a prompt to enter your GitHub token. Enter the PAT you created earlier, and press **Enter**.
* The MCP server will now be configured to use the PAT for authorization.

### Local MCP server setup

>[!NOTE]
> If you are a {% data variables.product.prodname_ghe_server %} user, and your enterprise has PAT restrictions enabled, you can only use API endpoints for scopes that are allowed by your enterprise's PAT policy. If all API endpoints are restricted, you will not be able to use the MCP server. If you are unsure about your enterprise's PAT policy, contact your enterprise administrator for more information.

Using the {% data variables.product.github %} MCP server locally requires you to have Docker installed and running on your machine. Additionally, you can only authenticate with a PAT, as OAuth is not supported for local MCP servers.

1. Ensure you have Docker installed and running on your machine. See [Docker installation instructions](https://docs.docker.com/get-docker/).
1. Create a PAT with (at least) the `read:packages` and `repo` scopes. For more information, see [AUTOTITLE](/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token).
1. Decide whether you want to configure the MCP server for a specific repository or for your personal instance of {% data variables.product.prodname_vscode %}.

* If you are using a specific repository, open the `.vscode/mcp.json` file in {% data variables.product.prodname_vscode %}, and add the following configuration:

```json copy
{
"inputs": [
{
"type": "promptString",
"id": "github_token",
"description": "{% data variables.product.github %} {% data variables.product.pat_generic_title_case %}",
"password": true
}
],
"servers": {
"github": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"GITHUB_PERSONAL_ACCESS_TOKEN",
"ghcr.io/github/github-mcp-server"
],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "${input:github_token}"
}
}
}
}
```

* If you are using your personal instance of {% data variables.product.prodname_vscode %}, open your `settings.json` file in {% data variables.product.prodname_vscode %}:
* Press <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>P</kbd> (Windows/Linux) or <kbd>Cmd</kbd>+<kbd>Shift</kbd>+<kbd>P</kbd> (macOS).
* Type **Preferences: Open Settings (JSON)** and select it.
* Add the following configuration:

```json copy
{
"mcp": {
"inputs": [
{
"type": "promptString",
"id": "github_token",
"description": "{% data variables.product.github %} {% data variables.product.pat_generic_title_case %}",
"password": true
}
],
"servers": {
"github": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"GITHUB_PERSONAL_ACCESS_TOKEN",
"ghcr.io/github/github-mcp-server"
],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "${input:github_token}"
}
}
}
}
}
```

1. Save the file.
1. In the command palette, you will see a prompt to enter your {% data variables.product.github %} token. Enter the PAT you created earlier, and press **Enter**.
* The MCP server will now be configured to run locally with the PAT for authorization.

## Tool configuration

The {% data variables.product.github %} MCP server supports installing individual toolsets, either in read-only mode or with full read/write access, allowing you to tailor the server's capabilities to your specific needs. For one-click installation options of each toolset, see the [GitHub MCP server repository](https://github.com/github/github-mcp-server/blob/main/docs/remote-server.md).

## Using the {% data variables.product.github %} MCP server in {% data variables.product.prodname_vscode %}

The {% data variables.product.github %} MCP server enables you to perform a wide range of actions on {% data variables.product.github %}, via {% data variables.copilot.copilot_chat_short %} in {% data variables.product.prodname_vscode %}.

{% data reusables.copilot.open-chat-vs-code %}
{% data reusables.copilot.select-agent %}
1. To see the available actions, in the {% data variables.copilot.copilot_chat_short %} box, click the **Select tools** icon.
* In the **Tools** dropdown, under **MCP Server:{% data variables.product.github %}**, you will see a list of available actions.
1. In the {% data variables.copilot.copilot_chat_short %} box, type a command or question related to the action you want to perform, and press **Enter**.
* For example, you can ask the {% data variables.product.github %} MCP server to create a new issue, list pull requests, or retrieve repository information.
1. The {% data variables.product.github %} MCP server will process your request and provide a response in the chat interface.
* In the {% data variables.copilot.copilot_chat_short %} box, you may be asked to give additional permissions or provide more information to complete the action.
1. Follow the prompts to complete the action.

{% data reusables.copilot.mcp.troubleshooting-mcp-server %}

## Further reading

* [AUTOTITLE](/copilot/customizing-copilot/using-model-context-protocol/extending-copilot-coding-agent-with-mcp)
Loading
Loading