GitHub's Official MCP Server with MIT License

The GitHub MCP Server is an official release by GitHub, implemented as a Model Context Protocol (MCP) server. It provides seamless integration with GitHub APIs, enabling advanced automation and interaction capabilities for developers and tools. The server supports various use cases such as automating GitHub workflows, extracting and analyzing data from repositories, and building AI-powered tools that interact with GitHub's ecosystem.

To run the server in a container, Docker must be installed, and a GitHub Personal Access Token should be created with appropriate permissions. The server can then be used with VS Code or Claude Desktop by setting up the GitHub Personal Access Token in the respective environments. Alternatively, users can build the binary using Go in the cmd/github-mcp-server directory and run the github-mcp-server stdio command with the GITHUB_PERSONAL_ACCESS_TOKEN environment variable set to their token.

The server offers a wide range of tools targeting functional areas such as Users, Issues, Pull Requests, Repositories, Search, and Code Scanning. Each tool is designed to interact with GitHub APIs for specific tasks. For instance, users can create or update files in a repository, get issue details, merge pull requests, and search for code across repositories. This MCP Server is particularly useful for automating tasks and creating powerful tools that interact with GitHub's ecosystem.

GitHub - github/github-mcp-server

GitHub's official MCP Server

Description

The GitHub MCP Server is a Model Context Protocol (MCP) server that provides seamless integration with GitHub APIs, enabling advanced automation and interaction capabilities for developers and tools.

Usage

With VS Code

For quick installation, use one of the one-click install buttons at the top of this README.

For manual installation, add the following JSON block to your User Settings (JSON) file in VS Code. You can do this by pressing Ctrl + Shift + P and typing Preferences: Open User Settings (JSON).

Optionally, you can add it to a file called .vscode/mcp.json in your workspace. This will allow you to share the configuration with others.

{
  "mcp": {
    "inputs": [
      {
        "type": "promptString",
        "id": "github_token",
        "description": "GitHub Personal Access Token",
        "password": true
      }
    ],
    "servers": {
      "github": {
        "command": "docker",
        "args": [
          "run",
          "-i",
          "--rm",
          "-e",
          "GITHUB_PERSONAL_ACCESS_TOKEN",
          "ghcr.io/github/github-mcp-server"
        ],
        "env": {
          "GITHUB_PERSONAL_ACCESS_TOKEN": "${input:github_token}"
        }
      }
    }
  }
}

More about using MCP server tools in VS Code's agent mode documentation.

With Claude Desktop

{
  "mcpServers": {
    "github": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "GITHUB_PERSONAL_ACCESS_TOKEN",
        "ghcr.io/github/github-mcp-server"
      ],
      "env": {
        "GITHUB_PERSONAL_ACCESS_TOKEN": ""
      }
    }
  }
}

Tools

  • get_me: Get details of the authenticated user
  • get_issue: Gets the issue
  • create_or_update_file: Create or update a single file in a repository
  • push_files: Push multiple files in a single commit
  • search_repositories: Search for GitHub repositories
  • create_repository: Create a new GitHub repository
  • get_file_contents: Get contents of a file or directory
  • fork_repository: Fork a repository
  • create_branch: Create a new branch
  • list_commits: Gets commits of a branch in a repository
  • search_code: Search for code across GitHub repositories
  • search_users: Search for GitHub users
  • get_code_scanning_alert: Get a code scanning alert
  • list_code_scanning_alerts: List code scanning alerts for a repository

Resources

License

This project is licensed under the terms of the MIT open source license. Please refer to MIT for the full terms.