MCP Hub
Back to servers

GitHub MCP Server

A Python-based Model Context Protocol server that provides 87 tools for comprehensive interaction with the GitHub API. It enables AI agents to manage repositories, issues, pull requests, workflows, and projects through automated commands.

Updated
Feb 23, 2026

GitHub MCP Server

A comprehensive Model Context Protocol (MCP) server for the GitHub API, built with Python and the official MCP SDK.

This server exposes 87 tools across 25 categories, enabling AI agents like Claude to interact with GitHub repositories, issues, pull requests, discussions, projects, and more.

Features

CategoryToolsDescription
Repositories7List, get, create, fork repos; list commits; get commit details; get file contents
Issues6List, get, create, update issues; manage comments
Pull Requests8List, get, create, update, merge PRs; view files/commits; update branch
Search4Search repositories, code, issues, and users
Actions4List workflows/runs, trigger workflows, cancel runs
Releases4List, get latest, create releases; get release by tag
Tags2List tags, get annotated tag details
Git2Get repository tree, push multiple files in a single commit
Organizations3List orgs, get details, list members
Branches3List, create, delete branches
Branch Protection3Get, update, delete branch protection rules
Webhooks3List, create, delete repository webhooks
Files2Create/update and delete files via the Contents API
PR Reviews2Create and list pull request reviews
Review Comments3List, create, reply to PR review comments
Commit Statuses4List/create commit statuses; list/get check runs
Labels3List, create, delete repository labels
Gists4List, get, create, update gists
Stars3List starred repos, star/unstar repositories
Users2Get authenticated user info, get any user's profile
Notifications3List notifications, mark as read
Collaborators3List, add, remove repository collaborators
Discussions4List, get discussions; view comments; list categories (GraphQL)
Projects (Classic)2List repository and organization projects
Projects V23List, get projects; list project items (GraphQL)

Requirements

Installation

git clone https://github.com/software-engineer-mj/github-mcp.git
cd github-mcp
uv sync

Configuration

cp .env.example .env

Edit the .env file:

GITHUB_TOKEN=ghp_your_token_here

Token Permissions

Depending on which tools you use, your token needs these scopes:

ScopeRequired For
repoRepositories, issues, PRs, branches, webhooks, collaborators, files, tags, git
read:orgOrganizations, org members, org projects
gistGists
notificationsNotifications
userAuthenticated user info, starring
workflowGitHub Actions (trigger, cancel)
read:discussionDiscussions
projectProjects (Classic), Projects V2

Usage

stdio (default)

uv run python -m github_mcp

Docker

docker build -t github-mcp .

docker run -e GITHUB_TOKEN=ghp_your_token github-mcp

MCP Client Configuration

Claude Desktop

Add to claude_desktop_config.json:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json Windows: %APPDATA%\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "github": {
      "command": "uv",
      "args": ["run", "--directory", "/path/to/github-mcp", "python", "-m", "github_mcp"],
      "env": {
        "GITHUB_TOKEN": "ghp_your_token_here"
      }
    }
  }
}

Claude Code

Add to .mcp.json:

{
  "mcpServers": {
    "github": {
      "command": "uv",
      "args": ["run", "--directory", "/path/to/github-mcp", "python", "-m", "github_mcp"],
      "env": {
        "GITHUB_TOKEN": "ghp_your_token_here"
      }
    }
  }
}

Development

# Install with dev dependencies
uv sync --dev

# Run tests
uv run pytest tests/ -v

# Lint
uv run ruff check src/ tests/

# Format
uv run ruff format src/ tests/

# Type check
uv run mypy src/

Tool Reference

Repositories

ToolDescription
list_repositoriesList repositories for a user or organization
get_repositoryGet detailed repository information
create_repositoryCreate a new repository
fork_repositoryFork a repository
list_commitsList commits with optional filters (author, date range)
get_commitGet commit details including stats and changed files
get_file_contentsGet file contents or directory listing

Issues

ToolDescription
list_issuesList issues with filters (state, labels, assignee)
get_issueGet detailed issue information
create_issueCreate a new issue
update_issueUpdate issue title, body, state, labels, assignees
list_issue_commentsList comments on an issue
create_issue_commentAdd a comment to an issue

Pull Requests

ToolDescription
list_pull_requestsList PRs with filters (state, base, head)
get_pull_requestGet detailed PR info including mergeable status
create_pull_requestCreate a new pull request
update_pull_requestUpdate PR title, body, state, base branch
merge_pull_requestMerge a PR (merge, squash, or rebase)
list_pr_filesList files changed in a PR
list_pr_commitsList commits in a PR
update_pull_request_branchUpdate a PR branch with the latest base branch changes

Search

ToolDescription
search_repositoriesSearch repos by name, language, stars, topics
search_codeSearch code across repositories
search_issuesSearch issues and PRs across GitHub
search_usersSearch users by name, location, followers

Actions

ToolDescription
list_workflowsList GitHub Actions workflows
list_workflow_runsList workflow runs with status filters
trigger_workflowTrigger a workflow dispatch event
cancel_workflow_runCancel a running workflow

Releases

ToolDescription
list_releasesList releases in a repository
get_latest_releaseGet the latest published release
create_releaseCreate a new release with tag
get_release_by_tagGet a release by its tag name

Tags

ToolDescription
list_tagsList tags in a repository
get_tagGet an annotated tag object by SHA

Git

ToolDescription
get_repository_treeGet repository tree (directory listing) by SHA or branch
push_filesPush multiple files in a single commit via Git Data API

Organizations

ToolDescription
list_user_orgsList authenticated user's organizations
get_organizationGet organization details
list_org_membersList organization members

Branches

ToolDescription
list_branchesList branches in a repository
create_branchCreate a new branch from an existing one
delete_branchDelete a branch

Branch Protection

ToolDescription
get_branch_protectionGet branch protection rules
update_branch_protectionUpdate branch protection settings
delete_branch_protectionDelete branch protection

Webhooks

ToolDescription
list_webhooksList repository webhooks
create_webhookCreate a webhook with event subscriptions
delete_webhookDelete a webhook

Files

ToolDescription
create_or_update_fileCreate or update a file (requires SHA for updates)
delete_fileDelete a file from a repository

PR Reviews

ToolDescription
create_pr_reviewSubmit a review (APPROVE, REQUEST_CHANGES, COMMENT)
list_pr_reviewsList reviews on a pull request

Review Comments

ToolDescription
list_review_commentsList review comments on a pull request
create_review_commentCreate a review comment (line, multiline, or file)
reply_to_review_commentReply to an existing review comment

Commit Statuses

ToolDescription
list_commit_statusesList commit statuses for a ref
create_commit_statusCreate a commit status (pending, success, failure, error)
list_check_runsList check runs for a ref
get_check_runGet details of a specific check run

Labels

ToolDescription
list_labelsList repository labels
create_labelCreate a label with color and description
delete_labelDelete a label

Gists

ToolDescription
list_gistsList gists for a user or authenticated user
get_gistGet gist details with file contents
create_gistCreate a new gist with multiple files
update_gistUpdate gist description, files, or delete files

Stars

ToolDescription
list_starred_reposList starred repositories
star_repositoryStar a repository
unstar_repositoryUnstar a repository

Users

ToolDescription
get_authenticated_userGet current authenticated user's profile
get_userGet any GitHub user's public profile

Notifications

ToolDescription
list_notificationsList notifications with filters
mark_notifications_readMark all notifications as read
mark_thread_readMark a specific notification thread as read

Collaborators

ToolDescription
list_collaboratorsList repository collaborators
add_collaboratorAdd a collaborator with permission level
remove_collaboratorRemove a collaborator

Discussions

ToolDescription
list_discussionsList discussions in a repository
get_discussionGet details of a specific discussion
get_discussion_commentsGet comments on a discussion with replies
list_discussion_categoriesList discussion categories for a repository

Projects (Classic)

ToolDescription
list_repo_projectsList repository projects (classic)
list_org_projectsList organization projects (classic)

Projects V2

ToolDescription
list_projects_v2List Projects V2 for an organization or user
get_project_v2Get details of a specific Project V2
list_project_v2_itemsList items (issues, PRs, drafts) in a Project V2

Project Structure

src/github_mcp/
├── __init__.py              # FastMCP server instance
├── __main__.py              # Entry point with auto-discovery
├── client.py                # Async GitHub API HTTP client (httpx)
├── exceptions.py            # Custom exception hierarchy
├── validators.py            # Input validation (enum, clamping)
└── tools/
    ├── __init__.py
    ├── actions.py            # GitHub Actions workflows
    ├── branch_protection.py  # Branch protection rules
    ├── branches.py           # Branch management
    ├── collaborators.py      # Collaborator management
    ├── commit_statuses.py    # Commit statuses and check runs
    ├── discussions.py        # Discussions (GraphQL)
    ├── files.py              # File create/update/delete
    ├── gists.py              # Gist operations
    ├── git.py                # Git Data API (tree, push files)
    ├── issues.py             # Issue operations
    ├── labels.py             # Label management
    ├── notifications.py      # Notification management
    ├── organizations.py      # Organization operations
    ├── projects.py           # Classic project boards
    ├── projects_v2.py        # Projects V2 (GraphQL)
    ├── pull_requests.py      # Pull request operations
    ├── releases.py           # Release management
    ├── repositories.py       # Repository operations
    ├── review_comments.py    # PR review comments
    ├── reviews.py            # PR review operations
    ├── search.py             # GitHub search
    ├── stars.py              # Star/unstar repositories
    ├── tags.py               # Tag operations
    ├── users.py              # User profile operations
    └── webhooks.py           # Webhook management
tests/
├── conftest.py              # Shared fixtures (mock GitHub client)
├── test_client.py           # HTTP client, retry, cache, error tests
├── test_exceptions.py       # Exception hierarchy tests
├── test_server.py           # Tool registration tests
├── test_validators.py       # Validator tests
└── tools/
    ├── conftest.py
    └── test_<domain>.py      # Tests matching each tool module

License

MIT - see LICENSE for details.

Reviews

No reviews yet

Sign in to write a review