GitHub MCP server

Integrates with GitHub's API to enable repository management, code manipulation, and issue tracking for streamlined development workflows.
Back to servers
Provider
Paras Solanki
Release date
Mar 04, 2025
Language
TypeScript
Stats
2 stars

The Github MCP Server enables Language Learning Models (LLMs) to interact with Github repositories, issues, pull requests, and more through the Model Context Protocol. This integration allows AI assistants like Claude to search and retrieve information directly from Github's vast ecosystem.

Installation

Setting Up Github Access Token

  1. Create or get access to a personal access token for your Github account by following the official guide

Configuring Claude Desktop

Add the server configuration to Claude Desktop:

For MacOS: Edit the file at: ~/Library/Application Support/Claude/claude_desktop_config.json

For Windows: Follow the configuration guide here

Add the following JSON configuration:

{
  "mcpServers": {
    "github": {
      "command": "npx",
      "args": ["-y", "github-mcp-server"],
      "env": {
        "GITHUB_PERSONAL_ACCESS_TOKEN": "your_personal_github_access_token"
      }
    }
  }
}

Be sure to replace your_personal_github_access_token with your actual Github token.

Available Tools

Repository Search

search_repositories

Search Github for repositories matching specific criteria.

Required inputs:

  • query (string): The search query for repositories
  • page (number, default: 30, max: 100): Page number for pagination
  • per_page (number, default: 30, max: 100): Number of results per page

Issue Search

search_issues

Search for issues across Github repositories.

Required inputs:

  • query (string): The search query for issues
  • page (number, default: 1): Page number for pagination
  • per_page (number, default: 30, max: 100): Number of results per page
  • order (optional string, default: desc): Sort order (asc or desc)
  • sort (optional string): Sort field (options include: comments, reactions, created, updated, etc.)

Commit Search

search_commits

Search for commits across Github repositories.

Required inputs:

  • query (string): The search query for commits
  • page (number, default: 1): Page number for pagination
  • per_page (number, default: 30, max: 100): Results per page
  • order (optional string, default: desc): Sort order (asc or desc)
  • sort (optional string): Sort field (committer-date or author-date)

Code Search

search_code

Search for code across Github repositories.

Required inputs:

  • query (string): The search query for code snippets
  • page (number, default: 1): Page number for pagination
  • per_page (number, default: 30, max: 100): Results per page

User Search

search_users

Search for Github users.

Required inputs:

  • query (string): The search query for users
  • page (number, default: 1): Page number for pagination
  • per_page (number, default: 30, max: 100): Results per page
  • order (optional string, default: desc): Sort order (asc or desc)
  • sort (optional string): Sort field (options: followers, repositories, or joined)

Topic Search

search_topics

Search for topics on Github.

Required inputs:

  • query (string): The search query for topics
  • page (number, default: 1): Page number for pagination
  • per_page (number, default: 30, max: 100): Results per page

Label Search

search_labels

Search for labels in repositories.

Required inputs:

  • query (string): The search query for labels
  • page (number, default: 1): Page number for pagination
  • per_page (number, default: 30, max: 100): Results per page
  • order (optional string, default: desc): Sort order (asc or desc)
  • sort (optional string): Sort field (options: created or updated)

Repository Issues

list_repositories_issues

List issues from a specific repository.

Required inputs:

  • owner (string): The repository owner
  • repo (string): The repository name
  • page (optional number, default: 1): Page number for pagination
  • per_page (optional number, default: 30, max: 100): Results per page
  • direction (optional string, default: desc): Sort direction
  • sort (optional string, default: created): Sort field
  • Various optional filters: since, labels, milestone, assignee, creator, mentioned

Get Issue

get_issue

Get detailed information about a specific issue.

Required inputs:

  • owner (string): The repository owner
  • repo (string): The repository name
  • issue_number (number): The issue number

List Pull Requests

list_repositories_pull_requests

List pull requests from a specific repository.

Required inputs:

  • owner (string): The repository owner
  • repo (string): The repository name
  • page (optional number, default: 1): Page number for pagination
  • per_page (optional number, default: 30, max: 100): Results per page
  • direction (optional string, default: desc): Sort direction
  • sort (optional string, default: created): Sort field
  • head (optional string): Filter by head user/org and branch
  • base (optional string): Filter by base branch name

Get Pull Request

get_pull_request

Get detailed information about a specific pull request.

Required inputs:

  • owner (string): The repository owner
  • repo (string): The repository name
  • pull_request_number (number): The pull request number

Usage Examples

Here are some example prompts you can use with Claude after setting up the Github MCP server:

  • Search for repositories: "Find repositories related to modelcontextprotocol"

  • Get issue details: "What is issue #739 on the modelcontextprotocol servers repo?"

  • Examine pull requests: "Show me details about PR #717 on the modelcontextprotocol servers repo"

  • Search for code: "Find code examples that use the Github API in Javascript"

  • Find users: "Search for Github users who contribute to AI repositories"

These prompts will trigger the appropriate tools to fetch information directly from Github and present it within your conversation.

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