GitHub MCP Server

by vickigogo

Not rated
GitHub

About

Seamlessly integrate with GitHub APIs for development automation and interaction.

Details

Author
vickigogo
Categories
Developer Tools, Other, Infrastructure

Setup

Install GitHub MCP Server in your MCP client (Claude Desktop, Cursor, Windsurf, and others).

Repository: https://github.com/vickigogo/mcp

Follow the installation instructions in the repository README, then restart your MCP client.

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

- Automating GitHub workflows and processes.
- Extracting and analyzing data from GitHub repositories.
- Building AI powered tools and applications that interact with GitHub's ecosystem.

The remote GitHub MCP Server is hosted by GitHub and provides the easiest method for getting up and running. If your MCP host does not support remote MCP servers, don't worry! You can use thelocal version of the GitHub MCP Serverinstead.
- An MCP host that supports the latest MCP specification and remote servers, such as
VS Code.

For quick installation, use one of the one-click install buttons above. Once you complete that flow, toggle Agent mode (located by the Copilot Chat text input) and the server will start. Make sure you're usingVS Code 1.101orlaterfor remote MCP and OAuth support.

Alternatively, to manually configure VS Code, choose the appropriate JSON block from the examples below and add it to your host configuration:

{ "servers": { "github-remote": { "type": "http", "url": "https://api.githubcopilot.com/mcp/" } } }
{ "servers": { "github-remote": { "type": "http", "url": "https://api.githubcopilot.com/mcp/", "headers": { "Authorization": "Bearer ${input:github_mcp_pat}" } } }, "inputs": [ { "type": "promptString", "id": "github_mcp_pat", "description": "GitHub Personal Access Token", "password": true } ] }

For MCP Hosts that areRemote MCP-compatible, choose the appropriate JSON block from the examples below and add it to your host configuration:

{ "mcpServers": { "github-remote": { "url": "https://api.githubcopilot.com/mcp/" } } }
{ "mcpServers": { "github-remote": { "url": "https://api.githubcopilot.com/mcp/", "authorization_token": "Bearer <your GitHub PAT>" } } }

Note:The exact configuration format may vary by host. Refer to your host's documentation for the correct syntax and location for remote MCP server setup.

SeeRemote Server Documentationon how to pass additional configuration settings to the remote GitHub MCP Server.
- To run the server in a container, you will need to have
Dockerinstalled.
- Once Docker is installed, you will also need to ensure Docker is running. The image is public; if you get errors on pull, you may have an expired token and need todocker logout ghcr.io.
- Lastly you will need to
Create a GitHub Personal Access Token. The MCP server can use many of the GitHub APIs, so enable the permissions that you feel comfortable granting your AI tools (to learn more about access tokens, please check out thedocumentation).

For quick installation, use one of the one-click install buttons. Once you complete that flow, toggle Agent mode (located by the Copilot Chat text input) and the server will start.

Add the following JSON block to your IDE MCP settings.

{ "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}" } } } } }

Optionally, you can add a similar example (i.e. without the mcp key) to a file called.vscode/mcp.jsonin your workspace. This will allow you to share the configuration with others.

{ "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'sagent mode documentation.

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

If you don't have Docker, you can usego buildto build the binary in thecmd/github-mcp-serverdirectory, and use thegithub-mcp-server stdiocommand with theGITHUB_PERSONAL_ACCESS_TOKENenvironment variable set to your token. To specify the output location of the build, use the-oflag. You should configure your server to use the built executable as itscommand. For example:

{ "mcp": { "servers": { "github": { "command": "/path/to/github-mcp-server", "args": ["stdio"], "env": { "GITHUB_PERSONAL_ACCESS_TOKEN": "<YOUR_TOKEN>" } } } } }

The GitHub MCP Server supports enabling or disabling specific groups of functionalities via the--toolsetsflag. This allows you to control which GitHub API capabilities are available to your AI tools. Enabling only the toolsets that you need can help the LLM with tool choice and reduce the context size.

Toolsets are not limited to Tools. Relevant MCP Resources and Prompts are also included where applicable.

The following sets of tools are available (all are on by default):

To specify toolsets you want available to the LLM, you can pass an allow-list in two ways:

github-mcp-server --toolsets repos,issues,pull_requests,code_security
GITHUB_TOOLSETS="repos,issues,pull_requests,code_security" ./github-mcp-server

The environment variableGITHUB_TOOLSETStakes precedence over the command line argument if both are provided.

When using Docker, you can pass the toolsets as environment variables:

docker run -i --rm \ -e GITHUB_PERSONAL_ACCESS_TOKEN=<your-token> \ -e GITHUB_TOOLSETS="repos,issues,pull_requests,code_security,experiments" \ ghcr.io/github/github-mcp-server

The special toolsetallcan be provided to enable all available toolsets regardless of any other configuration:

GITHUB_TOOLSETS="all" ./github-mcp-server

Note: This feature is currently in beta and may not be available in all environments. Please test it out and let us know if you encounter any issues.

Instead of starting with all tools enabled, you can turn on dynamic toolset discovery. Dynamic toolsets allow the MCP host to list and enable toolsets in response to a user prompt. This should help to avoid situations where the model gets confused by the sheer number of tools available.

When using the binary, you can pass the--dynamic-toolsetsflag.

When using Docker, you can pass the toolsets as environment variables:

docker run -i --rm \ -e GITHUB_PERSONAL_ACCESS_TOKEN=<your-token> \ -e GITHUB_DYNAMIC_TOOLSETS=1 \ ghcr.io/github/github-mcp-server

To run the server in read-only mode, you can use the--read-onlyflag. This will only offer read-only tools, preventing any modifications to repositories, issues, pull requests, etc.

When using Docker, you can pass the read-only mode as an environment variable:

docker run -i --rm \ -e GITHUB_PERSONAL_ACCESS_TOKEN=<your-token> \ -e GITHUB_READ_ONLY=1 \ ghcr.io/github/github-mcp-server

GitHub Enterprise Server and Enterprise Cloud with data residency (ghe.com)

The flag--gh-hostand the environment variableGITHUB_HOSTcan be used to set the hostname for GitHub Enterprise Server or GitHub Enterprise Cloud with data residency.

- For GitHub Enterprise Server, prefix the hostname with thehttps://URI scheme, as it otherwise defaults tohttp://, which GitHub Enterprise Server does not support.
- For GitHub Enterprise Cloud with data residency, usehttps://YOURSUBDOMAIN.ghe.comas the hostname.

"github": { "command": "docker", "args": [ "run", "-i", "--rm", "-e", "GITHUB_PERSONAL_ACCESS_TOKEN", "-e", "GITHUB_HOST", "ghcr.io/github/github-mcp-server" ], "env": { "GITHUB_PERSONAL_ACCESS_TOKEN": "${input:github_token}", "GITHUB_HOST": "https://<your GHES or ghe.com domain name>" } }

The descriptions of the tools can be overridden by creating agithub-mcp-server-config.jsonfile in the same directory as the binary.

The file should contain a JSON object with the tool names as keys and the new descriptions as values. For example:

{ "TOOL_ADD_ISSUE_COMMENT_DESCRIPTION": "an alternative description", "TOOL_CREATE_BRANCH_DESCRIPTION": "Create a new branch in a GitHub repository" }

You can create an export of the current translations by running the binary with the--export-translationsflag.

This flag will preserve any translations/overrides you have made, while adding any new translations that have been added to the binary since the last time you exported.

./github-mcp-server --export-translations cat github-mcp-server-config.json

You can also use ENV vars to override the descriptions. The environment variable names are the same as the keys in the JSON file, prefixed withGITHUB_MCP_and all uppercase.

For example, to override theTOOL_ADD_ISSUE_COMMENT_DESCRIPTIONtool, you can set the following environment variable:

export GITHUB_MCP_TOOL_ADD_ISSUE_COMMENT_DESCRIPTION="an alternative description"

- get_me- Get details of the authenticated user

- No parameters required

-

get_issue- Gets the contents of an issue within a repository

- owner: Repository owner (string, required)
- repo: Repository name (string, required)
- issue_number: Issue number (number, required)

get_issue_comments- Get comments for a GitHub issue

- owner: Repository owner (string, required)
- repo: Repository name (string, required)
- issue_number: Issue number (number, required)

create_issue- Create a new issue in a GitHub repository

- owner: Repository owner (string, required)
- repo: Repository name (string, required)
- title: Issue title (string, required)
- body: Issue body content (string, optional)
- assignees: Usernames to assign to this issue (string[], optional)
- labels: Labels to apply to this issue (string[], optional)

add_issue_comment- Add a comment to an issue

- owner: Repository owner (string, required)
- repo: Repository name (string, required)
- issue_number: Issue number (number, required)
- body: Comment text (string, required)

list_issues- List and filter repository issues

- owner: Repository owner (string, required)
- repo: Repository name (string, required)
- state: Filter by state ('open', 'closed', 'all') (string, optional)
- labels: Labels to filter by (string[], optional)
- sort: Sort by ('created', 'updated', 'comments') (string, optional)
- direction: Sort direction ('asc', 'desc') (string, optional)
- since: Filter by date (ISO 8601 timestamp) (string, optional)
- page: Page number (number, optional)
- perPage: Results per page (number, optional)

update_issue- Update an existing issue in a GitHub repository

- owner: Repository owner (string, required)
- repo: Repository name (string, required)
- issue_number: Issue number to update (number, required)
- title: New title (string, optional)
- body: New description (string, optional)
- state: New state ('open' or 'closed') (string, optional)
- labels: New labels (string[], optional)
- assignees: New assignees (string[], optional)
- milestone: New milestone number (number, optional)

search_issues- Search for issues and pull requests

- query: Search query (string, required)
- sort: Sort field (string, optional)
- order: Sort order (string, optional)
- page: Page number (number, optional)
- perPage: Results per page (number, optional)

assign_copilot_to_issue- Assign Copilot to a specific issue in a GitHub repository

- owner: Repository owner (string, required)
- repo: Repository name (string, required)
- issueNumber: Issue number (number, required)
- Note: This tool can help with creating a Pull Request with source code changes to resolve the issue. More information can be found atGitHub Copilot documentation

-

get_pull_request- Get details of a specific pull request

- owner: Repository owner (string, required)
- repo: Repository name (string, required)
- pullNumber: Pull request number (number, required)

list_pull_requests- List and filter repository pull requests

- owner: Repository owner (string, required)
- repo: Repository name (string, required)
- state: PR state (string, optional)
- sort: Sort field (string, optional)
- direction: Sort direction (string, optional)
- perPage: Results per page (number, optional)
- page: Page number (number, optional)

merge_pull_request- Merge a pull request

- owner: Repository owner (string, required)
- repo: Repository name (string, required)
- pullNumber: Pull request number (number, required)
- commit_title: Title for the merge commit (string, optional)
- commit_message: Message for the merge commit (string, optional)
- merge_method: Merge method (string, optional)

get_pull_request_files- Get the list of files changed in a pull request

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.