GitHub MCP Server
The GitHub MCP Server connects AI tools directly to GitHub's platform. This gives AI agents, assistants, and chatbots the ability to read repositories and code files, manage issues and PRs, analyze code, and automate workflows. All through natural language interactions.
Use Cases
- Repository Management: Browse and query code, search files, analyze commits, and understand project structure across any repository you have access to.
- Issue & PR Automation: Create, update, and manage issues and pull requests. Let AI help triage bugs, review code changes, and maintain project boards.
- CI/CD & Workflow Intelligence: Monitor GitHub Actions workflow runs, analyze build failures, manage releases, and get insights into your development pipeline.
- Code Analysis: Examine security findings, review Dependabot alerts, understand code patterns, and get comprehensive insights into your codebase.
- Team Collaboration: Access discussions, manage notifications, analyze team activity, and streamline processes for your team.
Built for developers who want to connect their AI tools to GitHub context and capabilities, from simple natural language queries to complex multi-step agent workflows.
Configuration
Toolset configuration
See Remote Server Documentation for full details on remote server configuration, toolsets, headers, and advanced usage. This file provides comprehensive instructions and examples for connecting, customizing, and installing the remote GitHub MCP Server in VS Code and other MCP hosts.
When no toolsets are specified, default toolsets are used.
Insiders Mode
Try new features early! The remote server offers an insiders version with early access to new features and experimental tools.
{
"servers": {
"github": {
"type": "http",
"url": "https://api.githubcopilot.com/mcp/insiders"
}
}
}
{
"servers": {
"github": {
"type": "http",
"url": "https://api.githubcopilot.com/mcp/",
"headers": {
"X-MCP-Insiders": "true"
}
}
}
}
See Remote Server Documentation for more details and examples, and Insiders Features for a full list of what's available.
GitHub Enterprise
GitHub Enterprise Cloud with data residency (ghe.com)
GitHub Enterprise Cloud can also make use of the remote server.
Example for https://octocorp.ghe.com with GitHub PAT token:
{
...
"github-octocorp": {
"type": "http",
"url": "https://copilot-api.octocorp.ghe.com/mcp",
"headers": {
"Authorization": "Bearer ${input:github_mcp_pat}"
}
},
...
}
Note: When using OAuth with GitHub Enterprise with VS Code and GitHub Copilot, you also need to configure your VS Code settings to point to your GitHub Enterprise instance - see Authenticate from VS Code
GitHub Enterprise Server
GitHub Enterprise Server does not support remote server hosting. Please refer to GitHub Enterprise Server and Enterprise Cloud with data residency (ghe.com) from the local server configuration.
Build from source
If you don't have Docker, you can use go build to build the binary in the
cmd/github-mcp-server directory, and use the github-mcp-server stdio command with the GITHUB_PERSONAL_ACCESS_TOKEN environment variable set to your token. To specify the output location of the build, use the -o flag. You should configure your server to use the built executable as its command. For example:
{
"mcp": {
"servers": {
"github": {
"command": "/path/to/github-mcp-server",
"args": ["stdio"],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "<YOUR_TOKEN>"
}
}
}
}
}
Tool Configuration
The GitHub MCP Server supports enabling or disabling specific groups of functionalities via the --toolsets flag. 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.
When no toolsets are specified, default toolsets are used.
Looking for examples? See the Server Configuration Guide for common recipes like minimal setups, read-only mode, and combining tools with toolsets.
Specifying Toolsets
To specify toolsets you want available to the LLM, you can pass an allow-list in two ways:
-
Using Command Line Argument:
github-mcp-server --toolsets repos,issues,pull_requests,actions,code_security
-
Using Environment Variable:
GITHUB_TOOLSETS="repos,issues,pull_requests,actions,code_security" ./github-mcp-server
The environment variable GITHUB_TOOLSETS takes precedence over the command line argument if both are provided.
Specifying Individual Tools
You can also configure specific tools using the --tools flag. Tools can be used independently or combined with toolsets for fine-grained control.
-
Using Command Line Argument:
github-mcp-server --tools get_file_contents,issue_read,create_pull_request
-
Using Environment Variable:
GITHUB_TOOLS="get_file_contents,issue_read,create_pull_request" ./github-mcp-server
-
Combining with Toolsets (additive):
github-mcp-server --toolsets repos,issues --tools get_gist
This registers all tools from repos and issues toolsets, plus get_gist.
Important Notes:
- Tools and toolsets can be used together
- Read-only mode takes priority: write tools are skipped if
--read-only is set, even if explicitly requested via --tools
- Tool names must match exactly (e.g.,
get_file_contents, not getFileContents). Invalid tool names will cause the server to fail at startup with an error message
- When tools are renamed, old names are preserved as aliases for backward compatibility. See Tool Renaming for details.
Using Toolsets With Docker
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,actions,code_security" \
ghcr.io/github/github-mcp-server
Using Tools With Docker
When using Docker, you can pass specific tools as environment variables. You can also combine tools with toolsets:
# Tools only
docker run -i --rm \
-e GITHUB_PERSONAL_ACCESS_TOKEN=<your-token> \
-e GITHUB_TOOLS="get_file_contents,issue_read,create_pull_request" \
ghcr.io/github/github-mcp-server
# Tools combined with toolsets (additive)
docker run -i --rm \
-e GITHUB_PERSONAL_ACCESS_TOKEN=<your-token> \
-e GITHUB_TOOLSETS="repos,issues" \
-e GITHUB_TOOLS="get_gist" \
ghcr.io/github/github-mcp-server
Special toolsets
"all" toolset
The special toolset all can be provided to enable all available toolsets regardless of any other configuration:
./github-mcp-server --toolsets all
Or using the environment variable:
GITHUB_TOOLSETS="all" ./github-mcp-server
"default" toolset
The default toolset default is the configuration that gets passed to the server if no toolsets are specified.
The default configuration is:
- context
- repos
- issues
- pull_requests
- users
To keep the default configuration and add additional toolsets:
GITHUB_TOOLSETS="default,stargazers" ./github-mcp-server
Insiders Mode
The local GitHub MCP Server offers an insiders version with early access to new features and experimental tools.
-
Using Command Line Argument:
./github-mcp-server --insiders
-
Using Environment Variable:
GITHUB_INSIDERS=true ./github-mcp-server
When using Docker:
docker run -i --rm \
-e GITHUB_PERSONAL_ACCESS_TOKEN=<your-token> \
-e GITHUB_INSIDERS=true \
ghcr.io/github/github-mcp-server
Available Toolsets
The following sets of tools are available:
| Toolset | Description |
|---|
| context | Strongly recommended: Tools that provide context about the current user and GitHub context you are operating in |
| actions | GitHub Actions workflows and CI/CD operations |
| code_quality | GitHub Code Quality related tools |
| code_security | Code security related tools, such as GitHub Code Scanning |
| copilot | Copilot related tools |
| copilot_issue_intents | Opt-in Copilot issue assignment tools that carry intent metadata (rationale, confidence, suggestion) |
| dependabot | Dependabot tools |
| |
Additional Toolsets in Remote GitHub MCP Server
| Toolset | Description |
|---|
copilot | Copilot related tools (e.g. Copilot Coding Agent) |
copilot_spaces | Copilot Spaces related tools |
github_support_docs_search | Search docs to answer GitHub product and support questions |
Tools
-
actions_get - Get details of GitHub Actions resources (workflows, workflow runs, jobs, and artifacts)
- OAuth Challenge Scopes:
repo
method: The method to execute (string, required)
owner: Repository owner (string, required)
repo: Repository name (string, required)
resource_id: The unique identifier of the resource. This will vary based on the "method" provided, so ensure you provide the correct ID:
- Provide a workflow ID or workflow file name (e.g. ci.yaml) for 'get_workflow' method.
- Provide a workflow run ID for 'get_workflow_run', 'get_workflow_run_usage', and 'get_workflow_run_logs_url' methods.
- Provide an artifact ID for 'download_workflow_run_artifact' method.
- Provide a job ID for 'get_workflow_job' method.
(string, required)
-
actions_list - List GitHub Actions workflows in a repository
- OAuth Challenge Scopes:
repo
method: The action to perform (string, required)
owner: Repository owner (string, required)
page: Page number for pagination (default: 1) (number, optional)
perPage: Results per page for pagination (default: 30, max: 100) (number, optional)
repo: Repository name (string, required)
resource_id: The unique identifier of the resource. This will vary based on the "method" provided, so ensure you provide the correct ID:
- get_code_quality_finding - Get code quality finding
- OAuth Challenge Scopes:
repo
findingNumber: The number of the finding. (number, required)
owner: The owner of the repository. (string, required)
repo: The name of the repository. (string, required)
- assign_copilot_to_issue_with_intent - Assign Copilot to issue with intent
- OAuth Challenge Scopes:
repo
base_ref: Git reference (e.g., branch) that the agent will start its work from. If not specified, defaults to the repository's default branch. Ignored when is_suggestion is true (string, optional)
confidence: How confident you are in this choice. 'HIGH' for clear signal or explicit user request, 'MEDIUM' for reasonable inference with some ambiguity, 'LOW' for best guess with limited signal. (string, required)
custom_instructions: Optional custom instructions to guide the agent beyond the issue body. Ignored when is_suggestion is true (string, optional)
is_suggestion: If true, records a pending Copilot assignment intent rather than launching the agent. Approval later supplies the launch context; base_ref and custom_instructions are ignored in this case. (boolean, required)
issue_number: Issue number (number, required)
owner: Repository owner (string, required)
rationale: One concise sentence explaining what specifically about the issue led to choosing Copilot. State the concrete signal (e.g. 'Well-scoped task with clear acceptance criteria'). (string, required)
repo: Repository name (string, required)
-
create_gist - Create Gist
- OAuth Challenge Scopes:
gist
content: Content for simple single-file gist creation (string, required)
description: Description of the gist (string, optional)
filename: Filename for simple single-file gist creation (string, required)
public: Whether the gist is public (boolean, optional)
-
get_gist - Get Gist Content
gist_id: The ID of the gist (string, required)
-
list_gists - List Gists
page: Page number for pagination (min 1) (number, optional)
perPage: Results per page for pagination (min 1, max 100) (number, optional)
since: Only gists updated after this time (ISO 8601 timestamp) (string, optional)
username: GitHub username (omit for authenticated user's gists) (string, optional)
-
update_gist - Update Gist
- OAuth Challenge Scopes:
gist
content: Content for the file (string, required)
description: Updated description of the gist (string, optional)
filename: Filename to update or create (string, required)
- get_repository_tree - Get repository tree
- OAuth Challenge Scopes:
repo
owner: Repository owner (username or organization) (string, required)
path_filter: Optional path prefix to filter the tree results (e.g., 'src/' to only show files in the src directory) (string, optional)
recursive: Setting this parameter to true returns the objects or subtrees referenced by the tree. Default is false (boolean, optional)
repo: Repository name (string, required)
tree_sha: The SHA1 value or ref (branch or tag) name of the tree. Defaults to the repository's default branch (string, optional)
-
add_issue_comment - Add comment to issue or pull request
- OAuth Challenge Scopes:
repo
body: Comment content. Required unless reaction is provided. (string, optional)
comment_id: The numeric ID of the issue or pull request comment to react to. Use this for reactions to comments; omit it to react to the issue or pull request itself. Cannot be combined with body. (integer, optional)
issue_number: Issue or pull request number to comment on or react to. (number, required)
owner: Repository owner (string, required)
reaction: Emoji reaction to add. Required unless body is provided. (string, optional)
repo: Repository name (string, required)
-
get_label - Get a specific label from a repository
- OAuth Challenge Scopes:
repo
name: Label name. (string, required)
owner: Repository owner (username or organization name) (string, required)
repo: Repository name (string, required)
-
issue_read - Get issue details
- OAuth Challenge Scopes:
repo
issue_number: The number of the issue (number, required)
method: The read operation to perform on a single issue.
Options are:
-
get_label - Get a specific label from a repository
- OAuth Challenge Scopes:
repo
name: Label name. (string, required)
owner: Repository owner (username or organization name) (string, required)
repo: Repository name (string, required)
-
label_write - Write operations on repository labels
- OAuth Challenge Scopes:
repo
color: Label color as 6-character hex code without '#' prefix (e.g., 'f29513'). Required for 'create', optional for 'update'. (string, optional)
description: Label description text. Optional for 'create' and 'update'. (string, optional)
method: Operation to perform: 'create', 'update', or 'delete' (string, required)
name: Label name - required for all operations (string, required)
new_name: New name for the label (used only with 'update' method to rename) (string, optional)
owner: Repository owner (username or organization name) (string, required)
repo: Repository name (string, required)
-
list_label - List labels from a repository
- OAuth Challenge Scopes:
repo
owner: Repository owner (username or organization name) - required for all operations (string, required)
-
dismiss_notification - Dismiss notification
- OAuth Challenge Scopes:
notifications
state: The new state of the notification (read/done) (string, required)
threadID: The ID of the notification thread (string, required)
-
get_notification_details - Get notification details
- OAuth Challenge Scopes:
notifications
notificationID: The ID of the notification (string, required)
-
list_notifications - List notifications
- OAuth Challenge Scopes:
notifications
before: Only show notifications updated before the given time (ISO 8601 format) (string, optional)
filter: Filter notifications to, use default unless specified. Read notifications are ones that have already been acknowledged by the user. Participating notifications are those that the user is directly involved in, such as issues or pull requests they have commented on or created. (string, optional)
owner: Optional repository owner. If provided with repo, only notifications for this repository are listed. (string, optional)
page: Page number for pagination (min 1) (number, optional)
perPage: Results per page for pagination (min 1, max 100) (number, optional)
repo: Optional repository name. If provided with owner, only notifications for this repository are listed. (string, optional)
- : Only show notifications updated after the given time (ISO 8601 format) (string, optional)
- search_orgs - Search organizations
- OAuth Challenge Scopes:
read:org
order: Sort order (string, optional)
page: Page number for pagination (min 1) (number, optional)
perPage: Results per page for pagination (min 1, max 100) (number, optional)
query: Organization search query. Examples: 'microsoft', 'location:california', 'created:>=2025-01-01'. Search is automatically scoped to type:org. (string, required)
sort: Sort field by category (string, optional)
-
list_starred_repositories - List starred repositories
- OAuth Challenge Scopes:
repo
direction: The direction to sort the results by. (string, optional)
page: Page number for pagination (min 1) (number, optional)
perPage: Results per page for pagination (min 1, max 100) (number, optional)
sort: How to sort the results. Can be either 'created' (when the repository was starred) or 'updated' (when the repository was last pushed to). (string, optional)
username: Username to list starred repositories for. Defaults to the authenticated user. (string, optional)
-
star_repository - Star repository
- OAuth Challenge Scopes:
repo
owner: Repository owner (string, required)
repo: Repository name (string, required)
-
unstar_repository - Unstar repository
- OAuth Challenge Scopes:
repo
owner: Repository owner (string, required)
repo: Repository name (string, required)
- search_users - Search users
- OAuth Challenge Scopes:
repo
order: Sort order (string, optional)
page: Page number for pagination (min 1) (number, optional)
perPage: Results per page for pagination (min 1, max 100) (number, optional)
query: User search query. Examples: 'john smith', 'location:seattle', 'followers:>100'. Search is automatically scoped to type:user. (string, required)
sort: Sort users by number of followers or repositories, or when the person joined GitHub. (string, optional)
Additional Tools in Remote GitHub MCP Server
- create_pull_request_with_copilot - Perform task with GitHub Copilot coding agent
owner: Repository owner. You can guess the owner, but confirm it with the user before proceeding. (string, required)
repo: Repository name. You can guess the repository name, but confirm it with the user before proceeding. (string, required)
problem_statement: Detailed description of the task to be performed (e.g., 'Implement a feature that does X', 'Fix bug Y', etc.) (string, required)
title: Title for the pull request that will be created (string, required)
base_ref: Git reference (e.g., branch) that the agent will start its work from. If not specified, defaults to the repository's default branch (string, optional)
- github_support_docs_search - Retrieve documentation relevant to answer GitHub product and support questions. Support topics include: GitHub Actions Workflows, Authentication, GitHub Support Inquiries, Pull Request Practices, Repository Maintenance, GitHub Pages, GitHub Packages, GitHub Discussions, Copilot Spaces
query: Input from the user about the question they need answered. This is the latest raw unedited user message. You should ALWAYS leave the user message as it is, you should never modify it. (string, required)
Read-Only Mode
To run the server in read-only mode, you can use the --read-only flag. This will only offer read-only tools, preventing any modifications to repositories, issues, pull requests, etc.
./github-mcp-server --read-only
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
Lockdown Mode
Lockdown mode limits the content that the server will surface from public repositories. When enabled, the server checks whether the author of each item has push access to the repository. Private repositories are unaffected, and collaborators keep full access to their own content.
Lockdown mode is a best-effort content filter intended to reduce the risk of prompt injection from untrusted repository content (issues, pull requests, comments, commits, etc.). It is not an authorization boundary: it does not change what the underlying GitHub credential can read or write, and content withheld from a filtered tool response may still be reachable through other tools or direct GitHub API access with the same credential.
As an intentional exception, content authored by a small set of trusted bot accounts (currently github-actions[bot] and copilot) is always treated as safe, regardless of push access. This avoids filtering routine automation output (e.g. CI-generated commits or comments) that would otherwise be withheld under lockdown mode.
./github-mcp-server --lockdown-mode
When running with Docker, set the corresponding environment variable:
docker run -i --rm \
-e GITHUB_PERSONAL_ACCESS_TOKEN=<your-token> \
-e GITHUB_LOCKDOWN_MODE=1 \
ghcr.io/github/github-mcp-server
In HTTP mode, this flag (or GITHUB_LOCKDOWN_MODE) is an upper bound: the X-MCP-Lockdown request header can enable lockdown mode when the operator has not, but it cannot disable lockdown mode the operator has already enabled. See the Server Configuration Guide for details.
The behavior of lockdown mode depends on the tool invoked.
Following tools will return an error when the author lacks the push access:
issue_read:get
pull_request_read:get
pull_request_read:get_diff
pull_request_read:get_files
pull_request_read:get_commits
Following tools will filter out content from users lacking the push access:
issue_read:get_comments
issue_read:get_sub_issues
pull_request_read:get_comments
pull_request_read:get_review_comments
pull_request_read:get_reviews
i18n / Overriding Descriptions
The descriptions of the tools can be overridden by creating a
github-mcp-server-config.json file 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-translations flag.
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 with
GITHUB_MCP_ and all uppercase.
For example, to override the TOOL_ADD_ISSUE_COMMENT_DESCRIPTION tool, you can
set the following environment variable:
export GITHUB_MCP_TOOL_ADD_ISSUE_COMMENT_DESCRIPTION="an alternative description"
Overriding Server Name and Title
The same override mechanism can be used to customize the MCP server's name and
title fields in the initialization response. This is useful when running
multiple GitHub MCP Server instances (e.g., one for github.com and one for
GitHub Enterprise Server) so that agents can distinguish between them.
| Key | Environment Variable | Default |
|---|
SERVER_NAME | GITHUB_MCP_SERVER_NAME | github-mcp-server |
SERVER_TITLE | GITHUB_MCP_SERVER_TITLE | GitHub MCP Server |
For example, to configure a server instance for GitHub Enterprise Server:
{
"SERVER_NAME": "ghes-mcp-server",
"SERVER_TITLE": "GHES MCP Server"
}
Or using environment variables:
export GITHUB_MCP_SERVER_NAME="ghes-mcp-server"
export GITHUB_MCP_SERVER_TITLE="GHES MCP Server"
Library Usage
The exported Go API of this module should currently be considered unstable, and subject to breaking changes. In the future, we may offer stability; please file an issue if there is a use case where this would be valuable.
Contributing
Contributions are welcome. Before opening a pull request, please read the contributing guide for setup, testing, linting, and documentation generation instructions.
Support
For help using the GitHub MCP Server, see the support guide. If you have found a bug or want to request a feature, please search existing issues before opening a new one.
Security
Please do not report security vulnerabilities through public issues. Follow the instructions in the security policy to report vulnerabilities responsibly.
License
This project is licensed under the terms of the MIT open source license. Please refer to MIT for the full terms.