← プロジェクト一覧に戻る

github-mcp-server

GitHub公式のMCPサーバー。クローンせずにAPI経由でIssueやPull Request、Actionsを操作させます

MCPサーバー公式MIT
スター
32.6k
フォーク
4.9k
オープンIssue
332
最終コミット
2026年8月28日

github-mcp-serverとは

MCPに対応したクライアントからつなぐと、Issueの仕分け、Pull Requestの作成とレビュー、コードやコミット履歴の検索、失敗したActionsのログ確認までを、リポジトリをクローンせずGitHub API経由で任せられます。GitHubがホストするリモートサーバーはURLを設定するだけで動き、同じソフトウェアをコンテナや1つのバイナリとしてローカルで動かすこともできます。GitHub Enterprise Serverではリモートサーバーが提供されないため、ローカルで動かす方法だけが選択肢になります。悩ましいのは道具の多さで、20あまりのツールセットに80を超えるツールが並び、既定で有効になるのは5つのツールセットに絞られています。全部を有効にすると選択肢が増えすぎて、モデルがツールを選び損ねます。

github-mcp-serverで何ができますか?

  • Issueを読むところからPull Requestのマージまで — Issueとそのコメント、親子関係にあるIssueをまとめて読み、ラベルや担当者、マイルストーンを付け替え、Pull Requestを作ってレビューコメントを残し、マージするところまで任せられます。ブランチを作って複数のファイルを1つのコミットにまとめて送ることもできるので、一行の修正のために作業コピーを用意せずに済みます。
  • クローンせずにコードと履歴を調べる — コード検索、コミット検索、ファイルの取得は認証情報が届くリポジトリすべてに使えるため、手元にないコードベースについても質問できます。ファイル一覧を先に読ませておくと、モデルが当てずっぽうのパスを指定して空振りする回数が減ります。
  • 落ちたビルドをログまで追う — ワークフロー、その実行、実行の中のジョブを順に一覧でき、1回の実行のうち失敗したジョブのログだけをまとめて取得できます。末尾の行数を指定して切り詰められるため、CIのログ全文で会話が埋まることがありません。
  • 使わないツールを外す — 20あまりあるツールセットのうち既定で有効なのは5つで、必要なものを指定したうえで個別のツールを足したり、特定のツールだけを除いたりできます。リモートサーバーでも同じ指定をURLのパスやリクエストヘッダーで行えます。数を絞るほどモデルのツール選択は正確になり、消費する文脈も減ります。
  • 見えるツールは認証情報によって変わる — 従来型の個人アクセストークンでは、起動時にトークンの権限を読み取り、どうせ使えないツールをあらかじめ隠します。権限を読み取れない種類のトークン、つまりリポジトリ単位で権限を選ぶ新しい形式やGitHub Appのトークンでは全ツールがそのまま並び、権限のない操作はAPIまで届いてエラーになります。リモートサーバーでブラウザーからログインする場合は、ツールが必要とした時点で追加の権限承認を求められます。
  • 読み取り専用モードと、公開リポジトリ向けのロックダウンモード — 読み取り専用にすると書き込み系のツールが一律で外れ、個別に指定したツールよりも優先されるため、見るだけで触らせない運用ができます。ロックダウンモードは公開リポジトリだけを対象に、書き込み権限のない人が書いたIssueやPull Requestの本文をエラーとして返し、そのコメントやレビューを一覧から取り除きます。見知らぬ第三者の書き込みがそのままエージェントへの指示として流れ込む事故を防ぐ仕組みで、非公開リポジトリの見え方は変わりません。

github-mcp-serverを選ぶ前に

  • サーバー側にリポジトリを絞る設定はなく、渡した認証情報が届く範囲すべてに手が届くため、対象を限るのは権限を絞ったトークンか、そのリポジトリにだけ入れたGitHub Appという認証情報側の作業になります。
  • 非公開リポジトリのIssueやPull Requestに添付された画像は、ログイン済みのブラウザーでしか開けないリンクとして返り、2026年8月時点でそれを取得するツールはありません。報告#807

スター推移

8月17日〜8月28日 · +274

32.3k32.6k

よくある質問

github-mcp-serverは商用利用できますか?

github-mcp-serverはMITライセンスで公開されています。OSI承認のオープンソースライセンスで、商用利用が認められています。

github-mcp-serverはどの形で使えますか?

github-mcp-serverはローカル実行・マネージドクラウド・セルフホストの形で利用できます。

ドキュメント

github/github-mcp-server のREADMEより転載(MIT)。 原文を読む ↗

Go Report Card

GitHub MCP Server

The GitHub MCP Server connects AI tools directly to GitHub’s platform. This gives AI agents, assistants, and chatbots the ability to read repositories and code files, manage issues and PRs, analyze code, and automate workflows. All through natural language interactions.

Use Cases

  • Repository Management: Browse and query code, search files, analyze commits, and understand project structure across any repository you have access to.
  • Issue & PR Automation: Create, update, and manage issues and pull requests. Let AI help triage bugs, review code changes, and maintain project boards.
  • CI/CD & Workflow Intelligence: Monitor GitHub Actions workflow runs, analyze build failures, manage releases, and get insights into your development pipeline.
  • Code Analysis: Examine security findings, review Dependabot alerts, understand code patterns, and get comprehensive insights into your codebase.
  • Team Collaboration: Access discussions, manage notifications, analyze team activity, and streamline processes for your team.

Built for developers who want to connect their AI tools to GitHub context and capabilities, from simple natural language queries to complex multi-step agent workflows.


Remote GitHub MCP Server

The remote GitHub MCP Server is hosted by GitHub and provides the easiest method for getting up and running. If your MCP host does not support remote MCP servers, don’t worry! You can use the local version of the GitHub MCP Server instead.

Prerequisites

  1. A compatible MCP host with remote server support (VS Code 1.101+, Claude Desktop, Cursor, Windsurf, etc.)
  2. Any applicable policies enabled

Install in VS Code

For quick installation, use one of the one-click install buttons above. Once you complete that flow, toggle Agent mode (located by the Copilot Chat text input) and the server will start. Make sure you’re using VS Code 1.101 or later for remote MCP and OAuth support.

Alternatively, to manually configure VS Code, choose the appropriate JSON block from the examples below and add it to your host configuration:

{
  "servers": {
    "github": {
      "type": "http",
      "url": "https://api.githubcopilot.com/mcp/"
    }
  }
}
{
  "servers": {
    "github": {
      "type": "http",
      "url": "https://api.githubcopilot.com/mcp/",
      "headers": {
        "Authorization": "Bearer ${input:github_mcp_pat}"
      }
    }
  },
  "inputs": [
    {
      "type": "promptString",
      "id": "github_mcp_pat",
      "description": "GitHub Personal Access Token",
      "password": true
    }
  ]
}

Install in other MCP hosts

  • Copilot CLI - Installation guide for GitHub Copilot CLI
  • GitHub Copilot in other IDEs - Installation for JetBrains, Visual Studio, Eclipse, and Xcode with GitHub Copilot
  • Claude Applications - Installation guide for Claude Desktop and Claude Code CLI
  • Codex - Installation guide for OpenAI Codex
  • Cursor - Installation guide for Cursor IDE
  • OpenCode - Installation guide for the OpenCode terminal agent
  • Windsurf - Installation guide for Windsurf IDE
  • Zed - Installation guide for Zed editor
  • Rovo Dev CLI - Installation guide for Rovo Dev CLI

Note: Each MCP host application needs to configure a GitHub App or OAuth App to support remote access via OAuth. Any host application that supports remote MCP servers should support the remote GitHub server with PAT authentication. Configuration details and support levels vary by host. Make sure to refer to the host application’s documentation for more info.

Configuration

Toolset configuration

See Remote Server Documentation for full details on remote server configuration, toolsets, headers, and advanced usage. This file provides comprehensive instructions and examples for connecting, customizing, and installing the remote GitHub MCP Server in VS Code and other MCP hosts.

When no toolsets are specified, default toolsets are used.

Insiders Mode

Try new features early! The remote server offers an insiders version with early access to new features and experimental tools.

{
  "servers": {
    "github": {
      "type": "http",
      "url": "https://api.githubcopilot.com/mcp/insiders"
    }
  }
}
{
  "servers": {
    "github": {
      "type": "http",
      "url": "https://api.githubcopilot.com/mcp/",
      "headers": {
        "X-MCP-Insiders": "true"
      }
    }
  }
}

See Remote Server Documentation for more details and examples, and Insiders Features for a full list of what’s available.

GitHub Enterprise

GitHub Enterprise Cloud with data residency (ghe.com)

GitHub Enterprise Cloud can also make use of the remote server.

Example for https://octocorp.ghe.com with GitHub PAT token:

{
    ...
    "github-octocorp": {
      "type": "http",
      "url": "https://copilot-api.octocorp.ghe.com/mcp",
      "headers": {
        "Authorization": "Bearer ${input:github_mcp_pat}"
      }
    },
    ...
}

Note: When using OAuth with GitHub Enterprise with VS Code and GitHub Copilot, you also need to configure your VS Code settings to point to your GitHub Enterprise instance - see Authenticate from VS Code

GitHub Enterprise Server

GitHub Enterprise Server does not support remote server hosting. Please refer to GitHub Enterprise Server and Enterprise Cloud with data residency (ghe.com) from the local server configuration.


Local GitHub MCP Server

Prerequisites

  1. To run the server in a container, you will need to have Docker installed.

  2. Once Docker is installed, you will also need to ensure Docker is running. The Docker image is available at ghcr.io/github/github-mcp-server. The image is public; if you get errors on pull, you may have an expired token and need to docker logout ghcr.io.

  3. Authentication. On github.com you don’t need to create anything up front — the one-click buttons above log you in with OAuth on first use (a browser-based flow; the token is kept in memory only). The Docker buttons publish a fixed callback port (127.0.0.1:8085) so the container’s login callback is reachable. See Local Server OAuth Login for how it works, headless/device-code fallback, and bringing your own OAuth or GitHub App (required for GitHub Enterprise Server and ghe.com).

    Prefer a token? You can still authenticate with a GitHub Personal Access Token by setting GITHUB_PERSONAL_ACCESS_TOKEN instead (it takes precedence over OAuth). The MCP server can use many of the GitHub APIs, so enable the permissions that you feel comfortable granting your AI tools (to learn more about access tokens, please check out the documentation).

To keep your GitHub PAT secure and reusable across different MCP hosts:

  1. Store your PAT in environment variables

    export GITHUB_PAT=your_token_here

    Or create a .env file:

    GITHUB_PAT=your_token_here
  2. Protect your .env file

    # Add to .gitignore to prevent accidental commits
    echo ".env" >> .gitignore
  3. Reference the token in configurations

    # CLI usage
    claude mcp add github -e GITHUB_PERSONAL_ACCESS_TOKEN=$GITHUB_PAT -- docker run -i --rm -e GITHUB_PERSONAL_ACCESS_TOKEN ghcr.io/github/github-mcp-server
    
    # In config files (where supported)
    "env": {
      "GITHUB_PERSONAL_ACCESS_TOKEN": "$GITHUB_PAT"
    }

Note: Environment variable support varies by host app and IDE. Some applications (like Windsurf) require hardcoded tokens in config files.

Token Security Best Practices

  • Minimum scopes: Only grant necessary permissions

    • repo - Repository operations
    • read:packages - Docker image access
    • read:org - Organization team access
  • Separate tokens: Use different PATs for different projects/environments

  • Regular rotation: Update tokens periodically

  • Never commit: Keep tokens out of version control

  • File permissions: Restrict access to config files containing tokens

    chmod 600 ~/.your-app/config.json

GitHub Enterprise Server and Enterprise Cloud with data residency (ghe.com)

The flag --gh-host and the environment variable GITHUB_HOST can be used to set the hostname for GitHub Enterprise Server or GitHub Enterprise Cloud with data residency.

  • For GitHub Enterprise Server, prefix the hostname with the https:// URI scheme. HTTPS is required and enforced: non-HTTPS hosts are refused so that credentials are never sent over cleartext (the only exception is a loopback host such as http://localhost for local development).
  • For GitHub Enterprise Cloud with data residency, use https://YOURSUBDOMAIN.ghe.com as the hostname.
"github": {
    "command": "docker",
    "args": [
    "run",
    "-i",
    "--rm",
    "-e",
    "GITHUB_PERSONAL_ACCESS_TOKEN",
    "-e",
    "GITHUB_HOST",
    "ghcr.io/github/github-mcp-server"
    ],
    "env": {
        "GITHUB_PERSONAL_ACCESS_TOKEN": "${input:github_token}",
        "GITHUB_HOST": "https://<your GHES or ghe.com domain name>"
    }
}

Installation

Install in GitHub Copilot on VS Code

For quick installation, use one of the one-click install buttons above. Once you complete that flow, toggle Agent mode (located by the Copilot Chat text input) and the server will start.

More about using MCP server tools in VS Code’s agent mode documentation.

Install in GitHub Copilot on other IDEs (JetBrains, Visual Studio, Eclipse, etc.)

Add one of the following JSON blocks to your IDE’s MCP settings.

Log in with OAuth (no token to create or store). On github.com the official image already includes the app credentials, so you provide none yourself: it runs a browser-based login on first use and keeps the resulting token in memory only. In Docker this needs a fixed callback port published to loopback so the container’s login callback is reachable:

{
  "mcp": {
    "servers": {
      "github": {
        "command": "docker",
        "args": [
          "run",
          "-i",
          "--rm",
          "-p",
          "127.0.0.1:8085:8085",
          "-e",
          "GITHUB_OAUTH_CALLBACK_PORT",
          "ghcr.io/github/github-mcp-server"
        ],
        "env": {
          "GITHUB_OAUTH_CALLBACK_PORT": "8085"
        }
      }
    }
  }
}

See Local Server OAuth Login for the native-binary flow (no fixed port needed), the headless/device-code fallback, GitHub Enterprise Server / ghe.com, and bringing your own OAuth or GitHub App.

For non-interactive stdio deployments, see GitHub App Authentication.

Or authenticate with a Personal Access Token. Set GITHUB_PERSONAL_ACCESS_TOKEN instead (it takes precedence over OAuth):

{
  "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}"
        }
      }
    }
  }
}

Optionally, you can add a similar example (i.e. without the mcp key) to a file called .vscode/mcp.json in your workspace. This will allow you to share the configuration with other host applications that accept the same format.

{
  "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}"
      }
    }
  }
}

Install in Other MCP Hosts

For other MCP host applications, please refer to our installation guides:

For a complete overview of all installation options, see our Installation Guides Index.

Note: Any host application that supports local MCP servers should be able to access the local GitHub MCP server. However, the specific configuration process, syntax and stability of the integration will vary by host application. While many may follow a similar format to the examples above, this is not guaranteed. Please refer to your host application’s documentation for the correct MCP configuration syntax and setup process.

Build from source

If you don’t have Docker, you can use go build to build the binary in the cmd/github-mcp-server directory, and use the github-mcp-server stdio command with the GITHUB_PERSONAL_ACCESS_TOKEN environment variable set to your token. To specify the output location of the build, use the -o flag. You should configure your server to use the built executable as its command. For example:

{
  "mcp": {
    "servers": {
      "github": {
        "command": "/path/to/github-mcp-server",
        "args": ["stdio"],
        "env": {
          "GITHUB_PERSONAL_ACCESS_TOKEN": "<YOUR_TOKEN>"
        }
      }
    }
  }
}

CLI utilities

The github-mcp-server binary includes a few CLI subcommands that are helpful for debugging and exploring the server.

  • github-mcp-server tool-search "<query>" searches tools by name, description, and input parameter names. Use --max-results to return more matches. Example (color output requires a TTY; use docker run -t (or -it) when running in Docker):
docker run -it --rm ghcr.io/github/github-mcp-server tool-search "issue" --max-results 5
github-mcp-server tool-search "issue" --max-results 5

Tool Configuration

The GitHub MCP Server supports enabling or disabling specific groups of functionalities via the --toolsets flag. This allows you to control which GitHub API capabilities are available to your AI tools. Enabling only the toolsets that you need can help the LLM with tool choice and reduce the context size.

Toolsets are not limited to Tools. Relevant MCP Resources and Prompts are also included where applicable.

When no toolsets are specified, default toolsets are used.

Looking for examples? See the Server Configuration Guide for common recipes like minimal setups, read-only mode, and combining tools with toolsets.

Specifying Toolsets

To specify toolsets you want available to the LLM, you can pass an allow-list in two ways:

  1. Using Command Line Argument:

    github-mcp-server --toolsets repos,issues,pull_requests,actions,code_security
  2. Using Environment Variable:

    GITHUB_TOOLSETS="repos,issues,pull_requests,actions,code_security" ./github-mcp-server

The environment variable GITHUB_TOOLSETS takes precedence over the command line argument if both are provided.

Specifying Individual Tools

You can also configure specific tools using the --tools flag. Tools can be used independently or combined with toolsets for fine-grained control.

  1. Using Command Line Argument:

    github-mcp-server --tools get_file_contents,issue_read,create_pull_request
  2. Using Environment Variable:

    GITHUB_TOOLS="get_file_contents,issue_read,create_pull_request" ./github-mcp-server
  3. Combining with Toolsets (additive):

    github-mcp-server --toolsets repos,issues --tools get_gist

    This registers all tools from repos and issues toolsets, plus get_gist.

Important Notes:

  • Tools and toolsets can be used together
  • Read-only mode takes priority: write tools are skipped if --read-only is set, even if explicitly requested via --tools
  • Tool names must match exactly (e.g., get_file_contents, not getFileContents). Invalid tool names will cause the server to fail at startup with an error message
  • When tools are renamed, old names are preserved as aliases for backward compatibility. See Tool Renaming for details.

Using Toolsets With Docker

When using Docker, you can pass the toolsets as environment variables:

docker run -i --rm \
  -e GITHUB_PERSONAL_ACCESS_TOKEN=<your-token> \
  -e GITHUB_TOOLSETS="repos,issues,pull_requests,actions,code_security" \
  ghcr.io/github/github-mcp-server

Using Tools With Docker

When using Docker, you can pass specific tools as environment variables. You can also combine tools with toolsets:

# Tools only
docker run -i --rm \
  -e GITHUB_PERSONAL_ACCESS_TOKEN=<your-token> \
  -e GITHUB_TOOLS="get_file_contents,issue_read,create_pull_request" \
  ghcr.io/github/github-mcp-server

このREADMEは一部を省略しています。全文はGitHubにあります。 原文を読む ↗

github-mcp-server
AIに聞く
GitHub