Home / MCP / GitHub MCP Server

GitHub MCP Server

Connect AI tools to GitHub data and actions for code reading, issue/PR automation, and workflow insights.

javascript
25.0kstars
Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
    "mcpServers": {
        "github_mcp_http": {
            "url": "https://api.githubcopilot.com/mcp/"
        }
    }
}

You can connect your AI tools directly to GitHub to read repositories, analyze code, manage issues and pull requests, and automate workflows. This MCP server lets you interact with GitHub data and actions through simple natural language prompts and agent workflows, making it faster to perform code review, project management, and CI/CD insights.

How to use

You use an MCP client to talk to the GitHub MCP Server. Start the remote server to access GitHub data via HTTP, or run a local MCP server instance to host it on your machine. With the MCP server running, you can ask your AI tools to browse repositories, inspect files, create or comment on issues and pull requests, and monitor workflows and security alerts. The server exposes a wide set of tools that map to GitHub capabilities, so you can perform complex, multi-step tasks through natural language.

How to install

Prerequisites: you need Docker installed and running on your machine. You also need a GitHub Personal Access Token with appropriate scopes for the actions you want to allow your AI tools to perform.

{
  "mcp": {
    "servers": {
      "github_http": {
        "type": "http",
        "url": "https://api.githubcopilot.com/mcp/",
        "args": []
      },
      "github_local": {
        "type": "stdio",
        "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}"
        }
      }
    }
  }
}

Configuration notes

HTTP remote server is hosted by the GitHub MCP provider and can be used if your MCP host supports remote systems. Local hosting via Docker lets you run the server on your own machine using your GitHub Personal Access Token. Each host configuration may require a GitHub App or OAuth App to enable remote access.

Security and tips

Treat your GitHub Personal Access Token as a sensitive secret. Use the minimum scopes you need, rotate tokens regularly, and avoid embedding tokens directly in files that can be committed. Prefer environment variables or secret managers to supply tokens to the MCP server configuration.

Example setup flow

1. Install Docker and start the Docker daemon on your machine.

2. Create a GitHub Personal Access Token with the required permissions for your use case.

3. Create a configuration that includes both the HTTP remote server URL and a local Docker-based MCP server definition. Ensure your environment references the PAT securely.

4. Start your MCP client and point it to one of the configured MCP servers. Begin by asking your agent to query repositories, inspect code, or manage issues.

Notes on usage with VS Code and other hosts

You can use one-click install flows or manually configure MCP hosts in IDEs that support MCP. If you configure manually, use the JSON blocks shown above to declare the servers and environment variables.

Available tools

get_repository_tree

Get repository tree for a given owner/repo, path, and tree SHA to inspect file structures.

get_file_contents

Fetch file or directory contents from a repository, with optional ref and sha to specify the exact version.

list_issues

List issues with filters for labels, state, and date range, and support pagination.

create_pull_request

Open a new pull request with specified base, head, title, and optional body/draft state.

list_pull_requests

List pull requests with filtering by base/head, state, and pagination.

get_workflow_run

Retrieve details about a specific GitHub Actions workflow run.

list_workflows

List workflows in a repository with pagination.

get_label

Get a specific label from a repository by name.

label_write

Create, update, or delete a label on a repository with color and description options.

get_me

Get the authenticated user profile.

search_issues

Search issues across repositories using GitHub's search syntax.

list_gists

List gists for a user and support creation/updating of gists.

download_workflow_run_artifact

Download artifacts produced by a workflow run.