
GitHub MCP Server
OfficialGitHub's official server for repos, issues, PRs, and Actions — local Docker or hosted remote.
Add to your client
Copy the config for your MCP client and paste it into its config file.
docker run -i --rm -e GITHUB_PERSONAL_ACCESS_TOKEN ghcr.io/github/github-mcp-serverPaste into ~/Library/Application Support/Claude/claude_desktop_config.json
{
"mcpServers": {
"github-mcp-server": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"GITHUB_PERSONAL_ACCESS_TOKEN",
"ghcr.io/github/github-mcp-server"
],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "<your-github-pat>"
}
}
}
}Requires Docker to be installed and running.
Before you start
- For the remote server: an MCP client that supports remote servers (VS Code 1.101+, Claude Desktop, Cursor, Windsurf) and either GitHub OAuth or a personal access token
- For local use: Docker running, or a Go build environment to build from source
- A GitHub personal access token — choose scopes for what you need, e.g. `repo` for repository/issue/PR operations, `read:org` for org/team data, `security_events` for code scanning, `notifications`, and `gist`
- For GitHub Enterprise Server: set GITHUB_HOST to your instance URL
About GitHub MCP Server
The GitHub MCP Server is GitHub's own server for connecting AI agents to the GitHub platform. It exposes repositories, files, issues, pull requests, GitHub Actions, code/secret scanning, Dependabot, discussions, gists, projects, and more as MCP tools, organized into toggleable toolsets.
You can run it two ways. The hosted remote server at https://api.githubcopilot.com/mcp/ requires no local install and supports OAuth or PAT auth — ideal for clients like VS Code, Cursor, Windsurf, and Claude Desktop. Alternatively you can run it locally from the ghcr.io/github/github-mcp-server Docker image (or a Go binary) with a personal access token, which is useful for GitHub Enterprise Server via GITHUB_HOST.
The tool surface is large, so the server lets you scope it: GITHUB_TOOLSETS enables only the toolsets you need (defaults include context, repos, issues, pull_requests, users), GITHUB_READ_ONLY disables all write tools, and a lockdown mode filters untrusted content from public repositories.
Tools & capabilities (7)
repos (toolset)Browse and manage repositories: get_file_contents, search_code, list_commits, create_branch, push files.
issues (toolset)Read and write issues: issue_read, issue_write, list_issues, search_issues.
pull_requests (toolset)Work with PRs: create_pull_request, pull_request_read, list_pull_requests, merge_pull_request.
actions (toolset)Inspect and run CI: actions_list, actions_get, actions_run_trigger, get_job_logs.
code_security / secret_protection (toolsets)Read scanning results: get_code_scanning_alert, get_secret_scanning_alert, list_dependabot_alerts.
users / orgs (toolsets)Look up users, organizations, and team membership.
discussions, gists, projects, labels, notifications, git (toolsets)Additional capabilities you can enable as needed for discussions, gists, project boards, labels, notifications, and low-level git operations.
When to use it
- Use it when you want an agent to triage, label, and respond to issues and PRs in natural language
- Use it when reviewing or summarizing pull requests and reading code across repositories
- Use it when monitoring or re-running GitHub Actions workflows and pulling failed job logs
- Use it when surfacing security findings from code scanning, secret scanning, or Dependabot
- Use it when you want a zero-install setup — point your client at the hosted remote server
- Use it when integrating with GitHub Enterprise Server by self-hosting with GITHUB_HOST
Quick setup
- 1Decide between the hosted remote server (https://api.githubcopilot.com/mcp/) and the local Docker image
- 2Create a GitHub personal access token with the scopes your workflows need (or use OAuth on the remote server)
- 3Add the server to your MCP client config, passing GITHUB_PERSONAL_ACCESS_TOKEN for local runs
- 4Optionally scope the surface with GITHUB_TOOLSETS and harden it with GITHUB_READ_ONLY
- 5Restart the client and confirm the GitHub tools load
- 6Verify by asking the agent to list issues or read a file from one of your repositories
Security notes
A personal access token grants broad read/write to your repos, so mint a fine-grained token limited to the repositories and scopes you actually need. The hosted remote server uses OAuth and avoids storing a long-lived token locally.
GitHub MCP Server FAQ
Should I use the remote server or the local Docker image?
Use the hosted remote server (https://api.githubcopilot.com/mcp/) for the quickest setup and OAuth support. Use the local Docker image (ghcr.io/github/github-mcp-server) when you need self-hosting, air-gapped control, or GitHub Enterprise Server.
What token scopes do I need?
It depends on the toolsets. `repo` covers most repository, issue, and PR work; add `read:org` for org/team data, `security_events` for code scanning, and `notifications` or `gist` for those features. Grant the least privilege required.
How do I limit which tools are exposed?
Set GITHUB_TOOLSETS to a comma-separated list of toolsets (or GITHUB_TOOLS for individual tools). The defaults are context, repos, issues, pull_requests, and users.
Can I run it read-only?
Yes. Set GITHUB_READ_ONLY to disable all write tools, and consider lockdown mode to filter untrusted content from public repositories.
Does it work with GitHub Enterprise Server?
Yes. Run the server locally and set GITHUB_HOST to your Enterprise Server URL so API calls are routed to your instance.
Alternatives to GitHub MCP Server
Official AWS Labs server that lets agents call any AWS API via the AWS CLI surface.
Grafana's official server for dashboards, Prometheus/Loki queries, alerts, and incidents.
HashiCorp's official server for Terraform Registry providers, modules, and IaC workflows.
Compare GitHub MCP Server with: