GitHub Issues MCP server

Integrates with GitHub's issue tracking system to enable listing and creating issues, facilitating automated issue management and workflow integration.
Back to servers
Provider
Tim Buchinger
Release date
Feb 19, 2025
Language
Python

The GitHub MCP Server implements the Model Context Protocol to interact with GitHub issues through Cline. It provides functionality to list and create GitHub issues with secure authentication and comprehensive error handling.

Installation

Prerequisites

  • Python 3.7 or higher
  • GitHub Personal Access Token with repo scope

Step-by-Step Installation

  1. Clone the repository:

    git clone https://github.com/timbuchinger/mcp-github.git
    cd mcp-github
    
  2. Install dependencies with uv:

    pip install uv
    uv venv
    source .venv/bin/activate  # On Windows: .venv\Scripts\activate
    uv pip install -r requirements.txt
    
  3. Configure environment variables:

    cp .env.template .env
    
  4. Edit the .env file and add your GitHub Personal Access Token:

    GITHUB_TOKEN=your_token_here
    

Creating a GitHub Personal Access Token

To obtain a GitHub token:

  1. Go to GitHub Settings → Developer settings → Personal access tokens
  2. Generate a new token with the repo scope
  3. Copy the generated token and paste it in your .env file

Usage

Starting the Server

Run the MCP server with the following command:

python -m src.mcp_github.server

The server will start and make two tools available to Cline:

Available Tools

Getting Issues

The get_issues tool retrieves a list of issues from a specified GitHub repository.

Input format:

{
  "repo": "owner/repo"
}

Example usage: To fetch issues from the repository octocat/Hello-World, provide the following input to the tool:

{
  "repo": "octocat/Hello-World"
}

Creating Issues

The create_issue tool allows you to create a new issue in a GitHub repository.

Input format:

{
  "repo": "owner/repo",
  "title": "Issue title",
  "body": "Issue description"
}

Example usage: To create a new issue in the repository octocat/Hello-World:

{
  "repo": "octocat/Hello-World",
  "title": "Bug in login functionality",
  "body": "The login button doesn't work when clicked multiple times in succession."
}

Error Handling

The server provides descriptive error messages for common issues:

  • Authentication errors: Occurs when the GitHub token is missing or invalid
  • Repository format errors: Happens if the repository name isn't in the format owner/repo
  • Missing parameters: When required fields are not provided
  • GitHub API errors: When the GitHub API returns an error response

If you encounter errors, check that:

  • Your GitHub token is correctly configured in the .env file
  • You have the necessary permissions for the repository
  • The repository name is correctly formatted

How to add this MCP server to Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-mcp"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later