Skip to main content

Using the GitHub MCP Server

Learn how to use the GitHub Model Context Protocol (MCP) server to interact with repositories, issues, pull requests, and other GitHub features, directly from Copilot Chat.

The GitHub MCP server is available to all GitHub users regardless of plan type. However, specific tools within the MCP server inherit the same access requirements as their corresponding GitHub features. If a feature requires a paid GitHub or Copilot license, the equivalent MCP tool will require the same subscription. For example, tools that interact with Copilot Coding Agent require a paid Copilot license.

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

  • A GitHub account.
  • Visual Studio Code.
  • The GitHub MCP server, configured in your editor. See Setting up the GitHub MCP Server.
  • If you are a member of an organization or enterprise with a Copilot Business or Copilot Enterprise plan, the "MCP servers in Copilot" policy must be enabled in order to use MCP with Copilot.

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.

  1. Open Copilot Chat by clicking the icon in the title bar of Visual Studio Code.
  2. In the Copilot Chat box, select Agent from the popup menu.
  3. 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.
  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.

Push protection block

If you are using the GitHub MCP server and push protection blocks a secret that you believe is safe to expose, you may be able to bypass the block by specifying a reason for allowing the secret. See Working with push protection and the GitHub MCP server.

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