GitHub MCP Server (official)
GitHub's official, actively maintained MCP server for repositories, issues, pull requests, Actions and code security. Runs locally in Docker with a personal access token; a hosted remote endpoint is also offered.
Local (stdio)Credential
Set up GitHub MCP Server
Configuration examples, not tested connections. Replace placeholders and review the upstream documentation before use.
Claude Code
Run in your terminal.
claude mcp add github-official --env GITHUB_PERSONAL_ACCESS_TOKEN="$GITHUB_PERSONAL_ACCESS_TOKEN" -- docker run -i --rm -e GITHUB_PERSONAL_ACCESS_TOKEN ghcr.io/github/github-mcp-server
Cursor
Merge into ~/.cursor/mcp.json
{
"mcpServers": {
"github-official": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"GITHUB_PERSONAL_ACCESS_TOKEN",
"ghcr.io/github/github-mcp-server"
],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "REPLACE_WITH_GITHUB_PERSONAL_ACCESS_TOKEN"
}
}
}
}
Codex
Run in your terminal.
codex mcp add github-official --env GITHUB_PERSONAL_ACCESS_TOKEN="$GITHUB_PERSONAL_ACCESS_TOKEN" -- docker run -i --rm -e GITHUB_PERSONAL_ACCESS_TOKEN ghcr.io/github/github-mcp-server
Gemini CLI
Merge into ~/.gemini/settings.json
{
"mcpServers": {
"github-official": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"GITHUB_PERSONAL_ACCESS_TOKEN",
"ghcr.io/github/github-mcp-server"
],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "REPLACE_WITH_GITHUB_PERSONAL_ACCESS_TOKEN"
}
}
}
}
OpenCode
Merge into ~/.config/opencode/opencode.jsonc
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"github-official": {
"type": "local",
"command": [
"docker",
"run",
"-i",
"--rm",
"-e",
"GITHUB_PERSONAL_ACCESS_TOKEN",
"ghcr.io/github/github-mcp-server"
],
"enabled": true,
"environment": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "REPLACE_WITH_GITHUB_PERSONAL_ACCESS_TOKEN"
}
}
}
}
VS Code
Merge into .vscode/mcp.json
{
"servers": {
"github-official": {
"type": "stdio",
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"GITHUB_PERSONAL_ACCESS_TOKEN",
"ghcr.io/github/github-mcp-server"
],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "${input:GITHUB_PERSONAL_ACCESS_TOKEN}"
}
}
},
"inputs": [
{
"id": "GITHUB_PERSONAL_ACCESS_TOKEN",
"type": "promptString",
"description": "GITHUB_PERSONAL_ACCESS_TOKEN",
"password": true
}
]
}
Using more than one server?Add to a config with other servers
Step-by-step setup guides: Claude Code and Codex CLI, Cursor and VS Code. In Claude Desktop, the Cursor JSON goes in claude_desktop_config.json. This is a local server that runs on your machine; see remote vs local servers and authentication and security basics.
Overview
The GitHub MCP Server is GitHub's own implementation, maintained in github/github-mcp-server. It is the current choice for agents that work with GitHub, and it supersedes the archived reference server that this registry still lists as github. Version 2.0.2 shipped on 8 October 2026.
Its tools are grouped into toolsets such as repos, issues, pull_requests, actions and code_security. Examples include get_file_contents and search_code for reading a codebase, issue_read and issue_write for triage, and pull_request_read and create_pull_request for review work. When you don't choose toolsets, a default set is enabled. You can narrow it with the --toolsets flag or the GITHUB_TOOLSETS variable, which keeps the tool list small and limits what the agent can change.
The example here runs the published container image ghcr.io/github/github-mcp-server over stdio, so it needs Docker running locally and a GITHUB_PERSONAL_ACCESS_TOKEN. Give the token only the repository access and permissions your task needs. GitHub also runs a hosted remote at https://api.githubcopilot.com/mcp/. Hosts that have set up a GitHub App or OAuth App can connect to it with OAuth; others send a token in a header, and each client has its own install guide upstream. For GitHub Enterprise Server or ghe.com, set GITHUB_HOST as the README describes.
Example tools
get_file_contentssearch_codeissue_readissue_writepull_request_readcreate_pull_request
Tool names are upstream examples. The server's live tool list can differ.
Related Developer Tools servers
Sources
This page was written from the upstream documentation below and last reviewed on 11 October 2026. Listing is not a security or compatibility endorsement. Report a correction through the contact page.