Skip to main content

Setting up the GitHub MCP Server

Learn how to configure the GitHub Model Context Protocol (MCP) server.

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 Cloud Agent require a paid Copilot license.

For the latest information and updates, see the GitHub MCP server repository.

Sobre o servidor de MCP do GitHub

O servidor de MCP do GitHub é um servidor de MCP (Protocolo de Contexto de Modelo) fornecido e mantido pelo GitHub. O MCP permite que você integre recursos de IA a outras ferramentas e serviços, aprimorando sua experiência de desenvolvimento fornecendo assistência de IA com reconhecimento de contexto.

Para obter uma introdução completa ao servidor MCP do GitHub e uma visão geral do MCP, consulte Sobre o Protocolo de Contexto de Modelo (MCP).

Prerequisites

  • A GitHub account.
  • Visual Studio Code.
  • Se você for membro de uma organização ou empresa com um plano Copilot Business ou Copilot Enterprise, a política "Servidores MCP no Copilot" deverá ser habilitada para usar o MCP com o Copilot.

Setting up the GitHub MCP server in Visual Studio Code

The GitHub MCP server in Visual Studio Code can be configured remotely or locally. The remote GitHub MCP server is hosted by GitHub and is the recommended option for most users. The local GitHub MCP server is hosted on your machine and is recommended for users who want to customize their setup or have specific security requirements.

The steps below describe remote configuration through the MCP Registry view in Visual Studio Code's extensions panel. This view is backed by the GitHub MCP Registry. See GitHub MCP Registry.

For information on manually configuring the remote or local GitHub MCP server, see the GitHub MCP server documentation.

  1. In Visual Studio Code, open the extensions panel by clicking the extensions icon in the sidebar or pressing Ctrl+Shift+X (Windows/Linux) / Command+Shift+X (Mac).
  2. In the extensions search bar, type @mcp github to search the MCP server gallery.
  3. Select the GitHub MCP server from the search results. On the details page, click Install.
  4. When prompted, confirm that you trust the server to start it.
  5. To verify that the GitHub MCP server is configured correctly, open the command palette by pressing Ctrl+Shift+P (Windows/Linux) / Command+Shift+P (Mac).
  6. Type and select MCP: List Servers. You should see the GitHub MCP server listed as a configured server.

Sobre o servidor de MCP do GitHub

O servidor de MCP do GitHub é um servidor de MCP (Protocolo de Contexto de Modelo) fornecido e mantido pelo GitHub. O MCP permite que você integre recursos de IA a outras ferramentas e serviços, aprimorando sua experiência de desenvolvimento fornecendo assistência de IA com reconhecimento de contexto.

Para obter uma introdução completa ao servidor MCP do GitHub e uma visão geral do MCP, consulte Sobre o Protocolo de Contexto de Modelo (MCP).

Prerequisites

  • Access to Copilot. Confira O que é GitHub Copilot?.
  • Visual Studio version 17.14 or later. For more information on installing Visual Studio, see the Visual Studio downloads page.
  • Sign in to GitHub from Visual Studio.
  • Se você for membro de uma organização ou empresa com um plano Copilot Business ou Copilot Enterprise, a política "Servidores MCP no Copilot" deverá ser habilitada para usar o MCP com o Copilot.

Setting up the GitHub MCP server in Visual Studio

The instructions below guide you through setting up the GitHub MCP server in Visual Studio. Other MCP-compatible editors may have similar steps, but the exact process may vary.

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 can only access the scopes you approve during sign-in. In organization-owned contexts, access may also be limited by admin policies that control which scopes and apps are permitted. If you use a PAT, the MCP server will have access to the scopes granted by the PAT, which is also subject to any PAT restrictions configured by the organization.

Observação

If you are an Enterprise Managed User, then PAT is disabled by default, unless enabled by an enterprise administrator. If PAT is disabled, you won't be able to use PAT authentication. If you have OAuth access policy restrictions, you will need the OAuth App for each client (MCP host application) to be enabled (except Visual Studio Code and Visual Studio).

For information on setting up the GitHub MCP server locally, see the GitHub MCP server documentation.

Remote MCP server configuration with OAuth

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.

  1. In the Visual Studio menu bar, click View, then click Copilot Chat do GitHub.

  2. At the bottom of the chat panel, select Agent from the mode dropdown.

  3. In the Bate-Papo Copilot window, click the tools icon, then click the plus icon in the tool picker window.

  4. In the "Configure MCP server" pop-up window, fill out the fields.

    1. For "Server ID", type github.
    2. For "Type", select "HTTP/SSE" from the dropdown.
    3. For "URL", type https://api.githubcopilot.com/mcp/.
  5. Click Save. The configuration in the mcp.json file should look like this:

    JSON
        {
          "servers": {
            "github": {
              "url": "https://api.githubcopilot.com/mcp/"
            }
          }
        }
    
  6. In the mcp.json file, click Auth from the CodeLens above the server to authenticate to the server. A pop-up will come up allowing you to authenticate with your GitHub account.

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 Gerenciar seus tokens de acesso pessoal.

  1. In the Visual Studio menu bar, click View, then click Copilot Chat do GitHub.

  2. At the bottom of the chat panel, select Agent from the mode dropdown.

  3. In the Bate-Papo Copilot window, click the tools icon, then click the plus icon in the tool picker window.

  4. In the "Configure MCP server" pop-up window, fill out the fields.

    1. For "Server ID", type github.
    2. For "Type", select "HTTP/SSE" from the dropdown.
    3. For "URL", type https://api.githubcopilot.com/mcp/.
    4. Add a new header under "Headers", called "Authorization" and set to the value Bearer YOUR_GITHUB_PAT, replacing "YOUR_GITHUB_PAT" with your PAT.
  5. Click Save. The configuration in the mcp.json file should look like this:

    JSON
      {
        "servers": {
            "github": {
                "url": "https://api.githubcopilot.com/mcp/",
                "requestInit": {
                    "headers": {
                        "Authorization": "Bearer YOUR_GITHUB_PAT"
                    }
                }
            }
        }
      }
    

For more information on configuring MCP servers in Visual Studio, see Use MCP servers in Visual Studio (Preview) in the Visual Studio documentation.

Sobre o servidor de MCP do GitHub

O servidor de MCP do GitHub é um servidor de MCP (Protocolo de Contexto de Modelo) fornecido e mantido pelo GitHub. O MCP permite que você integre recursos de IA a outras ferramentas e serviços, aprimorando sua experiência de desenvolvimento fornecendo assistência de IA com reconhecimento de contexto.

Para obter uma introdução completa ao servidor MCP do GitHub e uma visão geral do MCP, consulte Sobre o Protocolo de Contexto de Modelo (MCP).

Prerequisites

  • Access to Copilot. Confira O que é GitHub Copilot?.

  • A compatible JetBrains IDE. GitHub Copilot is compatible with the following IDEs:

    • IntelliJ IDEA (Ultimate, Community, Educational)
    • Android Studio
    • AppCode
    • CLion
    • Convidado do Code With Me
    • DataGrip
    • DataSpell
    • GoLand
    • Cliente JetBrains
    • MPS
    • PhpStorm
    • PyCharm (Profissional, Comunidade, Educacional)
    • Rider
    • RubyMine
    • RustRover
    • WebStorm
    • Lado do escritor

    Consulte o localizador de ferramentas JetBrains IDEs para fazer o download.

  •         **Versão mais recente da extensão do GitHub Copilot**. Confira o [plug-in do GitHub Copilot](https://plugins.jetbrains.com/plugin/17718-github-copilot?ref_product=copilot&ref_type=engagement&ref_style=text) no Marketplace do JetBrains. Para obter instruções de instalação, confira [AUTOTITLE](/copilot/configuring-github-copilot/installing-the-github-copilot-extension-in-your-environment).
    
  •         **Inicie sessão no GitHub no seu IDE da JetBrains**. Para obter instruções de autenticação, confira [AUTOTITLE](/copilot/configuring-github-copilot/installing-the-github-copilot-extension-in-your-environment?tool=jetbrains#installing-the-github-copilot-plugin-in-your-jetbrains-ide).
    
  • Se você for membro de uma organização ou empresa com um plano Copilot Business ou Copilot Enterprise, a política "Servidores MCP no Copilot" deverá ser habilitada para usar o MCP com o Copilot.

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.

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 can only access the scopes you approve during sign-in. In organization-owned contexts, access may also be limited by admin policies that control which scopes and apps are permitted. If you use a PAT, the MCP server will have access to the scopes granted by the PAT, which is also subject to any PAT restrictions configured by the organization.

Observação

If you are an Enterprise Managed User, then PAT is disabled by default, unless enabled by an enterprise administrator. If PAT is disabled, you won't be able to use PAT authentication. If you have OAuth access policy restrictions, you will need the OAuth App for each client (MCP host application) to be enabled (except Visual Studio Code and Visual Studio).

For information on setting up the GitHub MCP server locally, see the GitHub MCP server documentation.

Remote MCP server configuration with OAuth

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 JetBrains IDEs.

  1. No canto inferior direito, clique em .

  2. No menu, selecione "Open Chat", verifique se você está no modo agente e clique no ícone de ferramentas (chamado "Configure your MCP server") na parte inferior da janela de chat.

  3. Clique em Add MCP Tools.

  4. In the mcp.json file, add the following configuration:

    JSON
    {
      "servers": {
          "github": {
              "type": "http",
              "url": "https://api.githubcopilot.com/mcp/"
          }
      }
    }
    
  5. In the "GitHub Copilot" popup that says the "MCP server definition wants to authenticate to GitHub, click Allow.

  6. If you have not yet authorized the GitHub Copilot plugin, in the browser popup, click Continue next to your personal account.

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 Gerenciar seus tokens de acesso pessoal.

  1. No canto inferior direito, clique em .
  2. No menu, selecione "Open Chat", verifique se você está no modo agente e clique no ícone de ferramentas (chamado "Configure your MCP server") na parte inferior da janela de chat.
  3. Clique em Add MCP Tools.
  4. In the mcp.json file, 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"
                }
            }
        }
    }
  }

Sobre o servidor de MCP do GitHub

O servidor de MCP do GitHub é um servidor de MCP (Protocolo de Contexto de Modelo) fornecido e mantido pelo GitHub. O MCP permite que você integre recursos de IA a outras ferramentas e serviços, aprimorando sua experiência de desenvolvimento fornecendo assistência de IA com reconhecimento de contexto.

Para obter uma introdução completa ao servidor MCP do GitHub e uma visão geral do MCP, consulte Sobre o Protocolo de Contexto de Modelo (MCP).

Prerequisites

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.

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 can only access the scopes you approve during sign-in. In organization-owned contexts, access may also be limited by admin policies that control which scopes and apps are permitted. If you use a PAT, the MCP server will have access to the scopes granted by the PAT, which is also subject to any PAT restrictions configured by the organization.

Observação

If you are an Enterprise Managed User, then PAT is disabled by default, unless enabled by an enterprise administrator. If PAT is disabled, you won't be able to use PAT authentication. If you have OAuth access policy restrictions, you will need the OAuth App for each client (MCP host application) to be enabled (except Visual Studio Code and Visual Studio).

For information on setting up the GitHub MCP server locally, see the GitHub MCP server documentation.

Remote MCP server configuration with OAuth

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 Xcode.

  1. Abra o GitHub Copilot para a extensão do Xcode e acesse "Configurações".

    • Como alternativa, em um workspace ativo do Xcode, você pode encontrar as configurações clicando em Editor na barra de menus, selecionando GitHub Copilot e clicando em Abrir GitHub Copilot para Configurações do Xcode.
  2. Selecione a guia MCP e clique em Editar Configuração.

  3. Add the following configuration:

    JSON
    {
      "servers": {
          "github": {
              "type": "http",
              "url": "https://api.githubcopilot.com/mcp/"
          }
      }
    }
    
  4. In the "GitHub Copilot" popup that says the "MCP Server Definition wants to authenticate to GitHub", click Continue.

  5. If you have not yet authorized the GitHub Copilot plugin, in the browser popup, click Continue next to your personal account.

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 Gerenciar seus tokens de acesso pessoal.

  1. Abra o GitHub Copilot para a extensão do Xcode e acesse "Configurações".
    • Como alternativa, em um workspace ativo do Xcode, você pode encontrar as configurações clicando em Editor na barra de menus, selecionando GitHub Copilot e clicando em Abrir GitHub Copilot para Configurações do Xcode.
  2. Selecione a guia MCP e clique em Editar Configuração.
  3. 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"
                }
            }
        }
    }
  }

Sobre o servidor de MCP do GitHub

O servidor de MCP do GitHub é um servidor de MCP (Protocolo de Contexto de Modelo) fornecido e mantido pelo GitHub. O MCP permite que você integre recursos de IA a outras ferramentas e serviços, aprimorando sua experiência de desenvolvimento fornecendo assistência de IA com reconhecimento de contexto.

Para obter uma introdução completa ao servidor MCP do GitHub e uma visão geral do MCP, consulte Sobre o Protocolo de Contexto de Modelo (MCP).

Prerequisites

  • Acesso ao Copilot. Confira O que é GitHub Copilot?.
  • Versão compatível do Eclipse. Para usar a extensão do GitHub Copilot, você precisa ter o Eclipse versão 2024-09 ou superior. Consulte a página de download do Eclipse.
  • Se você for membro de uma organização ou empresa com um plano Copilot Business ou Copilot Enterprise, a política "Servidores MCP no Copilot" deverá ser habilitada para usar o MCP com o Copilot.
  • Latest version of the GitHub Copilot extension. Download this from the Eclipse Marketplace. For more information, see Instalando a extensão GitHub Copilot em seu ambiente.
  • 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.

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 can only access the scopes you approve during sign-in. In organization-owned contexts, access may also be limited by admin policies that control which scopes and apps are permitted. If you use a PAT, the MCP server will have access to the scopes granted by the PAT, which is also subject to any PAT restrictions configured by the organization.

Observação

If you are an Enterprise Managed User, then PAT is disabled by default, unless enabled by an enterprise administrator. If PAT is disabled, you won't be able to use PAT authentication. If you have OAuth access policy restrictions, you will need the OAuth App for each client (MCP host application) to be enabled (except Visual Studio Code and Visual Studio).

For information on setting up the GitHub MCP server locally, see the GitHub MCP server repository.

Remote MCP server configuration with OAuth

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 Eclipse.

  1. Clique no ícone Copilot () na barra de status na parte inferior do Eclipse.

  2. No menu, selecione Abrir Chat e, na janela de chat, clique no ícone "Configurar Ferramentas...".

    • Como alternativa, você pode selecionar Editar preferências e, em seguida, no painel à esquerda, expandir GitHub Copilot e clicar em MCP.
  3. Add the following configuration under "Server Configurations":

    JSON
    {
      "servers": {
          "github": {
              "type": "http",
              "url": "https://api.githubcopilot.com/mcp/"
          }
      }
    }
    
  4. Click Apply.

  5. In the "GitHub Copilot" popup that says the "MCP Server Definition wants to authenticate to GitHub", click OK.

  6. If you have not yet authorized the GitHub Copilot plugin, in the browser popup, click Continue next to your personal account.

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 Gerenciar seus tokens de acesso pessoal.

  1. Clique no ícone Copilot () na barra de status na parte inferior do Eclipse.
  2. No menu, selecione Abrir Chat e, na janela de chat, clique no ícone "Configurar Ferramentas...".
    • Como alternativa, você pode selecionar Editar preferências e, em seguida, no painel à esquerda, expandir GitHub Copilot e clicar em MCP.
  3. Add the following configuration under "Server Configurations", 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"
                }
            }
        }
    }
  }

Enterprise configuration

If you are using GitHub Enterprise Server or GitHub Enterprise Cloud with data residency, additional configuration is required. For more information, see Configuring the GitHub MCP Server for GitHub Enterprise.

Next steps