How to connect GitHub to Claude Code
GitHub's MCP server is published by github, the vendor, and it is hosted rather than installed, so this page only registers its address with Claude Code. An Authorization header is optional. The command and config come from the listing's install data and the Claude Code documentation, and the page ends with a check that the server shows as connected.
Updated Oct 26, 2026 · Built from catalog data; how we rank and grade
Checked against Claude Code's documentation on Oct 26, 2026. Commands and config blocks are generated from the same install data as each listing page.
Before you start
- Claude Code installed and able to start.
- Network access to api.githubcopilot.com.
- Authorization (optional): Authorization header with authentication token (PAT or App token).
1. Check what you need
Nothing is installed here. Claude Code only has to reach the server, so confirm network access to
api.githubcopilot.com.- It can take Authorization (next step).
2. Get Authorization
If you choose to send Authorization, create the token (a PAT or App token) in your GitHub account and store it somewhere private.
- Authorization (optional): Authorization header with authentication token (PAT or App token).
3. Add GitHub to Claude Code
The
--headeroption carries the token in the command, while the.mcp.jsonversion reads it from theGITHUB_MCP_SERVER_TOKENenvironment variable. Export that variable before you start Claude Code.Add it for you in every project claude mcp add --transport http --scope user github-mcp-server https://api.githubcopilot.com/mcp/ --header 'Authorization: Bearer YOUR_TOKEN'Or share it with the project: put this in .mcp.json at the project root .mcp.json{ "mcpServers": { "github-mcp-server": { "type": "http", "url": "https://api.githubcopilot.com/mcp/", "headers": { "Authorization": "Bearer ${GITHUB_MCP_SERVER_TOKEN}" } } } }Set the variable in the shell you start the host from export GITHUB_MCP_SERVER_TOKEN="paste-your-value-here"- The command keeps the value in ~/.claude.json; the .mcp.json version refers to an environment variable, so nothing secret is committed.
4. Restart or reload if it does not appear
Skip this unless GitHub is absent from Claude Code after you add it. The notes list what the docs say about restarts and project approval.
- The docs do not say a restart is needed after claude mcp add. Servers connect at startup and can be reconnected from the /mcp menu.
- In an interactive session Claude Code asks you to approve servers from a project .mcp.json before it uses them; claude mcp reset-project-choices resets those answers.
Check that it works
Run claude mcp list and look for the GitHub entry. A connected server should expose its tools, and the catalog records 119 for GitHub, including actions_get.
claude mcp list- Run claude mcp list from the shell, or /mcp inside a session. The list shows each server as Connected, Needs authentication, Failed to connect, or Pending approval.
- Once it is connected, Claude Code should list its tools; the catalog records 119 for GitHub, including actions_get, actions_list and actions_run_trigger.
Troubleshooting
- Error: MCP server has a "url" but no "type"
- Add "type": "http" (or sse) to the entry in the JSON file. Source
- MCP server already exists in local config
- Remove it from the other scope first with claude mcp remove <name> --scope <scope>, then add it again. Source
- A ${VAR} in the config stays literal
- The variable is unset. Export it before starting Claude Code or give it a default with ${VAR:-default}; claude mcp list shows a warning. Source
- Server shows disconnected in a session
- Open /mcp and reconnect it. Source
Reported by other users
Issues in the server's repository (github/github-mcp-server) about installing or starting it, as of Oct 26, 2026. They are links, not fixes: open one to see whether it was resolved.
Security notes
- Publisher: github, listed as the vendor's own server; license MIT.
- Your requests go to api.githubcopilot.com. Check who runs it and what it does with your data before you connect.
- Keep Authorization in an environment variable; the config above refers to it by name, so the value is not written to the file.
- This listing has no security grade: Agent Market has not published security grades yet, so the choice is yours to make from the source and the permissions.
Servers and skills in this guide
Other GitHub servers, a comparison page and the general Claude Code guide are linked next.
- 1GitHub
githubOfficial
Connect AI assistants to GitHub - manage repos, issues, PRs, and workflows through natural language.
★ 33.9KLast active Oct 22, 2026Local (stdio), Remote (HTTP)Claude Code, VS Code, Codex, Cursor +2
AFreshness: A–Security: not graded yet
Related
- Install guideHow to add an MCP server to Claude Code
- Install guideHow to connect GitHub to Cursor
- Best ofBest MCP servers for GitHub
- AlternativesAlternatives to GitHub
- Install guideHow to connect Figma to Claude Code
- Install guideHow to connect Unity to Claude Code
- Install guideHow to connect Kubernetes to Claude Code
Sources
- Connect Claude Code to tools via MCP · fetched Oct 26, 2026
Cite this page
How to connect GitHub to Claude Code. Agent Mart. https://agentmart.dev/guides/connect-github-to-claude-code (last updated 2026-10-26)