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 パブリック プレビュー and subject to change; use of the GitHub MCP server locally is generally available (GA).

While in パブリック プレビュー, 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.

GitHub MCP サーバーについて

GitHub MCP サーバーとは、GitHub によって提供および管理されるモデル コンテキスト プロトコル (MCP) サーバーです。 MCP を使うと、AI 機能を他のツールやサービスと統合し、コンテキスト対応の AI 支援を提供することで開発エクスペリエンスを強化できます。

MCP の詳細については、MCP 公式ドキュメントを参照してください。

GitHub MCP サーバーは、Visual Studio Code やリモート MCP をサポートする他のエディターを介してリモートでアクセスすることも、MCP と互換性のある任意のエディターを使ってローカル環境で実行することもでき、ホストされたソリューションの便利さと、セルフホステッド セットアップのカスタマイズしやすさのいずれかを選択できます。

リモートの GitHub MCP サーバーを利用する場合は、ローカル環境を設定することなく、数ステップで行うことができます。 これは、ローカル MCP サーバーを管理するオーバーヘッドなしに、GitHub の AI 機能をすぐにでも活用したいユーザーに特に便利です。

GitHub MCP サーバーをローカル環境で実行すると、さらに多くのセットアップが必要ですが、AI の対話をカスタマイズして制御できる範囲が広がります。

GitHub MCP サーバーを使うと次のことができます。

  • コード関連のタスクを自動化および効率化します。
  • サードパーティのツール (Cursor、Windsurf、将来の統合など) を接続して、GitHub のコンテキストと AI の機能を活用します。
  • ローカル環境を設定しないで、任意のデバイスから動作するクラウドベースのワークフローを有効にします。

可用性

現在、Visual Studio Code、JetBrains IDE、XCode、その他のクライアントで、ローカル MCP サーバーが幅広くサポートされています。

リモート MCP サーバーのサポートは増えており、Visual Studio Code (OAuth または PAT を使用)、Visual Studio (PAT のみ)、Windsurf (PAT のみ)、Cursor (PAT のみ) などのエディターでこの機能が既に提供されています。

好みのエディターでリモート MCP サーバーがサポートされているかどうかを調べるには、特定のエディターのドキュメントを確認してください。

前提条件

  • GitHub アカウント。
  • Visual Studio Code または別の 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 個人用アクセス トークンを管理する.

  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.

トラブルシューティング

GitHub MCP サーバーの使用中に問題が発生した場合は、いくつかの一般的なトラブルシューティング手順を実行できます。

承認の問題

MCP サーバーの認可で問題が発生した場合は、次のことを確認します。

  • 任意の IDE で GitHub にサインインしています。

personal access token (PAT) で認証を行っている場合は、次のことを確認します。

  • GitHub の PAT が有効であり、実行するアクションに必要なスコープを持っています。
  • Visual Studio Code で求められたときに、正しい PAT を入力しています。

Copilot エージェント モードの問題

Copilot Chat エージェント モードで問題が発生した場合は、次のことを確認します。

  • Copilot Chat ボックスで適切なエージェントを選択しています。
  • Visual Studio Code で MCP サーバーを正しく構成してあります。
  • 実行しようとしているアクションを実行するために必要なアクセス許可があります。

一般的なヒント

GitHub MCP サーバーで他の問題が発生する場合のトラブルシューティングに役立つ一般的なヒントを次に示します。

  • MCP サーバーの出力ログでエラー メッセージを調べます。
  • MCP サーバーをローカル環境で実行している場合は、ローカル環境が Docker コンテナーの実行用に正しく設定されていることを確認します。
  • MCP サーバーまたは IDE を再起動してみます。

Further reading