Skip to main content

Using the GitHub MCP Server

Learn how to use the GitHub Model Context Protocol (MCP) server to extend Copilot Chat.

Примечание.

The remote GitHub MCP server is currently in public preview and subject to change; use of the GitHub MCP server locally is generally available (GA).

While in public preview, access to the remote GitHub MCP server through OAuth in Copilot is governed by the Copilot Editor preview features policy at the organization or enterprise level. PAT access to the server is managed by PAT policies.

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 a full introduction to the GitHub MCP server and an overview of MCP, see About Model Context Protocol (MCP).

Prerequisites

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.

  1. To open the Copilot Chat panel, click the Copilot icon () in the status bar at the bottom of Eclipse.
  2. From the menu, select "Edit preferences".
  3. In the left pane, expand GitHub Copilot and click MCP.
  4. Add the following configuration, replacing YOUR_GITHUB_PAT with the PAT you created:
JSON
  {
    "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.

  1. To open the Copilot Chat panel, click the Copilot icon () in the status bar at the bottom of Eclipse, then click Open Chat.
  2. At the bottom of the chat panel, select Agent from the mode dropdown.
  3. To see the available actions, in the Copilot Chat box, click the tools icon.
    • Under github, you will see a list of available actions.
  4. 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.
  5. 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.
  6. 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.

Further reading