GitHub MCP Server
MCP serversGitHub's official MCP server: repositories, issues, pull requests, and Actions workflow runs and logs for your agent.
Install
$ claude mcp add github -e GITHUB_OAUTH_CALLBACK_PORT=8085 -- docker run -i --rm -p 127.0.0.1:8085:8085 -e GITHUB_OAUTH_CALLBACK_PORT ghcr.io/github/github-mcp-server
Works with Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot and any other MCP client.
Update
$ docker pull ghcr.io/github/github-mcp-server
The server runs from the local copy of the image, so pull it for a newer version, then restart Claude Code.
When to use it
- A CI run failed and you want the agent to read the failing job's logs and fix the cause.
- You want the agent to read issues and pull requests, open a pull request or comment on one from inside Claude Code.
- You work across several repositories and want code search and file reads without cloning each one.
Commands & flags
- actions_list / actions_get
- List workflows, runs, jobs and artifacts, and read one of them in detail.
- get_job_logs
- Read a job's logs, or every failed job of a run with failed_only.
- actions_run_trigger
- Start a workflow with run_workflow, or act on an existing run by its run_id.
- issue_read / list_issues
- Read one issue or list a repository's issues.
- pull_request_read / create_pull_request
- Read a pull request or open a new one.
- get_file_contents / search_code
- Read files and search code without cloning the repository.
- GITHUB_TOOLSETS="default,actions"
- Server environment variable: the actions toolset is off by default, so add it to the default set.
How to use it
This is an MCP server. The command above runs GitHub's image locally, so Docker must be running. Run it in a terminal, not inside Claude Code:
claude mcp add github -e GITHUB_OAUTH_CALLBACK_PORT=8085 -- docker run -i --rm -p 127.0.0.1:8085:8085 -e GITHUB_OAUTH_CALLBACK_PORT ghcr.io/github/github-mcp-server
It logs you in with OAuth in the browser on first use and keeps the token in memory only, so there is no token to create. A Personal Access Token in GITHUB_PERSONAL_ACCESS_TOKEN takes precedence if you prefer one. Check it with claude mcp list.
The default toolsets are context, repos, issues, pull_requests and users. For CI work, pass GITHUB_TOOLSETS="default,actions" into the container the same way the command passes GITHUB_OAUTH_CALLBACK_PORT. --read-only (or GITHUB_READ_ONLY=1 in Docker) drops every write tool.
No Docker? GitHub also hosts the server at https://api.githubcopilot.com/mcp, which needs a PAT in an Authorization header; its install guide has the exact claude mcp add commands, and /x/actions on the URL selects the Actions toolset.
Why it earns its place
It is maintained by GitHub and covers far more than git does: Actions runs and logs, issues, pull requests, code search, security alerts and Dependabot, chosen by toolset so you load only what the task needs.
If gh is installed and signed in, Claude Code can already do much of this through the CLI without extra tool schemas in context, so add the server when you want structured tools or the Actions log readers. Grant the narrowest access you can: a pull request created by the agent is a real one.
Try it
> The last CI run on my branch failed. Read the failed job logs with the GitHub MCP, find the cause, and fix it in this repo.