Skip to main content
Glama
GitHub MCP Server

GitHub MCP Server

by YahyaQandel

GitHub MCP Server

A Model Context Protocol (MCP) server that provides comprehensive GitHub pull request data including comments, labels, pipeline status, and more.

Features

  • Full PR Data: Fetches complete pull request information including:

    • PR metadata (title, state, timestamps, draft status)

    • Creator/author information

    • Assignees and reviewers

    • Labels and milestones

    • File changes statistics

    • Merge status

  • Comments Support: Retrieves all comments on pull requests:

    • Issue comments

    • Review comments

    • Sorted chronologically

  • Pipeline/CI Status: Gets CI/CD pipeline information:

    • GitHub Check Runs (Actions, third-party CI)

    • Commit statuses

    • Completion status and conclusions

  • Pagination Support: Automatically fetches ALL pull requests, not just the first page

  • Flexible Filtering: Filter PRs by state (open, closed, or all)

Related MCP server: GitHub PR Analysis MCP Server

Installation

npm install
npm run build

Configuration

  1. Create a GitHub Personal Access Token:

  2. Set up environment variables:

    cp .env.example .env
    # Edit .env and add your GitHub token

Usage with MCP Client

Add to MCP Settings

Add this server to your MCP client configuration:

{
  "mcpServers": {
    "github": {
      "command": "node",
      "args": ["path/to/github-mcp-server/dist/index.js"],
      "env": {
        "GITHUB_TOKEN": "your_github_token_here"
      }
    }
  }
}

Available Tools

1. github_set_token

Set or update the GitHub authentication token at runtime.

Parameters:

  • token (string, required): GitHub personal access token

2. github_list_pull_requests

List all pull requests in a repository with comprehensive details.

Parameters:

  • owner (string, required): Repository owner (user or organization)

  • repo (string, required): Repository name

  • state (string, optional): Filter by state - "open", "closed", or "all" (default: "all")

  • include_comments (boolean, optional): Include all comments for each PR (default: false)

  • include_checks (boolean, optional): Include CI/CD status for each PR (default: false)

Example Response:

{
  "repository": "owner/repo",
  "total_count": 25,
  "state_filter": "all",
  "pull_requests": [
    {
      "number": 123,
      "title": "Add new feature",
      "state": "open",
      "created_at": "2024-01-01T00:00:00Z",
      "user": {
        "login": "developer",
        "avatar_url": "https://...",
        "html_url": "https://github.com/developer"
      },
      "labels": [
        {
          "name": "enhancement",
          "color": "a2eeef",
          "description": "New feature or request"
        }
      ],
      "assignees": [...],
      "comments": 5,
      "review_comments": 3,
      "check_runs": [...],
      "statuses": [...]
    }
  ]
}

3. github_get_pr_comments

Get all comments for a specific pull request.

Parameters:

  • owner (string, required): Repository owner

  • repo (string, required): Repository name

  • pull_number (number, required): Pull request number

Example Response:

{
  "repository": "owner/repo",
  "pull_request": 123,
  "total_comments": 8,
  "comments": [
    {
      "id": 1234567,
      "user": {
        "login": "reviewer",
        "avatar_url": "https://..."
      },
      "body": "Great work! Just one suggestion...",
      "created_at": "2024-01-02T10:00:00Z",
      "html_url": "https://github.com/owner/repo/pull/123#issuecomment-1234567"
    }
  ]
}

4. github_get_pr_checks

Get CI/CD check runs and status for a specific pull request.

Parameters:

  • owner (string, required): Repository owner

  • repo (string, required): Repository name

  • pull_number (number, required): Pull request number

Example Response:

{
  "repository": "owner/repo",
  "pull_request": 123,
  "head_sha": "abc123...",
  "check_runs": [
    {
      "id": 9876543,
      "name": "build",
      "status": "completed",
      "conclusion": "success",
      "started_at": "2024-01-02T10:00:00Z",
      "completed_at": "2024-01-02T10:05:00Z",
      "html_url": "https://github.com/owner/repo/actions/runs/9876543"
    }
  ],
  "statuses": [
    {
      "state": "success",
      "context": "continuous-integration/travis-ci",
      "description": "The Travis CI build passed",
      "target_url": "https://travis-ci.org/owner/repo/builds/12345"
    }
  ]
}

Development

# Install dependencies
npm install

# Run in development mode
npm run dev

# Build for production
npm run build

# Start production server
npm start

Requirements

  • Node.js 18+

  • GitHub Personal Access Token

  • MCP-compatible client

License

MIT

Available Tools

5 tools
github_get_pr_checksA

Get CI/CD check runs and status for a specific pull request

Inputs: repo (required), owner (required), pull_number (required).

github_get_pr_commentsA

Get all comments (issue comments and review comments) for a specific pull request

Inputs: repo (required), owner (required), pull_number (required).

github_get_pr_detailsA

Get detailed information about a specific pull request including files changed, commits, and optionally the full diff

Inputs: repo (required), owner (required), pull_number (required), include_diff.

github_list_pull_requestsB

List all pull requests in a repository with full details including creator, labels, and optionally comments and pipeline status

Inputs: repo (required), owner (required), state, include_checks, +1 more.

github_set_tokenA

Set the GitHub personal access token for authentication

Inputs: token (required).

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A3.7/5.0

    Scored across 5 tools

    Disambiguation5/5

    Each tool targets a distinct aspect of GitHub PR workflows: authentication, listing, comments, checks, and detailed info. There is no functional overlap, so an agent can easily select the appropriate tool based on the task.

    Naming Consistency5/5

    All tools follow a consistent github_verb_noun pattern (set_token, list_pull_requests, get_pr_details, etc.). The naming is uniform and predictable, making the tool set easy to navigate.

    Tool Count5/5

    With five tools, the server is well-scoped around pull request operations. Each tool serves a clear purpose without redundancy, falling comfortably within the ideal range for a focused server.

    Completeness2/5

    The tool set is read-only for pull requests, lacking create, update, or delete operations. Despite the server name suggesting broad GitHub coverage, no issues or repository management are included, leaving significant gaps for typical workflows.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers