home / mcp / github mcp server

GitHub MCP Server

Provides an API bridge to GitHub enabling AI tools to read repos, manage issues/PRs, run workflows, and analyze code across your GitHub context.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "github-github-mcp-server": {
      "url": "https://api.githubcopilot.com/mcp/",
      "headers": {
        "GITHUB_PERSONAL_ACCESS_TOKEN": "<GITHUB_PERSONAL_ACCESS_TOKEN>"
      }
    }
  }
}

You can connect AI tools to GitHub to read repositories, analyze code, manage issues and pull requests, monitor workflows, and collaborate more effectively. This MCP Server acts as a bridge between your AI tooling and GitHub, enabling natural language interactions with GitHub data and actions across your authorized repositories.

How to use

You use the MCP Server by connecting an MCP host or IDE to the GitHub MCP Server endpoints. Once connected, you can run natural language queries to explore repositories, read files, list issues, trigger workflows, review code, manage pull requests, and surface security alerts. You can enable or disable groups of functionality with toolsets to tailor what your AI tools can do in GitHub.

How to install

Prerequisites and installation are described here. You will connect either a remote GitHub MCP Server or run a local MCP server instance and configure it in your MCP host or IDE.

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

Additional setup for local and remote servers

Remote server setup in IDEs like VS Code follows a JSON configuration block that points your host to the remote MCP endpoint. You may also enable an insiders version by using the insiders URL path. For local deployment, you can run the MCP server via Docker or build from source and execute the stdio mode. Ensure you store your GitHub Personal Access Token securely and reference it in your environment or configuration.

// Example: VS Code host configuration for a remote server
{
  "servers": {
    "github": {
      "type": "http",
      "url": "https://api.githubcopilot.com/mcp/"
    }
  }
}

Security and tokens

To authenticate with GitHub, you will typically use a GitHub Personal Access Token (PAT). Protect this token and avoid committing it to source control. Consider storing it in environment variables or a secrets manager and reference it in your MCP host configuration.

Available tools

actions_get

Get details of GitHub Actions resources such as workflows, workflow runs, jobs, and artifacts. Requires repo scope.

actions_list

List GitHub Actions workflows in a repository with pagination and optional filters.

get_repository_tree

Get the file tree of a repository with options to filter by path and recursive traversal.

create_pull_request

Open a new pull request with specified base, head, and title.

list_pull_requests

List pull requests for a repository with optional filters for base, head, state, and pagination.

pull_request_read

Get details about a pull request, including diff, status, files, reviews, and comments via different read modes.

get_file_contents

Retrieve the contents of a file or directory in a repository at a given ref.

get_latest_release

Fetch the latest release for a repository.

list_branches

List branches in a repository with pagination.

search_code

Search code across repositories using GitHub code search syntax.

search_repositories

Search repositories with filtering and sorting options.

label_write

Create, update, or delete labels in a repository.

list_notifications

List user notifications with filters for time, repository, and pagination.

get_me

Get the authenticated user's profile.

get_tag

Get tag details for a repository.

list_issues

List issues in a repository with filters for state, labels, and time.

issue_read

Read issue details, comments, and related data in a repository.

create_branch

Create a new branch in a repository.

get_commit

Get commit details with optional diff and stats.

get_file_contents

Retrieve file/directory contents at a specific ref.

get_latest_release

Get latest release information.

list_releases

List releases in a repository.

list_labels

List labels in a repository.

search_users

Search users with optional filters and sorting.