updating mcp docs (#58153)
Co-authored-by: Joe Clark <31087804+jc-clark@users.noreply.github.com>
This commit is contained in:
@@ -46,6 +46,14 @@ To learn how to configure and use MCP servers with {% data variables.copilot.cop
|
||||
|
||||
{% data reusables.copilot.mcp.mcp-policy %}
|
||||
|
||||
## Availability
|
||||
|
||||
There is currently broad support for local MCP servers in clients such as {% data variables.product.prodname_vscode %}, JetBrains IDEs, XCode, and others.
|
||||
|
||||
Support for remote MCP servers is growing, with editors like {% data variables.product.prodname_vscode %}, {% data variables.product.prodname_vs %}, JetBrains IDEs, Xcode, Eclipse, and Cursor providing this functionality with OAuth or PAT, and Windsurf supporting PAT only.
|
||||
|
||||
To find out if your preferred editor supports remote MCP servers, check the documentation for your specific editor.
|
||||
|
||||
## About the {% data variables.product.github %} MCP server
|
||||
|
||||
The {% data variables.product.github %} MCP server is a Model Context Protocol (MCP) server provided and maintained by {% data variables.product.github %}.
|
||||
@@ -57,16 +65,31 @@ The {% data variables.product.github %} MCP server is a Model Context Protocol (
|
||||
* Enable cloud-based workflows that work from any device, without local setup.
|
||||
* Invoke {% data variables.product.github %} tools, such as {% data variables.copilot.copilot_coding_agent %} (requires {% data variables.product.prodname_copilot %} subscription) and {% data variables.product.prodname_code_scanning %} (requires {% data variables.product.prodname_GHAS %} subscription), to assist with code generation and security analysis.
|
||||
|
||||
For all public repositories, and private repositories covered by {% data variables.product.prodname_GHAS %}, interactions with the {% data variables.product.github %} MCP server are secured by push protection, which blocks secrets from being included in AI-generated responses and prevents you from exposing secrets through any actions you perform using the server, such as creating an issue. See [AUTOTITLE](/code-security/secret-scanning/working-with-secret-scanning-and-push-protection/working-with-push-protection-and-the-github-mcp-server).
|
||||
|
||||
You can access the {% data variables.product.github %} MCP server remotely through {% data variables.copilot.copilot_chat_short %} in {% data variables.product.github %}, {% data variables.product.prodname_vscode %}, or other editors that support remote MCP; or you can run it locally in any MCP-compatible editor, allowing you to choose between the convenience of a hosted solution or the customizability of a self-hosted setup.
|
||||
|
||||
If you want to utilize the remote {% data variables.product.github %} MCP server, you can do so in a few steps, without any local setup. This is particularly useful for users who want to quickly leverage {% data variables.product.github %}’s AI capabilities without the overhead of managing a local MCP server.
|
||||
|
||||
Running the {% data variables.product.github %} MCP server locally requires a bit more setup, but it allows for greater customization and control over your AI interactions.
|
||||
|
||||
To learn how to set up and use the {% data variables.product.github %} MCP server, see [AUTOTITLE](/copilot/how-tos/context/model-context-protocol/using-the-github-mcp-server).
|
||||
|
||||
### Remote access
|
||||
|
||||
You can access the {% data variables.product.github %} MCP server remotely through {% data variables.copilot.copilot_chat_short %} in {% data variables.product.prodname_vscode %} without any local setup. The remote server has access to additional toolsets only available in the remote {% data variables.product.github %} MCP server. For a list of such tools, see [Additional toolsets](https://github.com/github/github-mcp-server?tab=readme-ov-file#additional-toolsets-in-remote-github-mcp-server) in the `github/github-mcp-server` repository.
|
||||
|
||||
The {% data variables.product.github %} MCP server can also run locally in any MCP-compatible editor, if necessary.
|
||||
|
||||
### Toolset customization
|
||||
|
||||
> [!IMPORTANT]
|
||||
> Always review the {% data variables.product.github %} MCP server repository at [github/github-mcp-server](https://github.com/github/github-mcp-server) for the latest toolsets and authoritative configuration guidance.
|
||||
|
||||
The {% data variables.product.github %} MCP server supports enabling or disabling specific groups of functionalities via toolsets. Toolsets allow you to control which {% data variables.product.github %} API capabilities are available to your AI tools.
|
||||
|
||||
Enabling only the toolsets you need improves your AI assistant's performance and security. Fewer tools means better tool selection accuracy and fewer errors. Disabling unused toolsets also frees up tokens in the AI's context window.
|
||||
|
||||
Toolsets do not only include tools, but also relevant MCP resources and prompts where applicable.
|
||||
|
||||
To learn how to configure toolsets for the {% data variables.product.github %} MCP server, see [AUTOTITLE](/copilot/how-tos/context/use-mcp/configure-toolsets).
|
||||
|
||||
### Security
|
||||
|
||||
For all public repositories, and private repositories covered by {% data variables.product.prodname_GHAS %}, interactions with the {% data variables.product.github %} MCP server are secured by push protection, which blocks secrets from being included in AI-generated responses and prevents you from exposing secrets through any actions you perform using the server, such as creating an issue. For more information, see [AUTOTITLE](/code-security/secret-scanning/working-with-secret-scanning-and-push-protection/working-with-push-protection-and-the-github-mcp-server).
|
||||
|
||||
## About the {% data variables.product.github %} MCP Registry
|
||||
|
||||
The {% data variables.product.github %} MCP Registry is a curated list of MCP servers from partners and the community. You can use the registry to discover new MCP servers and find ones that meet your specific needs. See [the {% data variables.product.github %} MCP Registry](https://github.com/mcp).
|
||||
@@ -74,14 +97,6 @@ The {% data variables.product.github %} MCP Registry is a curated list of MCP se
|
||||
>[!NOTE]
|
||||
> The {% data variables.product.github %} MCP Registry is currently in {% data variables.release-phases.public_preview %} and subject to change.
|
||||
|
||||
## Availability
|
||||
|
||||
There is currently broad support for local MCP servers in clients such as {% data variables.product.prodname_vscode %}, JetBrains IDEs, XCode, and others.
|
||||
|
||||
Support for remote MCP servers is growing, with editors like {% data variables.product.prodname_vscode %}, {% data variables.product.prodname_vs %}, JetBrains IDEs, Xcode, Eclipse, and Cursor providing this functionality with OAuth or PAT, and Windsurf supporting PAT only.
|
||||
|
||||
To find out if your preferred editor supports remote MCP servers, check the documentation for your specific editor.
|
||||
|
||||
## Next steps
|
||||
|
||||
* [AUTOTITLE](/copilot/how-tos/context/model-context-protocol/extending-copilot-chat-with-mcp)
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
---
|
||||
title: Configuring toolsets for the GitHub MCP Server
|
||||
intro: 'Learn how to configure toolsets and tools for the {% data variables.product.github %} MCP server for fine-grained control and optimized performance.'
|
||||
shortTitle: Configure toolsets
|
||||
versions:
|
||||
feature: copilot
|
||||
defaultTool: vscode
|
||||
topics:
|
||||
- Copilot
|
||||
redirect_from:
|
||||
- /copilot/how-tos/context/use-mcp/configure-toolsets
|
||||
contentType: how-tos
|
||||
---
|
||||
|
||||
The {% data variables.product.github %} MCP server includes default toolsets (`repos`, `issues`, and `pull_requests`) that are enabled automatically. You can customize toolset configuration by:
|
||||
|
||||
* **Enabling individual toolsets** such as `actions`, `code_security`, or `secret_protection`
|
||||
* **Using special keywords** like `all` to enable every available toolset, or [`default`](https://github.com/github/github-mcp-server?tab=readme-ov-file#default-toolset) to include the standard set alongside others (for example, `default,stargazers`)
|
||||
* **Accessing remote-only toolsets** such as `copilot` (for {% data variables.copilot.copilot_coding_agent %}) and `github_support_docs_search`, which are only available on the remote MCP server
|
||||
* **Selecting specific tools** for granular control when you want to exclude specific tools or combine toolsets with individual tools
|
||||
|
||||
For a complete list of available toolsets, see [Tools](https://github.com/github/github-mcp-server/blob/main/README.md#tools) in the `github/github-mcp-server` repository. For configuration examples, see [Server configuration](https://github.com/github/github-mcp-server/blob/main/docs/server-configuration.md). For a full introduction to the {% data variables.product.github %} MCP server and an overview of MCP, see [AUTOTITLE](/copilot/concepts/context/mcp).
|
||||
|
||||
## Configuring toolsets for the remote MCP server
|
||||
|
||||
You can configure toolsets for the remote {% data variables.product.github %} MCP server using:
|
||||
|
||||
* **URL path parameters** when enabling a single toolset
|
||||
* **HTTP headers** when enabling multiple toolsets
|
||||
|
||||
For detailed setup instructions, see [Remote {% data variables.product.github %} MCP server](https://github.com/github/github-mcp-server?tab=readme-ov-file#remote-github-mcp-server) and [Remote server configuration](https://github.com/github/github-mcp-server/blob/main/docs/remote-server.md) in the `github/github-mcp-server` repository.
|
||||
|
||||
## Configuring toolsets for the local MCP server
|
||||
|
||||
You can configure toolsets for the local {% data variables.product.github %} MCP server using:
|
||||
|
||||
* **Command-line flags**
|
||||
* **Environment variables** (these take precedence over command-line flags)
|
||||
|
||||
For detailed setup instructions, see [Local {% data variables.product.github %} MCP server](https://github.com/github/github-mcp-server?tab=readme-ov-file#local-github-mcp-server) and [Tool configuration](https://github.com/github/github-mcp-server?tab=readme-ov-file#tool-configuration) in the `github/github-mcp-server` repository.
|
||||
|
||||
## Further reading
|
||||
|
||||
* [AUTOTITLE](/copilot/how-tos/provide-context/use-mcp/set-up-the-github-mcp-server)
|
||||
* [AUTOTITLE](/copilot/how-tos/provide-context/use-mcp/use-the-github-mcp-server)
|
||||
* [AUTOTITLE](/copilot/how-tos/provide-context/use-mcp/configure-toolsets)
|
||||
@@ -0,0 +1,648 @@
|
||||
---
|
||||
title: Configuring the GitHub MCP Server for GitHub Enterprise
|
||||
intro: 'Learn how to configure the GitHub Model Context Protocol (MCP) server to work with {% data variables.product.prodname_ghe_server %} or {% data variables.enterprise.data_residency %}.'
|
||||
shortTitle: Enterprise configuration
|
||||
versions:
|
||||
feature: copilot
|
||||
defaultTool: vscode
|
||||
topics:
|
||||
- Copilot
|
||||
contentType: how-tos
|
||||
---
|
||||
|
||||
The {% data variables.product.github %} MCP server can be configured to work with {% data variables.product.prodname_ghe_server %} and {% data variables.enterprise.data_residency %}. The configuration steps differ depending on whether you are using the remote or local MCP server.
|
||||
|
||||
## About enterprise MCP server configuration
|
||||
|
||||
The {% data variables.product.github %} MCP server supports two enterprise deployment types:
|
||||
|
||||
* **[{% data variables.enterprise.data_residency %}](#configuring-the-remote-mcp-server-for-github-enterprise-cloud-with-data-residency)**: Supports both remote and local MCP server configurations
|
||||
* **[{% data variables.product.prodname_ghe_server %}](#configuring-the-local-mcp-server-for-enterprise)**: Supports **only local MCP server configuration**
|
||||
|
||||
> [!IMPORTANT]
|
||||
> {% data variables.product.prodname_ghe_server %} does **not** support remote MCP server hosting. If you are using {% data variables.product.prodname_ghe_server %}, you **must** use the local MCP server configuration described in [Configuring the local MCP server for enterprise](#configuring-the-local-mcp-server-for-enterprise). Skip the remote MCP server configuration section below.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
* A {% data variables.product.prodname_ghe_server %} instance or {% data variables.product.prodname_ghe_cloud %} account with {% data variables.enterprise.data_residency_short %}
|
||||
* The {% data variables.product.github %} MCP server configured in your editor. See [AUTOTITLE](/copilot/how-tos/provide-context/use-mcp/set-up-the-github-mcp-server).
|
||||
|
||||
## Configuring the remote MCP server for {% data variables.enterprise.data_residency %}
|
||||
|
||||
> [!NOTE]
|
||||
> This section applies **only** to {% data variables.enterprise.data_residency %}. If you are using {% data variables.product.prodname_ghe_server %}, skip to [Configuring the local MCP server for enterprise](#configuring-the-local-mcp-server-for-enterprise).
|
||||
|
||||
{% vscode %}
|
||||
|
||||
{% data variables.enterprise.data_residency %} can use the remote MCP server. To configure it, you need to update the MCP server URL to point to your {% data variables.product.prodname_ghe_cloud %} instance.
|
||||
|
||||
For example, if your {% data variables.product.prodname_ghe_cloud %} instance is `https://octocorp.ghe.com`, the MCP server URL would be `https://copilot-api.octocorp.ghe.com/mcp`.
|
||||
|
||||
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 and select **MCP: Open User Configuration**.
|
||||
1. In the settings file, locate the `servers` section. If you have already configured the {% data variables.product.github %} MCP server, you will see a `github` entry.
|
||||
1. Update the `url` field to point to your {% data variables.product.prodname_ghe_cloud %} instance.
|
||||
|
||||
**Option A: With PAT authentication**
|
||||
|
||||
```json copy
|
||||
{
|
||||
"servers": {
|
||||
"github": {
|
||||
"type": "http",
|
||||
"url": "https://copilot-api.{% data variables.enterprise.data_residency_domain %}/mcp",
|
||||
"headers": {
|
||||
"Authorization": "Bearer ${input:github_mcp_pat}"
|
||||
}
|
||||
}
|
||||
},
|
||||
"inputs": [
|
||||
{
|
||||
"type": "promptString",
|
||||
"id": "github_mcp_pat",
|
||||
"description": "GitHub PAT",
|
||||
"password": true
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
**Option B: With OAuth authentication**
|
||||
|
||||
```json copy
|
||||
{
|
||||
"servers": {
|
||||
"github": {
|
||||
"type": "http",
|
||||
"url": "https://copilot-api.{% data variables.enterprise.data_residency_domain %}/mcp"
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Replace `{% data variables.enterprise.data_residency_domain %}` with your {% data variables.enterprise.data_residency_site %} subdomain.
|
||||
|
||||
1. Save the file.
|
||||
1. When using OAuth with {% data variables.enterprise.data_residency %}, configure your {% data variables.product.prodname_vscode_shortname %} settings to point to your {% data variables.product.prodname_ghe_cloud %} instance. Add the following to your [{% data variables.product.prodname_vscode_shortname %} user settings](https://code.visualstudio.com/docs/configure/settings#_user-settings):
|
||||
|
||||
```json
|
||||
{
|
||||
"github-enterprise.uri": "https://copilot-api.{% data variables.enterprise.data_residency_domain %}/mcp"
|
||||
}
|
||||
```
|
||||
|
||||
1. Restart {% data variables.product.prodname_vscode %} or reload the window for the changes to take effect.
|
||||
|
||||
{% endvscode %}
|
||||
|
||||
{% visualstudio %}
|
||||
|
||||
{% data variables.product.prodname_ghe_cloud %} with data residency can use the remote MCP server. To configure it, you need to update the MCP server URL to point to your {% data variables.product.prodname_ghe_cloud %} instance.
|
||||
|
||||
For example, if your {% data variables.product.prodname_ghe_cloud %} instance is `https://octocorp.ghe.com`, the MCP server URL would be `https://copilot-api.octocorp.ghe.com/mcp`.
|
||||
|
||||
1. In the {% data variables.product.prodname_vs %} menu bar, click **View**, then click **{% data variables.copilot.copilot_chat %}**.
|
||||
1. At the bottom of the chat panel, select **Agent** from the mode dropdown.
|
||||
1. In the {% data variables.copilot.copilot_chat_short %} window, click the tools icon, then click the plus icon in the tool picker window.
|
||||
1. In the "Configure MCP server" pop-up window, fill out the fields.
|
||||
1. For "Server ID", type `github`.
|
||||
1. For "Type", select "HTTP/SSE" from the dropdown.
|
||||
1. For "URL", type `https://copilot-api.YOURSUBDOMAIN.ghe.com/mcp`, replacing `YOURSUBDOMAIN` with your {% data variables.product.prodname_ghe_cloud %} subdomain.
|
||||
1. Add a new header under "Headers", called "Authorization" and set to the value `Bearer YOUR_GITHUB_PAT`, replacing "YOUR_GITHUB_PAT" with your {% data variables.product.pat_generic %}.
|
||||
1. Click **Save**.
|
||||
|
||||
{% endvisualstudio %}
|
||||
|
||||
{% jetbrains %}
|
||||
|
||||
{% data variables.product.prodname_ghe_cloud %} with data residency can use the remote MCP server. To configure it, you need to update the MCP server URL to point to your {% data variables.product.prodname_ghe_cloud %} instance.
|
||||
|
||||
For example, if your {% data variables.product.prodname_ghe_cloud %} instance is `https://octocorp.ghe.com`, the MCP server URL would be `https://copilot-api.octocorp.ghe.com/mcp`.
|
||||
|
||||
{% data reusables.copilot.jetbrains-mcp-setup-steps %}
|
||||
1. In the `mcp.json` file, add the following configuration, replacing `YOURSUBDOMAIN` with your {% data variables.product.prodname_ghe_cloud %} subdomain and `YOUR_GITHUB_PAT` with your {% data variables.product.pat_generic %}:
|
||||
|
||||
```json copy
|
||||
{
|
||||
"servers": {
|
||||
"github": {
|
||||
"url": "https://copilot-api.YOURSUBDOMAIN.ghe.com/mcp",
|
||||
"requestInit": {
|
||||
"headers": {
|
||||
"Authorization": "Bearer YOUR_GITHUB_PAT"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
{% endjetbrains %}
|
||||
|
||||
{% xcode %}
|
||||
|
||||
{% data variables.product.prodname_ghe_cloud %} with data residency can use the remote MCP server. To configure it, you need to update the MCP server URL to point to your {% data variables.product.prodname_ghe_cloud %} instance.
|
||||
|
||||
For example, if your {% data variables.product.prodname_ghe_cloud %} instance is `https://octocorp.ghe.com`, the MCP server URL would be `https://copilot-api.octocorp.ghe.com/mcp`.
|
||||
|
||||
{% data reusables.copilot.xcode-mcp-setup-steps %}
|
||||
1. Add the following configuration, replacing `YOURSUBDOMAIN` with your {% data variables.product.prodname_ghe_cloud %} subdomain and `YOUR_GITHUB_PAT` with your {% data variables.product.pat_generic %}:
|
||||
|
||||
```json copy
|
||||
{
|
||||
"servers": {
|
||||
"github": {
|
||||
"url": "https://copilot-api.YOURSUBDOMAIN.ghe.com/mcp",
|
||||
"requestInit": {
|
||||
"headers": {
|
||||
"Authorization": "Bearer YOUR_GITHUB_PAT"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
{% endxcode %}
|
||||
|
||||
{% eclipse %}
|
||||
|
||||
{% data variables.product.prodname_ghe_cloud %} with data residency can use the remote MCP server. To configure it, you need to update the MCP server URL to point to your {% data variables.product.prodname_ghe_cloud %} instance.
|
||||
|
||||
For example, if your {% data variables.product.prodname_ghe_cloud %} instance is `https://octocorp.ghe.com`, the MCP server URL would be `https://copilot-api.octocorp.ghe.com/mcp`.
|
||||
|
||||
{% data reusables.copilot.eclipse-mcp-setup-steps %}
|
||||
1. Add the following configuration under "Server Configurations", replacing `YOURSUBDOMAIN` with your {% data variables.product.prodname_ghe_cloud %} subdomain and `YOUR_GITHUB_PAT` with your {% data variables.product.pat_generic %}:
|
||||
|
||||
```json copy
|
||||
{
|
||||
"servers": {
|
||||
"github": {
|
||||
"url": "https://copilot-api.YOURSUBDOMAIN.ghe.com/mcp",
|
||||
"requestInit": {
|
||||
"headers": {
|
||||
"Authorization": "Bearer YOUR_GITHUB_PAT"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
1. Click **Apply**.
|
||||
|
||||
{% endeclipse %}
|
||||
|
||||
## Configuring the local MCP server for enterprise
|
||||
|
||||
Both {% data variables.product.prodname_ghe_server %} and {% data variables.product.prodname_ghe_cloud %} with data residency support the local MCP server. You can configure the local server using either the `GITHUB_HOST` environment variable or the `--gh-host` command-line flag.
|
||||
|
||||
### Important considerations
|
||||
|
||||
* **For {% data variables.product.prodname_ghe_server %}**: Prefix the hostname with the `https://` URI scheme, as it otherwise defaults to `http://`, which {% data variables.product.prodname_ghe_server %} does not support.
|
||||
* **For {% data variables.product.prodname_ghe_cloud %} with data residency**: Use `https://YOURSUBDOMAIN.ghe.com` as the hostname.
|
||||
|
||||
### Configuration with Docker
|
||||
|
||||
{% vscode %}
|
||||
|
||||
To configure the local MCP server with Docker in {% data variables.product.prodname_vscode %}:
|
||||
|
||||
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 and select **MCP: Open User Configuration**.
|
||||
1. In the settings file, locate the `servers` section or create it if it doesn't exist.
|
||||
1. Add the following configuration:
|
||||
|
||||
**For {% data variables.product.prodname_ghe_server %}:**
|
||||
|
||||
```json copy
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"type": "promptString",
|
||||
"id": "github_token",
|
||||
"description": "GitHub PAT",
|
||||
"password": true
|
||||
}
|
||||
],
|
||||
"servers": {
|
||||
"github": {
|
||||
"command": "docker",
|
||||
"args": [
|
||||
"run",
|
||||
"-i",
|
||||
"--rm",
|
||||
"-e",
|
||||
"GITHUB_PERSONAL_ACCESS_TOKEN",
|
||||
"-e",
|
||||
"GITHUB_HOST",
|
||||
"ghcr.io/github/github-mcp-server"
|
||||
],
|
||||
"env": {
|
||||
"GITHUB_PERSONAL_ACCESS_TOKEN": "${input:github_token}",
|
||||
"GITHUB_HOST": "https://YOUR_GHES_HOSTNAME"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Replace `YOUR_GHES_HOSTNAME` with your {% data variables.product.prodname_ghe_server %} hostname (for example, `https://github.example.com`).
|
||||
|
||||
**For {% data variables.product.prodname_ghe_cloud %} with data residency:**
|
||||
|
||||
```json copy
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"type": "promptString",
|
||||
"id": "github_token",
|
||||
"description": "GitHub PAT",
|
||||
"password": true
|
||||
}
|
||||
],
|
||||
"servers": {
|
||||
"github": {
|
||||
"command": "docker",
|
||||
"args": [
|
||||
"run",
|
||||
"-i",
|
||||
"--rm",
|
||||
"-e",
|
||||
"GITHUB_PERSONAL_ACCESS_TOKEN",
|
||||
"-e",
|
||||
"GITHUB_HOST",
|
||||
"ghcr.io/github/github-mcp-server"
|
||||
],
|
||||
"env": {
|
||||
"GITHUB_PERSONAL_ACCESS_TOKEN": "${input:github_token}",
|
||||
"GITHUB_HOST": "https://YOURSUBDOMAIN.ghe.com"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Replace `YOURSUBDOMAIN` with your {% data variables.product.prodname_ghe_cloud %} subdomain.
|
||||
|
||||
1. Save the file.
|
||||
1. Restart {% data variables.product.prodname_vscode %} or reload the window for the changes to take effect.
|
||||
|
||||
{% endvscode %}
|
||||
|
||||
{% visualstudio %}
|
||||
|
||||
To configure the local MCP server with Docker in {% data variables.product.prodname_vs %}, you need to manually edit the `mcp.json` file.
|
||||
|
||||
1. Open the `mcp.json` file in {% data variables.product.prodname_vs %}. The file is typically located in your user profile directory.
|
||||
1. Add the following configuration:
|
||||
|
||||
**For {% data variables.product.prodname_ghe_server %}:**
|
||||
|
||||
```json copy
|
||||
{
|
||||
"mcp": {
|
||||
"inputs": [
|
||||
{
|
||||
"type": "promptString",
|
||||
"id": "github_token",
|
||||
"description": "GitHub PAT",
|
||||
"password": true
|
||||
}
|
||||
],
|
||||
"servers": {
|
||||
"github": {
|
||||
"command": "docker",
|
||||
"args": [
|
||||
"run",
|
||||
"-i",
|
||||
"--rm",
|
||||
"-e",
|
||||
"GITHUB_PERSONAL_ACCESS_TOKEN",
|
||||
"-e",
|
||||
"GITHUB_HOST",
|
||||
"ghcr.io/github/github-mcp-server"
|
||||
],
|
||||
"env": {
|
||||
"GITHUB_PERSONAL_ACCESS_TOKEN": "${input:github_token}",
|
||||
"GITHUB_HOST": "https://YOUR_GHES_HOSTNAME"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Replace `YOUR_GHES_HOSTNAME` with your {% data variables.product.prodname_ghe_server %} hostname (for example, `https://github.example.com`).
|
||||
|
||||
**For {% data variables.product.prodname_ghe_cloud %} with data residency:**
|
||||
|
||||
```json copy
|
||||
{
|
||||
"mcp": {
|
||||
"inputs": [
|
||||
{
|
||||
"type": "promptString",
|
||||
"id": "github_token",
|
||||
"description": "GitHub PAT",
|
||||
"password": true
|
||||
}
|
||||
],
|
||||
"servers": {
|
||||
"github": {
|
||||
"command": "docker",
|
||||
"args": [
|
||||
"run",
|
||||
"-i",
|
||||
"--rm",
|
||||
"-e",
|
||||
"GITHUB_PERSONAL_ACCESS_TOKEN",
|
||||
"-e",
|
||||
"GITHUB_HOST",
|
||||
"ghcr.io/github/github-mcp-server"
|
||||
],
|
||||
"env": {
|
||||
"GITHUB_PERSONAL_ACCESS_TOKEN": "${input:github_token}",
|
||||
"GITHUB_HOST": "https://YOURSUBDOMAIN.ghe.com"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Replace `YOURSUBDOMAIN` with your {% data variables.product.prodname_ghe_cloud %} subdomain.
|
||||
|
||||
1. Save the file.
|
||||
|
||||
{% endvisualstudio %}
|
||||
|
||||
{% jetbrains %}
|
||||
|
||||
To configure the local MCP server with Docker in JetBrains IDEs:
|
||||
|
||||
{% data reusables.copilot.jetbrains-mcp-setup-steps %}
|
||||
1. Add the following configuration:
|
||||
|
||||
**For {% data variables.product.prodname_ghe_server %}:**
|
||||
|
||||
```json copy
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"type": "promptString",
|
||||
"id": "github_token",
|
||||
"description": "GitHub PAT",
|
||||
"password": true
|
||||
}
|
||||
],
|
||||
"servers": {
|
||||
"github": {
|
||||
"command": "docker",
|
||||
"args": [
|
||||
"run",
|
||||
"-i",
|
||||
"--rm",
|
||||
"-e",
|
||||
"GITHUB_PERSONAL_ACCESS_TOKEN",
|
||||
"-e",
|
||||
"GITHUB_HOST",
|
||||
"ghcr.io/github/github-mcp-server"
|
||||
],
|
||||
"env": {
|
||||
"GITHUB_PERSONAL_ACCESS_TOKEN": "${input:github_token}",
|
||||
"GITHUB_HOST": "https://YOUR_GHES_HOSTNAME"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Replace `YOUR_GHES_HOSTNAME` with your {% data variables.product.prodname_ghe_server %} hostname (for example, `https://github.example.com`).
|
||||
|
||||
**For {% data variables.product.prodname_ghe_cloud %} with data residency:**
|
||||
|
||||
```json copy
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"type": "promptString",
|
||||
"id": "github_token",
|
||||
"description": "GitHub PAT",
|
||||
"password": true
|
||||
}
|
||||
],
|
||||
"servers": {
|
||||
"github": {
|
||||
"command": "docker",
|
||||
"args": [
|
||||
"run",
|
||||
"-i",
|
||||
"--rm",
|
||||
"-e",
|
||||
"GITHUB_PERSONAL_ACCESS_TOKEN",
|
||||
"-e",
|
||||
"GITHUB_HOST",
|
||||
"ghcr.io/github/github-mcp-server"
|
||||
],
|
||||
"env": {
|
||||
"GITHUB_PERSONAL_ACCESS_TOKEN": "${input:github_token}",
|
||||
"GITHUB_HOST": "https://YOURSUBDOMAIN.ghe.com"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Replace `YOURSUBDOMAIN` with your {% data variables.product.prodname_ghe_cloud %} subdomain.
|
||||
|
||||
{% endjetbrains %}
|
||||
|
||||
{% xcode %}
|
||||
|
||||
To configure the local MCP server with Docker in Xcode:
|
||||
|
||||
{% data reusables.copilot.xcode-mcp-setup-steps %}
|
||||
1. Add the following configuration:
|
||||
|
||||
**For {% data variables.product.prodname_ghe_server %}:**
|
||||
|
||||
```json copy
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"type": "promptString",
|
||||
"id": "github_token",
|
||||
"description": "GitHub PAT",
|
||||
"password": true
|
||||
}
|
||||
],
|
||||
"servers": {
|
||||
"github": {
|
||||
"command": "docker",
|
||||
"args": [
|
||||
"run",
|
||||
"-i",
|
||||
"--rm",
|
||||
"-e",
|
||||
"GITHUB_PERSONAL_ACCESS_TOKEN",
|
||||
"-e",
|
||||
"GITHUB_HOST",
|
||||
"ghcr.io/github/github-mcp-server"
|
||||
],
|
||||
"env": {
|
||||
"GITHUB_PERSONAL_ACCESS_TOKEN": "${input:github_token}",
|
||||
"GITHUB_HOST": "https://YOUR_GHES_HOSTNAME"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Replace `YOUR_GHES_HOSTNAME` with your {% data variables.product.prodname_ghe_server %} hostname (for example, `https://github.example.com`).
|
||||
|
||||
**For {% data variables.product.prodname_ghe_cloud %} with data residency:**
|
||||
|
||||
```json copy
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"type": "promptString",
|
||||
"id": "github_token",
|
||||
"description": "GitHub PAT",
|
||||
"password": true
|
||||
}
|
||||
],
|
||||
"servers": {
|
||||
"github": {
|
||||
"command": "docker",
|
||||
"args": [
|
||||
"run",
|
||||
"-i",
|
||||
"--rm",
|
||||
"-e",
|
||||
"GITHUB_PERSONAL_ACCESS_TOKEN",
|
||||
"-e",
|
||||
"GITHUB_HOST",
|
||||
"ghcr.io/github/github-mcp-server"
|
||||
],
|
||||
"env": {
|
||||
"GITHUB_PERSONAL_ACCESS_TOKEN": "${input:github_token}",
|
||||
"GITHUB_HOST": "https://YOURSUBDOMAIN.ghe.com"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Replace `YOURSUBDOMAIN` with your {% data variables.product.prodname_ghe_cloud %} subdomain.
|
||||
|
||||
{% endxcode %}
|
||||
|
||||
{% eclipse %}
|
||||
|
||||
To configure the local MCP server with Docker in Eclipse:
|
||||
|
||||
{% data reusables.copilot.eclipse-mcp-setup-steps %}
|
||||
1. Add the following configuration under "Server Configurations":
|
||||
|
||||
**For {% data variables.product.prodname_ghe_server %}:**
|
||||
|
||||
```json copy
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"type": "promptString",
|
||||
"id": "github_token",
|
||||
"description": "GitHub PAT",
|
||||
"password": true
|
||||
}
|
||||
],
|
||||
"servers": {
|
||||
"github": {
|
||||
"command": "docker",
|
||||
"args": [
|
||||
"run",
|
||||
"-i",
|
||||
"--rm",
|
||||
"-e",
|
||||
"GITHUB_PERSONAL_ACCESS_TOKEN",
|
||||
"-e",
|
||||
"GITHUB_HOST",
|
||||
"ghcr.io/github/github-mcp-server"
|
||||
],
|
||||
"env": {
|
||||
"GITHUB_PERSONAL_ACCESS_TOKEN": "${input:github_token}",
|
||||
"GITHUB_HOST": "https://YOUR_GHES_HOSTNAME"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Replace `YOUR_GHES_HOSTNAME` with your {% data variables.product.prodname_ghe_server %} hostname (for example, `https://github.example.com`).
|
||||
|
||||
**For {% data variables.product.prodname_ghe_cloud %} with data residency:**
|
||||
|
||||
```json copy
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"type": "promptString",
|
||||
"id": "github_token",
|
||||
"description": "GitHub PAT",
|
||||
"password": true
|
||||
}
|
||||
],
|
||||
"servers": {
|
||||
"github": {
|
||||
"command": "docker",
|
||||
"args": [
|
||||
"run",
|
||||
"-i",
|
||||
"--rm",
|
||||
"-e",
|
||||
"GITHUB_PERSONAL_ACCESS_TOKEN",
|
||||
"-e",
|
||||
"GITHUB_HOST",
|
||||
"ghcr.io/github/github-mcp-server"
|
||||
],
|
||||
"env": {
|
||||
"GITHUB_PERSONAL_ACCESS_TOKEN": "${input:github_token}",
|
||||
"GITHUB_HOST": "https://YOURSUBDOMAIN.ghe.com"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Replace `YOURSUBDOMAIN` with your {% data variables.product.prodname_ghe_cloud %} subdomain.
|
||||
|
||||
1. Click **Apply**.
|
||||
|
||||
{% endeclipse %}
|
||||
|
||||
### Configuration when building from source
|
||||
|
||||
If you are building the MCP server from source instead of using Docker, you can set the `GITHUB_HOST` environment variable or use the `--gh-host` command-line flag:
|
||||
|
||||
**Using environment variable:**
|
||||
|
||||
```bash
|
||||
export GITHUB_HOST="https://YOUR_GHES_OR_GHEC_HOSTNAME"
|
||||
./github-mcp-server stdio
|
||||
```
|
||||
|
||||
**Using command-line flag:**
|
||||
|
||||
```bash
|
||||
./github-mcp-server --gh-host \
|
||||
"https://YOUR_GHES_OR_GHEC_HOSTNAME" stdio
|
||||
```
|
||||
|
||||
Replace `YOUR_GHES_OR_GHEC_HOSTNAME` with your {% data variables.product.prodname_ghe_server %} hostname (for example, `https://github.example.com`) or {% data variables.product.prodname_ghe_cloud %} hostname (for example, `https://octocorp.ghe.com`).
|
||||
|
||||
## Next steps
|
||||
|
||||
* To learn how to use the {% data variables.product.github %} MCP server, see [AUTOTITLE](/copilot/how-tos/provide-context/use-mcp/use-the-github-mcp-server).
|
||||
* To learn how to configure toolsets for the {% data variables.product.github %} MCP server, see [AUTOTITLE](/copilot/how-tos/provide-context/use-mcp/configure-toolsets).
|
||||
@@ -9,6 +9,8 @@ topics:
|
||||
children:
|
||||
- /extend-copilot-chat-with-mcp
|
||||
- /set-up-the-github-mcp-server
|
||||
- /enterprise-configuration
|
||||
- /configure-toolsets
|
||||
- /use-the-github-mcp-server
|
||||
- /change-mcp-registry
|
||||
redirect_from:
|
||||
|
||||
@@ -22,6 +22,8 @@ category:
|
||||
|
||||
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.
|
||||
|
||||
For the latest information and updates, see the [{% data variables.product.github %} MCP server repository](https://github.com/github/github-mcp-server).
|
||||
|
||||
{% vscode %}
|
||||
|
||||
{% data reusables.copilot.mcp.about-github-mcp-server %}
|
||||
@@ -48,10 +50,6 @@ For information on manually configuring the remote or local {% data variables.pr
|
||||
1. To check that the {% data variables.product.github %} MCP server is configured correctly, 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 and select **MCP: List Servers**. You should see `github` listed 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](https://github.com/mcp/io.github.github/github-mcp-server#tool-configuration) in the GitHub MCP server documentation.
|
||||
|
||||
{% endvscode %}
|
||||
|
||||
{% visualstudio %}
|
||||
@@ -309,6 +307,11 @@ To configure the remote {% data variables.product.github %} MCP server with a PA
|
||||
|
||||
{% endeclipse %}
|
||||
|
||||
## Enterprise configuration
|
||||
|
||||
If you are using {% data variables.product.prodname_ghe_server %} or {% data variables.product.prodname_ghe_cloud %} with data residency, additional configuration is required. For more information, see [AUTOTITLE](/copilot/how-tos/provide-context/use-mcp/enterprise-configuration).
|
||||
|
||||
## Next steps
|
||||
|
||||
To learn how to use the {% data variables.product.github %} MCP server in {% data variables.product.prodname_vscode %}, see [AUTOTITLE](/copilot/how-tos/provide-context/use-mcp/use-the-github-mcp-server).
|
||||
* To learn how to use the {% data variables.product.github %} MCP server in {% data variables.product.prodname_vscode %}, see [AUTOTITLE](/copilot/how-tos/provide-context/use-mcp/use-the-github-mcp-server).
|
||||
* For information on configuring individual toolsets with read-only or read/write access, see [AUTOTITLE](/copilot/how-tos/provide-context/use-mcp/configure-toolsets).
|
||||
|
||||
Reference in New Issue
Block a user