GitHub PR & Issue Analyser

Analyze GitHub pull requests and manage issues, tags, and releases.

MCP for GitHub PR, Issues, Tags and Releases

The Model Context Protocol (MCP) is an open standard that enables seamless integration between Large Language Models (LLMs) and external tools. Whilst it can be implemented in any AI system, including custom LLM setups, the degree of integration and optimisation varies based on the model's architecture and capabilities.

GitHub PR Issue Analyser MCP server

This MCP application serves as a bridge between LLMs and GitHub's repository management features, offering automated analysis of pull requests and comprehensive issue management. It provides a robust set of tools to fetch PR details, create issues, and update issues directly from your desktop LLM. The application is designed with modularity in mind, supporting extensibility via the MCP tool interface and seamless integration with existing workflows.

The toolset enables automated PR analysis, issue tracking, tagging and release management through a standardised MCP interface, making it ideal for teams seeking to streamline their GitHub workflow automation.

Features

FunctionDescription
Analyse GitHub Pull Requests and fetch diffsRetrieve the diff/patch for any PR in a repository.
Fetch content and metadata for specific PRsGet PR title, description, author, timestamps, and state.
Create Pull RequestsOpen new PRs with title, body, head/base branch, and draft option.
Update PR title and descriptionChange the title and body of any PR.
Merge Pull RequestsMerge a PR using merge, squash, or rebase method.
Add comments to PRsPost general comments to a PR thread.
Add inline review comments to PRsComment on specific lines in PR files for code review.
Submit PR ReviewsApprove, request changes, or comment on a PR review.
Update PR AssigneesAssign or update users on a PR or issue.
Create and update GitHub IssuesOpen new issues or update existing ones with title, body, labels, and state.
List all open Issues or Pull RequestsView all open PRs or issues for any user or organisation.
Create tags and releasesTag repository commits and publish releases with changelogs.
Search GitHub UsersRetrieve user profile information via GraphQL.
Get User ActivityFetch commit, PR, issue, and review contributions with org/repo/date filtering.
Retrieve IPv4 and IPv6 informationGet public IP address details for both IPv4 and IPv6.

Requirements

  • Python 3.12+
  • GitHub Personal Access Token (with repo scope) or a GitHub OAuth App (client ID, secret, and a public base URL)

Authentication

Two auth modes are supported. The active mode is selected automatically from environment variables.

ModeWhen activeToken used for API calls
Static token (default)GITHUB_TOKEN set; no GITHUB_OAUTH_* varsServer's GITHUB_TOKEN for all calls
GitHub OAuth2GITHUB_TOKEN + all three GITHUB_OAUTH_* vars setEach user's own gho_* token

Environment Variables

VariableRequiredDescription
GITHUB_TOKENYesGitHub PAT with repo scope; used as the Bearer token in static-token HTTP mode
MCP_ENABLE_REMOTENoAny non-empty value enables HTTP mode (required for OAuth2)
GITHUB_OAUTH_CLIENT_IDOAuth2 onlyGitHub OAuth App client ID
GITHUB_OAUTH_CLIENT_SECRETOAuth2 onlyGitHub OAuth App client secret
GITHUB_OAUTH_BASE_URLOAuth2 onlyPublic base URL of the MCP server (used for the OAuth2 redirect)
PORTNo (default 8081)HTTP server port
HOSTNo (default localhost)HTTP server host
GITHUB_API_TIMEOUTNo (default 5)Timeout in seconds for GitHub API requests

To create a GitHub OAuth App, go to Settings → Developer settings → OAuth Apps → New OAuth App and set the Authorization callback URL to <GITHUB_OAUTH_BASE_URL>/auth/callback (e.g. https://mcp.example.com/auth/callback).

Architecture Diagram

                                     +------------------------+
                                     |                        |
                                     |    MCP Client/User     |
                                     |                        |
                                     +------------------------+
                                              |
                                              | (stdio/http)
                                              v
+--------------------+              +------------------------+
|                    |              |    PRIssueAnalyser     |
|   IP Integration   | <------------|    (FastMCP Server)    |
|   (ipinfo.io)      |              |                        |
+--------------------+              +------------------------+
                                              |
                                              | (API calls)
                                              v
                                   +------------------------+
                                   |   GitHub Integration   |
                                   +------------------------+
                                              |
                          +-------------------+-------------------+
                          | (REST API)                            | (GraphQL API)
                          v                                       v
         +-----------------------------------+     +-----------------------------+
         |                                   |     |                             |
   +-------------+  +--------------+  +------+     |   User Search & Activity   |
   | GitHub PRs  |  |GitHub Issues |  | Tags/|     |   (contributions, profile) |
   | & Reviews   |  |              |  |Rels  |     |                             |
   +-------------+  +--------------+  +------+     +-----------------------------+

Features:

  1. PR Management: Fetch, analyse, create, merge, review, and update
  2. Issue Tracking: Create, update, list, and assign
  3. Release Management: Tags and releases
  4. User Search: Profile lookup and activity tracking via GraphQL
  5. Network Info: IPv4/IPv6 details

Main Flows:

  • PRIssueAnalyser: Main MCP server handling tool registration and requests
  • GitHub Integration: Manages all GitHub API interactions (REST + GraphQL)
  • IP Integration: Handles IPv4/IPv6 information retrieval
  • MCP Client: Interacts via stdio or streamable HTTP (http)

Local Installation

  1. Clone the repository:
git clone https://github.com/saidsef/mcp-github-pr-issue-analyser.git
cd mcp-github-pr-issue-analyser
  1. Install dependencies:

Launch MCP in stdio mode.

export GITHUB_TOKEN="<github-token>"
uvx ./

Alternatively, launch MCP in http mode.

export GITHUB_TOKEN="<github-token>"
export MCP_ENABLE_REMOTE=true
uvx ./

You can access it via http i.e. http(s)://localhost:8081/mcp In HTTP mode, clients must authenticate with Authorization: Bearer <GITHUB_TOKEN>.

Alternatively, launch MCP in http mode with GitHub OAuth2 authentication.

export GITHUB_TOKEN="<github-token>"
export MCP_ENABLE_REMOTE=true
export GITHUB_OAUTH_CLIENT_ID="<oauth-app-client-id>"
export GITHUB_OAUTH_CLIENT_SECRET="<oauth-app-client-secret>"
export GITHUB_OAUTH_BASE_URL="https://<your-public-host>"
uvx ./

In OAuth2 mode, users authenticate via GitHub's OAuth flow. Each user's own GitHub token is used for API calls.

Alternatively, run via Docker using the published image.

docker run -e GITHUB_TOKEN="<github-token>" \
  -p 8081:8081 \
  ghcr.io/saidsef/mcp-github-pr-issue-analyser:latest

Local Integration with IDEs and LLMs

To add an MCP server to your IDE or LLM, you need to add this section to the configuration file. The basic structure involves defining a server name and providing the command and any necessary arguments to run the server.

Claude / Cursor / Windsurf
{
  "mcpServers": {
    "github_prs_issues": {
      "command": "uvx",
      "env": {
        "GITHUB_TOKEN": "<your-github-token>"
      },
      "args": [
        "https://github.com/saidsef/mcp-github-pr-issue-analyser.git",
      ]
    }
  }
}
VS Code
{
  "inputs": [
    {
      "type": "promptString",
      "id": "github-token",
      "description": "Enter your GitHub token",
      "password": true
    }
  ],
  "servers": {
    "github-prs-issues": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "https://github.com/saidsef/mcp-github-pr-issue-analyser.git",
      ],
      "env": {
        "GITHUB_TOKEN": "${input:github-token}"
      }
    }
  }
}

Source

Our latest and greatest source of mcp-github-pr-issue-analyser can be found on [GitHub]. Fork us!

Contributing

We would :heart: you to contribute by making a pull request.

Please read the official Contribution Guide for more information on how you can contribute.

관련 서버

NotebookLM 웹 임포터

원클릭으로 웹 페이지와 YouTube 동영상을 NotebookLM에 가져오기. 200,000명 이상이 사용 중.

Chrome 확장 프로그램 설치