home / mcp / github mcp server

GitHub MCP Server

MCP server exposing GitHub actions for files, repositories, issues, PRs, and search

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "alexkissijr-unreal-mcp-server": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "GITHUB_PERSONAL_ACCESS_TOKEN",
        "mcp/github"
      ],
      "env": {
        "GITHUB_PERSONAL_ACCESS_TOKEN": "<YOUR_TOKEN>"
      }
    }
  }
}

This MCP Server provides programmatic access to the GitHub API for performing file operations, repository management, search, issues, pull requests, and more. It enables automated workflows by exposing repository actions through a standardized MCP interface, preserving Git history and supporting batch operations.

How to use

Use the MCP server with a client that supports MCP to perform GitHub-related actions such as creating or updating files, pushing multiple files in a single commit, managing issues and pull requests, and searching repositories, code, issues, and users. The MCP server can be run locally or connected remotely; auth is typically provided via a GitHub personal access token.

How to install

Prerequisites: Node.js and npm or a runtime that supports MCP servers. If you plan to run the provided microserver via Docker, ensure Docker is installed. If you prefer an NPX-based start, ensure npm is installed as well.

# Prerequisites
node -v
npm -v
# Optional: Docker if using the Docker-based runtime
docker -v

Additional setup notes

The README provides two concrete ways to run the GitHub MCP Server. Both methods require a GitHub Personal Access Token with appropriate permissions. Replace <YOUR_TOKEN> with your actual token in configuration examples.

Configuration and environment

Environment variables required by the examples are shown in the code blocks. The main variable is GITHUB_PERSONAL_ACCESS_TOKEN, which must be supplied with a token that has the necessary repository permissions.

Available tools

create_or_update_file

Create or update a single file in a repository. Requires owner, repo, path, content, message, and branch. Optional sha for updates.

push_files

Push multiple files in a single commit. Requires owner, repo, branch, files (with path and content), and a commit message.

search_repositories

Search for GitHub repositories based on a query with optional pagination.

create_repository

Create a new GitHub repository with name, optional description, privacy option, and auto-initialization.

get_file_contents

Get contents of a file or directory at a given path and branch.

create_issue

Create a new issue with optional body, assignees, labels, and milestone.

create_pull_request

Create a pull request with title, body, head, base, and optional draft and maintainer-edit settings.

fork_repository

Fork a repository into the same user or an organization.

create_branch

Create a new branch from a specified source branch.

list_issues

List and filter repository issues by state, labels, sort, and pagination.

update_issue

Update an existing issue with new title, body, state, labels, assignees, and milestone.

add_issue_comment

Add a comment to an issue.

search_code

Search code across repositories with optional sort and pagination.

search_issues

Search for issues and pull requests with sorting and pagination.

search_users

Search for GitHub users with optional sort and pagination.

list_commits

List commits on a branch with pagination support.

get_issue

Retrieve details of a specific issue.

get_pull_request

Get details of a specific pull request including diff and reviews.

list_pull_requests

List and filter pull requests by state, head, base, sort, and pagination.

create_pull_request_review

Create a review on a pull request with a body, event, and optional comments.

merge_pull_request

Merge a pull request with optional title, message, and method.

get_pull_request_files

Get the list of files changed in a pull request.

get_pull_request_status

Get the combined status of all checks for a pull request.

update_pull_request_branch

Update a PR branch with the latest changes from the base branch.

get_pull_request_comments

Get review comments on a pull request.

get_pull_request_reviews

Get reviews on a pull request.