home / mcp / github mcp server

GitHub MCP Server

MCP server providing GitHub API functionality for file ops, repo management, search, and more.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "asbloom-py-mcp-servers": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-github"
      ],
      "env": {
        "GITHUB_PERSONAL_ACCESS_TOKEN": "<YOUR_TOKEN>"
      }
    }
  }
}

You can use the GitHub MCP Server to automate and extend your interactions with GitHub — from creating or updating files and managing repositories to searching code, issues, and users. This server exposes a rich set of endpoints you can drive from any MCP client to perform common GitHub workflows with proper history and error handling.

How to use

You interact with the GitHub MCP Server through an MCP client. Use the provided tools to perform file operations, manage repositories, create issues and pull requests, fork repositories, and run code searches across repositories. Every action preserves Git history and supports batch operations when pushing multiple files.

How to install

Prerequisites: Node.js installed on your machine. You can verify by running node -v and npm -v.

Install and run the MCP client configuration locally using the included example setup for Claude Desktop.

Create the Claude Desktop MCP configuration snippet with your GitHub personal access token.

{
  "mcpServers": {
    "github": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-github"
      ],
      "env": {
        "GITHUB_PERSONAL_ACCESS_TOKEN": "<YOUR_TOKEN>"
      }
    }
  }
}

Configuration and security

The GitHub MCP Server requires a GitHub access token with the appropriate permissions. Keep this token secret and do not expose it in client logs or shared configurations.

Environment variables shown in the example include GITHUB_PERSONAL_ACCESS_TOKEN. You should replace <YOUR_TOKEN> with a token that you generate with the necessary repo scope or public_repo scope if only public repositories are accessed.

Available tools

create_or_update_file

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

push_files

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

search_repositories

Search for GitHub repositories using a query, with optional pagination.

create_repository

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

get_file_contents

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

create_issue

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

create_pull_request

Create a new pull request with title, body, head, base, and optional draft and maintainer modification rights.

fork_repository

Fork a repository, optionally into an organization.

create_branch

Create a new branch from a source branch.

list_issues

List and filter issues for a repository by state, labels, sort, direction, and date.

update_issue

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

add_issue_comment

Add a comment to an issue or pull request.

search_code

Search code across repositories using GitHub code search syntax.

search_issues

Search for issues and pull requests using GitHub issues search syntax.

search_users

Search for GitHub users using the GitHub users search syntax.

list_commits

Retrieve commits for a branch in a repository.

get_issue

Get details for a specific issue.

get_issue_comments

Retrieve comments on an issue or pull request.