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.
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.
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 the local version of the GitHub MCP Server instead.
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 using VS Code 1.101 or later for 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:
| Using OAuth | Using a GitHub PAT |
|---|---|
| VS Code (version 1.101 or greater) | |
|
|
Note: Each MCP host application needs to configure a GitHub App or OAuth App to support remote access via OAuth. Any host application that supports remote MCP servers should support the remote GitHub server with PAT authentication. Configuration details and support levels vary by host. Make sure to refer to the host application's documentation for more info.
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.
Try new features early! The remote server offers an insiders version with early access to new features and experimental tools.
| Using URL Path | Using Header |
|---|---|
|
|
See Remote Server Documentation for more details and examples, and Insiders Features for a full list of what's available.
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 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.
ghcr.io/github/github-mcp-server. The image is public; if you get errors on pull, you may have an expired token and need to docker logout ghcr.io.127.0.0.1:8085) so the container's login callback is reachable. See Local Server OAuth Login for how it works, headless/device-code fallback, and bringing your own OAuth or GitHub App (required for GitHub Enterprise Server and ghe.com).Prefer a token? You can still authenticate with a GitHub Personal Access Token by setting GITHUB_PERSONAL_ACCESS_TOKEN instead (it takes precedence over OAuth). 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 the documentation).
Handling PATs Securely
To keep your GitHub PAT secure and reusable across different MCP hosts:
bash
export GITHUB_PAT=your_token_here
Or create a .env file:
env
GITHUB_PAT=your_token_here
.env filebash
# Add to .gitignore to prevent accidental commits
echo ".env" >> .gitignore
```bash # CLI usage claude mcp add github -e GITHUB_PERSONAL_ACCESS_TOKEN=$GITHUB_PAT -- docker run -i --rm -e GITHUB_PERSONAL_ACCESS_TOKEN ghcr.io/github/github-mcp-server
# In config files (where supported) "env": { "GITHUB_PERSONAL_ACCESS_TOKEN": "$GITHUB_PAT" } ```
Note: Environment variable support varies by host app and IDE. Some applications (like Windsurf) require hardcoded tokens in config files.
repo - Repository operationsread:packages - Docker image accessread:org - Organization team accessbash
chmod 600 ~/.your-app/config.json
The flag --gh-host and the environment variable GITHUB_HOST can be used to set
the hostname for GitHub Enterprise Server or GitHub Enterprise Cloud with data residency.
https:// URI scheme, as it otherwise defaults to http://, which GitHub Enterprise Server does not support.https://YOURSUBDOMAIN.ghe.com as 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>"
}
}
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.
More about using MCP server tools in VS Code's agent mode documentation.
Install in GitHub Copilot on other IDEs (JetBrains, Visual Studio, Eclipse, etc.)
Add one of the following JSON blocks to your IDE's MCP settings.
Log in with OAuth (no token to create or store). On github.com the official image already includes the app credentials, so you provide n
$ claude mcp add github-mcp-server \
-- python -m otcore.mcp_server <graph>