Примечание.
The GitHub MCP server is currently in public preview and subject to change.
About the GitHub MCP server
The GitHub MCP server is a Model Context Protocol (MCP) server provided and maintained by GitHub. MCP allows you to integrate AI capabilities with other tools and services, enhancing your development experience by providing context-aware AI assistance.
For more information on MCP, see the official MCP documentation.
You can access the GitHub MCP server remotely through Visual Studio Code, 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 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 GitHub’s AI capabilities without the overhead of managing a local MCP server.
Running the GitHub MCP server locally requires a bit more setup, but it allows for greater customization and control over your AI interactions.
GitHub MCP server can be used to:
- Automate and streamline code-related tasks.
- Connect third-party tools (like Cursor, Windsurf, or future integrations) to leverage GitHub’s context and AI capabilities.
- Enable cloud-based workflows that work from any device, without local setup.
Availability
There is currently broad support for local MCP servers in clients such as Visual Studio Code, JetBrains IDEs, XCode, and others.
Support for remote MCP servers is growing, with editors like Visual Studio Code (with OAuth or PAT), Visual Studio (PAT only), JetBrains IDEs (PAT only), Xcode (PAT only), Eclipse (PAT only), Windsurf (PAT only), and Cursor (PAT only) already providing this functionality.
To find out if your preferred editor supports remote MCP servers, check the documentation for your specific editor.
Prerequisites
- A GitHub account.
- Visual Studio Code, or another MCP-compatible editor.
Setting up the GitHub MCP server in Visual Studio Code
The instructions below guide you through setting up the GitHub MCP server in Visual Studio Code. Other MCP-compatible editors may have similar steps, but the exact process may vary.
You can choose to set up the GitHub MCP server either remotely or locally, depending on your needs and preferences. You can also configure your GitHub MCP server for either:
- A specific repository. This enables you to share MCP servers with anyone who opens the project in Visual Studio Code. To do this, create a
.vscode/mcp.json
file in the root of your repository. - Your personal instance of Visual Studio Code. 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 Visual Studio Code. MCP servers configured this way will be available in all workspaces.
The remote GitHub MCP server uses one-click OAuth authentication by default, but you can also manually configure it to use a personal access token (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.
Примечание.
If you are an Enterprise Managed User 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 Visual Studio Code and Visual Studio).
- Remote MCP server configuration with OAuth
- Remote MCP server configuration with PAT
- Local MCP server setup
Remote MCP server configuration with OAuth
Примечание.
The remote GitHub MCP server is not available to GitHub Enterprise Server users. If you are using GitHub Enterprise Server, you can install the GitHub MCP server locally. See Local MCP server setup.
You do not need to create a PAT or install any additional software to use the remote GitHub MCP server with OAuth. You can set it up directly in Visual Studio Code. 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.
-
In Visual Studio Code, open the command palette by pressing Ctrl+Shift+P (Windows/Linux) / Command+Shift+P (Mac).
-
Type:
mcp: add server
and then press Enter. -
From the list, select HTTP (HTTP or Server-Sent Events).
-
In the Server URL field, enter
https://api.githubcopilot.com/mcp/
, and press Enter. -
Under Enter Server ID, press Enter to use the default server ID, or enter a custom server ID.
-
Under Choose where to save the configuration, select where you want to save the MCP server configuration.
- Visual Studio Code will open and add the configuration to the selected file in the editor, or create a new file if it doesn't exist.
-
In the Visual Studio Code 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 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 Managing your personal access tokens.
You will need to manually configure the MCP server in Visual Studio Code to use the PAT for authorization.
-
In Visual Studio Code, open the command palette by pressing Ctrl+Shift+P (Windows/Linux) / Command+Shift+P (Mac).
-
Type:
mcp: add server
and then press Enter. -
From the list, select HTTP (HTTP or Server-Sent Events).
-
In the Server URL field, enter
https://api.githubcopilot.com/mcp/
, and press Enter. -
Under Enter Server ID, press Enter to use the default server ID, or enter a custom server ID.
-
Under Choose where to save the configuration, select where you want to save the MCP server configuration.
- Visual Studio Code will open and add the configuration to the selected file in the editor, or create a new file if it doesn't exist.
-
In the Visual Studio Code popup, to decline OAuth authorization, click Cancel.
-
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 , "headers": { "Authorization": "Bearer ${input:github_token}" } }, }, "inputs": [ { "id": "github_token", "type": "promptString", "description": "GitHub Personal Access Token", "password": true } ] }
, "headers": { "Authorization": "Bearer ${input:github_token}" } }, }, "inputs": [ { "id": "github_token", "type": "promptString", "description": "GitHub Personal Access Token", "password": true } ] }
-
A "Restart" button will appear in the file. Click "Restart" to restart the MCP server with the new configuration.
-
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
Примечание.
If you are a GitHub Enterprise 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 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.
-
Ensure you have Docker installed and running on your machine. See Docker installation instructions.
-
Create a PAT with (at least) the
read:packages
andrepo
scopes. For more information, see Managing your personal access tokens. -
Decide whether you want to configure the MCP server for a specific repository or for your personal instance of Visual Studio Code.
- If you are using a specific repository, open the
.vscode/mcp.json
file in Visual Studio Code, and add the following configuration:
JSON { "inputs": [ { "type": "promptString", "id": "github_token", "description": "GitHub Personal Access Token", "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}" } } } }
{ "inputs": [ { "type": "promptString", "id": "github_token", "description": "GitHub Personal Access Token", "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 Visual Studio Code, open your
settings.json
file in Visual Studio Code:- Press Ctrl+Shift+P (Windows/Linux) or Cmd+Shift+P (macOS).
- Type Preferences: Open Settings (JSON) and select it.
- Add the following configuration:
JSON { "mcp": { "inputs": [ { "type": "promptString", "id": "github_token", "description": "GitHub Personal Access Token", "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}" } } } } }
{ "mcp": { "inputs": [ { "type": "promptString", "id": "github_token", "description": "GitHub Personal Access Token", "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 a specific repository, open the
-
Save the file.
-
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 run locally with the PAT for authorization.
Tool configuration
The 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.
Using the GitHub MCP server in Visual Studio Code
The GitHub MCP server enables you to perform a wide range of actions on GitHub, via Copilot Chat in Visual Studio Code.
- Open Copilot Chat by clicking the icon in the title bar of Visual Studio Code.
- In the Copilot Chat box, select Agent from the popup menu.
- To see the available actions, in the Copilot Chat box, click the Select tools icon.
- In the Tools dropdown, under MCP Server: GitHub, you will see a list of available actions.
- In the Copilot Chat box, type a command or question related to the action you want to perform, and press Enter.
- For example, you can ask the GitHub MCP server to create a new issue, list pull requests, or retrieve repository information.
- The GitHub MCP server will process your request and provide a response in the chat interface.
- In the Copilot Chat box, you may be asked to give additional permissions or provide more information to complete the action.
- Follow the prompts to complete the action.
About the GitHub MCP server
The GitHub MCP server is a Model Context Protocol (MCP) server provided and maintained by GitHub. MCP allows you to integrate AI capabilities with other tools and services, enhancing your development experience by providing context-aware AI assistance.
For more information on MCP, see the official MCP documentation.
You can access the GitHub MCP server remotely through Visual Studio Code, 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 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 GitHub’s AI capabilities without the overhead of managing a local MCP server.
Running the GitHub MCP server locally requires a bit more setup, but it allows for greater customization and control over your AI interactions.
GitHub MCP server can be used to:
- Automate and streamline code-related tasks.
- Connect third-party tools (like Cursor, Windsurf, or future integrations) to leverage GitHub’s context and AI capabilities.
- Enable cloud-based workflows that work from any device, without local setup.
Availability
There is currently broad support for local MCP servers in clients such as Visual Studio Code, JetBrains IDEs, XCode, and others.
Support for remote MCP servers is growing, with editors like Visual Studio Code (with OAuth or PAT), Visual Studio (PAT only), JetBrains IDEs (PAT only), Xcode (PAT only), Eclipse (PAT only), Windsurf (PAT only), and Cursor (PAT only) already providing this functionality.
To find out if your preferred editor supports remote MCP servers, check the documentation for your specific editor.
Prerequisites
-
Access to Copilot. For information about how to get access to Copilot, see What is GitHub Copilot?.
-
A compatible JetBrains IDE. GitHub Copilot is compatible with the following IDEs:
- IntelliJ IDEA (Ultimate, Community, Educational)
- Android Studio
- AppCode
- CLion
- Code With Me Guest
- DataGrip
- DataSpell
- GoLand
- JetBrains Client
- MPS
- PhpStorm
- PyCharm (Professional, Community, Educational)
- Rider
- RubyMine
- RustRover
- WebStorm
- Writerside
See the JetBrains IDEs tool finder to download.
-
GitHub Copilot plugin. See the GitHub Copilot plugin in the JetBrains Marketplace. For installation instructions, see Installing the GitHub Copilot extension in your environment.
-
Log in to GitHub in your JetBrains IDE. For authentication instructions, see Installing the GitHub Copilot extension in your environment.
Setting up the GitHub MCP server in JetBrains IDEs
The instructions below guide you through setting up the GitHub MCP server in JetBrains IDEs. Other MCP-compatible editors may have similar steps, but the exact process may vary.
We recommend setting up the GitHub MCP server remotely. JetBrains IDEs only support using a personal access token (PAT) for authentication with the GitHub MCP server.
Примечание.
If you are an Enterprise Managed User with PAT restrictions, you won't be able to use PAT authentication.
For information on setting up the GitHub MCP server locally, see the GitHub MCP server repository.
Remote MCP server configuration with PAT
To configure the remote 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 Managing your personal access tokens.
- In the lower right corner, click .
- From the menu, select "Edit settings".
- Under the MCP section, click "Edit in
mcp.json
". - Add the following configuration, replacing
YOUR_GITHUB_PAT
with the PAT you created:
{ "servers": { "github": { "url": "https://api.githubcopilot.com/mcp/", "requestInit": { "headers": { "Authorization": "Bearer YOUR_GITHUB_PAT" } } } } }
{
"servers": {
"github": {
"url": "https://api.githubcopilot.com/mcp/",
"requestInit": {
"headers": {
"Authorization": "Bearer YOUR_GITHUB_PAT"
}
}
}
}
}
Using the GitHub MCP server in JetBrains IDEs
The GitHub MCP server enables you to perform a wide range of actions on GitHub, via Copilot Chat in JetBrains IDEs.
-
Open the Copilot Chat window by clicking the GitHub Copilot Chat icon at the right side of the JetBrains IDE window.
-
At the top of the chat panel, click the Agent tab.
-
To see the available actions, in the Copilot Chat box, click the tools icon.
- Under MCP Server: GitHub, you will see a list of available actions.
-
In the Copilot Chat box, type a command or question related to the action you want to perform, and press Enter.
- For example, you can ask the GitHub MCP server to create a new issue, list pull requests, or retrieve repository information.
-
The GitHub MCP server will process your request and provide a response in the chat interface.
- In the Copilot Chat box, you may be asked to give additional permissions or provide more information to complete the action.
-
Follow the prompts to complete the action.
About the GitHub MCP server
The GitHub MCP server is a Model Context Protocol (MCP) server provided and maintained by GitHub. MCP allows you to integrate AI capabilities with other tools and services, enhancing your development experience by providing context-aware AI assistance.
For more information on MCP, see the official MCP documentation.
You can access the GitHub MCP server remotely through Visual Studio Code, 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 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 GitHub’s AI capabilities without the overhead of managing a local MCP server.
Running the GitHub MCP server locally requires a bit more setup, but it allows for greater customization and control over your AI interactions.
GitHub MCP server can be used to:
- Automate and streamline code-related tasks.
- Connect third-party tools (like Cursor, Windsurf, or future integrations) to leverage GitHub’s context and AI capabilities.
- Enable cloud-based workflows that work from any device, without local setup.
Availability
There is currently broad support for local MCP servers in clients such as Visual Studio Code, JetBrains IDEs, XCode, and others.
Support for remote MCP servers is growing, with editors like Visual Studio Code (with OAuth or PAT), Visual Studio (PAT only), JetBrains IDEs (PAT only), Xcode (PAT only), Eclipse (PAT only), Windsurf (PAT only), and Cursor (PAT only) already providing this functionality.
To find out if your preferred editor supports remote MCP servers, check the documentation for your specific editor.
Prerequisites
- Access to Copilot. For information about how to get access to Copilot, see What is GitHub Copilot?.
- GitHub Copilot for Xcode extension. See Installing the GitHub Copilot extension in your environment.
Setting up the GitHub MCP server in Xcode
The instructions below guide you through setting up the GitHub MCP server in Xcode. Other MCP-compatible editors may have similar steps, but the exact process may vary.
We recommend setting up the GitHub MCP server remotely. Xcode only supports using a personal access token (PAT) for authentication with the GitHub MCP server.
Примечание.
If you are an Enterprise Managed User with PAT restrictions, you won't be able to use PAT authentication.
For information on setting up the GitHub MCP server locally, see the GitHub MCP server repository.
Remote MCP server configuration with PAT
To configure the remote 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 Managing your personal access tokens.
- Open the GitHub Copilot for Xcode extension.
- In agent mode, click the tools icon.
- Select "Edit config".
- Add the following configuration, replacing
YOUR_GITHUB_PAT
with the PAT you created:
{ "servers": { "github": { "url": "https://api.githubcopilot.com/mcp/", "requestInit": { "headers": { "Authorization": "Bearer YOUR_GITHUB_PAT" } } } } }
{
"servers": {
"github": {
"url": "https://api.githubcopilot.com/mcp/",
"requestInit": {
"headers": {
"Authorization": "Bearer YOUR_GITHUB_PAT"
}
}
}
}
}
Using the GitHub MCP server in Xcode
The GitHub MCP server enables you to perform a wide range of actions on GitHub, via Copilot Chat in Xcode.
- To open the chat view, click Editor in the menu bar, then click Copilot then Open Chat. Copilot Chat opens in a new window.
- At the bottom of the chat panel, select Agent.
- To see the available actions, in the Copilot Chat box, click the tools icon.
- Under MCP Server: GitHub, you will see a list of available actions.
- In the Copilot Chat box, type a command or question related to the action you want to perform, and press Enter.
- For example, you can ask the GitHub MCP server to create a new issue, list pull requests, or retrieve repository information.
- The GitHub MCP server will process your request and provide a response in the chat interface.
- In the Copilot Chat box, you may be asked to give additional permissions or provide more information to complete the action.
- Follow the prompts to complete the action.
About the GitHub MCP server
The GitHub MCP server is a Model Context Protocol (MCP) server provided and maintained by GitHub. MCP allows you to integrate AI capabilities with other tools and services, enhancing your development experience by providing context-aware AI assistance.
For more information on MCP, see the official MCP documentation.
You can access the GitHub MCP server remotely through Visual Studio Code, 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 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 GitHub’s AI capabilities without the overhead of managing a local MCP server.
Running the GitHub MCP server locally requires a bit more setup, but it allows for greater customization and control over your AI interactions.
GitHub MCP server can be used to:
- Automate and streamline code-related tasks.
- Connect third-party tools (like Cursor, Windsurf, or future integrations) to leverage GitHub’s context and AI capabilities.
- Enable cloud-based workflows that work from any device, without local setup.
Availability
There is currently broad support for local MCP servers in clients such as Visual Studio Code, JetBrains IDEs, XCode, and others.
Support for remote MCP servers is growing, with editors like Visual Studio Code (with OAuth or PAT), Visual Studio (PAT only), JetBrains IDEs (PAT only), Xcode (PAT only), Eclipse (PAT only), Windsurf (PAT only), and Cursor (PAT only) already providing this functionality.
To find out if your preferred editor supports remote MCP servers, check the documentation for your specific editor.
Prerequisites
- Access to Copilot. To use GitHub Copilot in Eclipse, you must have an active GitHub Copilot subscription. For information about how to get access to Copilot, see What is GitHub Copilot?.
- Compatible version of Eclipse. To use the GitHub Copilot extension, you must have Eclipse version 2024-09 or above. See the Eclipse download page.
- Latest version of the GitHub Copilot extension. Download this from the Eclipse Marketplace. For more information, see Installing the GitHub Copilot extension in your environment.
- Sign in to GitHub from Eclipse.
Setting up the GitHub MCP server in Eclipse
The instructions below guide you through setting up the GitHub MCP server in Eclipse. Other MCP-compatible editors may have similar steps, but the exact process may vary.
We recommend setting up the GitHub MCP server remotely. Eclipse only supports using a personal access token (PAT) for authentication with the GitHub MCP server.
Примечание.
If you are an Enterprise Managed User with PAT restrictions, you won't be able to use PAT authentication.
For information on setting up the GitHub MCP server locally, see the GitHub MCP server repository.
Remote MCP server configuration with PAT
To configure the remote 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 Managing your personal access tokens.
- To open the Copilot Chat panel, click the Copilot icon () in the status bar at the bottom of Eclipse.
- From the menu, select "Edit preferences".
- In the left pane, expand GitHub Copilot and click MCP.
- Add the following configuration, replacing
YOUR_GITHUB_PAT
with the PAT you created:
{ "servers": { "github": { "url": "https://api.githubcopilot.com/mcp/", "requestInit": { "headers": { "Authorization": "Bearer YOUR_GITHUB_PAT" } } } } }
{
"servers": {
"github": {
"url": "https://api.githubcopilot.com/mcp/",
"requestInit": {
"headers": {
"Authorization": "Bearer YOUR_GITHUB_PAT"
}
}
}
}
}
Using the GitHub MCP server in Eclipse
The GitHub MCP server enables you to perform a wide range of actions on GitHub, via Copilot Chat in Eclipse.
- To open the Copilot Chat panel, click the Copilot icon () in the status bar at the bottom of Eclipse, then click Open Chat.
- At the bottom of the chat panel, select Agent from the mode dropdown.
- To see the available actions, in the Copilot Chat box, click the tools icon.
- Under
github
, you will see a list of available actions.
- Under
- In the Copilot Chat box, type a command or question related to the action you want to perform, and press Enter.
- For example, you can ask the GitHub MCP server to create a new issue, list pull requests, or retrieve repository information.
- The GitHub MCP server will process your request and provide a response in the chat interface.
- In the Copilot Chat box, you may be asked to give additional permissions or provide more information to complete the action.
- Follow the prompts to complete the action.
Troubleshooting
If you encounter issues while using the GitHub MCP server, there are a few common troubleshooting steps you can take.
Authorization issues
If you are having trouble authorizing the MCP server, ensure that:
- You are signed in to GitHub in your choice of IDE.
If you are authenticating with a personal access token (PAT), ensure that:
- Your GitHub PAT is valid and has the necessary scopes for the actions you want to perform.
- You have entered the correct PAT.
Copilot agent mode problems
If you are having trouble with the Copilot Chat agent mode, ensure that:
- You have selected the correct agent in the Copilot Chat box.
- You have configured the MCP server correctly in your IDE.
- You have the necessary permissions to perform the actions you are trying to execute.
General tips
If you are experiencing other issues with the GitHub MCP server, here are some general tips to help you troubleshoot:
- Check the output logs of the MCP server for any error messages.
- If you are running the MCP server locally, ensure that your local environment is set up correctly for running Docker containers.
- Try restarting the MCP server or your IDE.