Skip to main content
Glama

GitHub MCP Server

Python MCP (Model Context Protocol) server for GitHub operations, providing native tool integration with Claude Code and other MCP clients.

Features

  • 16 GitHub Tools: Issues, PRs, CI status, milestones, and batch operations

  • Native MCP Integration: Works seamlessly with Claude Code

  • Structured Responses: Type-safe, well-formatted tool outputs

  • Batch Operations: Parallel execution for bulk operations

  • Environment-Based Config: Configure default repository via environment variables

Related MCP server: GitHub MCP Server

Installation

From PyPI

pip install github-mcp-server
# or with uv
uvx github-mcp-server

From Source

git clone https://github.com/rriesco/github-mcp-server.git
cd github-mcp-server
uv sync

Configuration

Environment Variables

Variable

Required

Description

GITHUB_TOKEN

Yes

GitHub Personal Access Token with repo scope

GITHUB_OWNER

No

Default repository owner for all operations

GITHUB_REPO

No

Default repository name for all operations

Claude Code Configuration

Add to your MCP configuration (~/.config/claude-code/mcp-config.json):

{
  "mcpServers": {
    "github-manager": {
      "type": "stdio",
      "command": "uvx",
      "args": ["github-mcp-server"],
      "env": {
        "GITHUB_TOKEN": "${GITHUB_TOKEN}",
        "GITHUB_OWNER": "your-username",
        "GITHUB_REPO": "your-repo"
      }
    }
  }
}

Getting a GitHub Token

  1. Go to https://github.com/settings/tokens

  2. Click "Generate new token (classic)"

  3. Select scope: repo (full repository access)

  4. Copy the generated token

Available Tools

Issue Operations

Tool

Description

create_issues

Create one or more issues (parallel execution for multiple)

get_issue

Get full issue details including body

list_issues

Query issues with filtering (state, labels, milestone, assignee)

close_issue

Close an issue with optional comment

Pull Request Operations

Tool

Description

create_pr_with_content

Create PR with structured content (problem, solution, changes)

get_pull_request

Get PR details including mergeable status

update_pr

Update PR title, body, base branch, or state

merge_pr

Merge PR with method selection (squash/merge/rebase)

CI/CD Operations

Tool

Description

check_ci_status

Check workflow run status for a branch

get_ci_logs

Get CI logs for debugging failed jobs

Batch Operations

Tool

Description

batch_update_issues

Update multiple issues in parallel

batch_add_labels

Add labels to multiple issues

batch_link_to_project

Link issues to GitHub Project (v2)

Milestone Operations

Tool

Description

create_milestone

Create a milestone with optional due date

list_milestones

List milestones with filtering

Usage Examples

Create an Issue

result = create_issues(
    issues=[{
        "title": "Implement feature X",
        "body": "## Description\n\nDetails here...",
        "labels": ["enhancement"],
        "milestone": 1
    }],
    owner="your-username",
    repo="your-repo"
)

Check CI Status

result = check_ci_status(
    branch="feature-branch",
    owner="your-username",
    repo="your-repo"
)

Create a PR

result = create_pr_with_content(
    title="feat: add new feature",
    problem="Current behavior lacks X functionality",
    solution="Implement X using approach Y",
    key_changes="- Added X component\n- Updated Y module",
    issue=42,  # Optional: links to issue #42
    owner="your-username",
    repo="your-repo"
)

Development

Prerequisites

  • Python >= 3.10

  • uv (recommended) or pip

  • GitHub Personal Access Token

Setup

git clone https://github.com/rriesco/github-mcp-server.git
cd github-mcp-server
uv sync

Running Tests

# Unit tests only (fast)
uv run pytest -m "not integration" -v

# Integration tests (requires GITHUB_TOKEN, TEST_OWNER, TEST_REPO)
uv run pytest -m integration -v

# All tests with coverage
uv run pytest --cov=src --cov-report=term-missing

Type Checking

uv run mypy src/github_mcp_server --strict

Architecture

Claude Code / MCP Client
      |
      | MCP Protocol (stdio)
      v
┌─────────────────────────────┐
│  Python FastMCP Server      │
│  - Tool Registry            │
│  - PyGithub Client          │
│  - Error Handling           │
│  - Type Validation          │
└─────────────┬───────────────┘
              |
              | PyGithub REST API
              v
        GitHub API

Project Structure

github-mcp-server/
├── src/github_mcp_server/
│   ├── server.py              # Server entry point
│   ├── tools/
│   │   ├── issues.py          # Issue operations
│   │   ├── pulls.py           # PR operations
│   │   ├── ci.py              # CI operations
│   │   ├── milestones.py      # Milestone operations
│   │   └── batch_operations.py # Batch operations
│   ├── utils/
│   │   ├── github_client.py   # Singleton PyGithub client
│   │   ├── errors.py          # Structured error handling
│   │   └── types.py           # Type definitions
│   └── config/
│       └── defaults.py        # Environment-based defaults
└── tests/
    ├── test_*.py              # Unit tests
    └── integration/           # Integration tests

License

MIT License - see LICENSE for details.

Available Tools

15 tools
batch_add_labelsA

Add labels to multiple issues in parallel. Labels are ADDED (not replaced).

Each operation: {issue_number (required), labels (required)}

Returns: {total, successful, failed, success_rate, execution_time_seconds, results}

Inputs: operations (required), owner, repo, max_workers. Returns: object

batch_update_issuesA

Update multiple GitHub issues in parallel (max 50 per batch).

Each update object: {issue_number (required), title, body, state, labels, milestone, assignees} Note: labels/assignees replace existing (not append).

Returns: {total, successful, failed, success_rate, execution_time_seconds, results}

Inputs: updates (required), owner, repo, max_workers. Returns: object

check_ci_statusA

Check CI workflow status for a branch. Returns overall and per-workflow status.

Returns: {overall_status, overall_conclusion, branch, workflows: [{name, status, conclusion, url, jobs}]}

If no CI runs found, returns status="no_runs".

Inputs: branch (required), owner, repo. Returns: object

close_issueB

Close a GitHub issue with optional comment and reason.

Optional:

  • comment: add closing comment before closing

  • state_reason: "completed" or "not_planned"

Returns: {number, state, state_reason, comment_added, url}

Inputs: issue_number (required), comment, state_reason, owner, +1 more. Returns: object

create_issuesA

Create GitHub issues (1 or more). Parallel execution for multiple.

Each issue: {title (required), body, labels, milestone, assignees}

Options:

  • max_workers: parallel workers (default: 5, max: 10)

Returns: {total, successful, failed, results: [{index, success, data/error}]}

Inputs: issues (required), owner, repo, max_workers. Returns: object

create_milestoneB

Create a GitHub milestone.

Optional:

  • description: markdown description

  • due_date: ISO 8601 format (e.g., "2025-12-31T23:59:59Z")

  • state: "open" (default) or "closed"

Returns: {number, title, description, state, due_on, url}

Inputs: title (required), description, due_date, state, +2 more. Returns: object

create_pr_with_contentA

Create a GitHub PR with structured content. Auto-detects current branch as head.

Required content:

  • problem: why this change is needed (2-4 sentences)

  • solution: how it works (4-8 sentences)

  • key_changes: bulleted markdown list of changes

Optional:

  • issue: GitHub issue number to close (adds "Closes #N" to PR)

Returns: {pr_number, url, state, head, base, created_at}

Inputs: title (required), problem (required), solution (required), key_changes (required), +4 more. Returns: object

get_ci_logsA

Get CI workflow logs for debugging failed jobs.

Provide either branch OR run_id (not both).

Optional filters:

  • job_name: filter by job name (e.g., "test", "lint")

  • status: "failure" (default), "success", or "all"

  • max_lines: tail N lines of logs (default: 200)

Returns: {run_id, run_url, branch, status, conclusion, jobs: [{job_id, name, status, conclusion, logs, log_url}]}

Inputs: branch, run_id, job_name, status, +3 more. Returns: object

get_issueC

Retrieve full GitHub issue details including body content.

Returns: {number, title, body, state, labels, milestone, created_at, updated_at, url}

Inputs: issue_number (required), owner, repo. Returns: object

get_pull_requestB

Get PR details including mergeable status and statistics.

Returns: {number, title, state, merged, mergeable, mergeable_state, draft, head, base, commits, additions, deletions, changed_files, created_at, updated_at, merged_at, url}

mergeable_state: "clean", "dirty", "unstable", "blocked", or "unknown"

Inputs: pr_number (required), owner, repo. Returns: object

list_issuesA

List and filter GitHub issues with pagination.

Optional filters:

  • state: "open" (default), "closed", or "all"

  • labels: filter by label names

  • milestone: filter by milestone title (not number)

  • assignee: filter by username, or "none" for unassigned

  • sort: "created" (default), "updated", or "comments"

  • limit: max issues to return (default: 30, max: 100)

Returns: {total, count, issues: [{number, title, state, labels, milestone, assignee, url}]}

Inputs: state, labels, milestone, assignee, +5 more. Returns: object

list_milestonesA

List repository milestones with filtering and sorting.

Options:

  • state: "open" (default), "closed", or "all"

  • sort: "due_on" (default) or "completeness"

  • direction: "asc" (default) or "desc"

Returns: {total, milestones: [{number, title, state, open_issues, closed_issues, due_on, url}]}

Inputs: state, sort, direction, owner, +1 more. Returns: object

merge_prA

Merge a PR after checking mergeable status.

Options:

  • merge_method: "squash" (default), "merge", or "rebase"

  • commit_title/commit_message: custom merge commit text (squash/merge only)

  • delete_branch: delete head branch after merge (default: True)

Returns: {merged, sha, message, branch_deleted}

Inputs: pr_number (required), merge_method, commit_title, commit_message, +3 more. Returns: object

update_prA

Update PR metadata. Only provided fields are updated; None values ignored.

Optional updates:

  • title: new PR title

  • body: new PR description

  • base: change base branch

  • state: "open" or "closed"

Returns: {number, title, state, updated_fields, url}

Note: Cannot update merged PRs.

Inputs: pr_number (required), title, body, base, +3 more. Returns: object

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.8/5.0

    Scored across 15 tools

    Disambiguation5/5

    Each tool targets a distinct resource or operation: issues (create, get, list, close, batch update, batch add labels), milestones (create, list), PRs (create, get, update, merge), and CI (check status, get logs). No two tools have overlapping purposes.

    Naming Consistency5/5

    All tool names follow a consistent verb_noun pattern in snake_case (e.g., close_issue, create_milestone, get_ci_logs). Batch operations are prefixed with 'batch_', and names are descriptive without mixing conventions.

    Tool Count5/5

    15 tools is a well-scoped set for a GitHub MCP server. It covers core workflows without being overly numerous or too sparse, providing a balanced surface for common development tasks.

    Completeness4/5

    The tool set covers CRUD-like operations for issues, PRs, milestones, and CI monitoring. Minor gaps exist (e.g., no tool for adding comments to issues, managing individual labels, or PR review actions), but the core workflows are well-supported, and agents can work around the gaps.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      D
      maintenance
      An MCP server that enables Claude and other compatible LLMs to interact with the GitHub API, supporting features like creating issues, retrieving repository information, listing issues, and searching repositories.
      4
      ISC
    • A
      license
      B
      quality
      D
      maintenance
      An MCP server that allows Claude and other MCP-compatible LLMs to interact with the GitHub API, supporting features like creating issues, getting repository information, listing issues, and searching repositories.
      4
      ISC
    • A
      license
      B
      quality
      D
      maintenance
      MCP (Model Context Protocol) server for GitHub API integration. This server provides comprehensive tools for interacting with GitHub repositories, issues, pull requests, branches, and code search through a unified interface.
      15
      8 npm
      MIT