GitHub MCP Server

GitHub MCP Server

Featured
Developer
GitHub
claudecursorvscodecodexgeneric
FreeOpen Source

About This Server

GitHub's official MCP server. Lets AI agents manage repositories, issues, pull requests and GitHub Actions directly, with both remote-hosted and local modes.

Installation

claude mcp add --transport http github https://api.githubcopilot.com/mcp/
Official README installation guide

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:

json
{
  "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):

json
{
  "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.

<details>

<summary><b>Example JSON block without the MCP key included</b></summary>

<br>

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

</details>

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:

JSON
{
  "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):

bash
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

Frequently Asked Questions

What can AI agents do with the GitHub MCP Server?

It is GitHub's official MCP server. AI agents can read and write repositories, manage issues and pull requests, inspect CI runs and search code — bringing the whole GitHub workflow into the conversation.

How do I install the GitHub MCP Server in Claude Code?

The recommended way is the hosted endpoint: claude mcp add --transport http github https://api.githubcopilot.com/mcp/, then complete the GitHub OAuth flow. No local deployment needed; a Docker-based local version is also available.

Is the GitHub MCP Server free?

The server itself is free and open source (MIT). The hosted endpoint is free for GitHub accounts, with permissions following your GitHub authorization scope. Grant the minimum necessary access when working with private repositories.