GitHub MCP Integration Across Three AI Code Assistants
Confused about why your GitHub MCP setup works in one tool but not another? You're not alone. Claude Code, Copilot CLI, and Amazon Q all speak MCP — but they each store config in different places, authenticate differently, and have their own quirks. This post cuts through the noise.
Claude Code
Claude Code reads its MCP configuration from two locations: a global file at ~/.claude.json and a project-scoped .mcp.json at your repo root. It does not read VS Code's profile-level MCP config — that is a separate client entirely.
⚠️ Common mistake: Placing GitHub MCP config inside VS Code's profile mcp.json will not work for Claude Code. They are separate clients with separate config paths.Step 1 — Create a GitHub PAT
Go to GitHub → Settings → Developer settings → Personal access tokens → Fine-grained tokens and select only the scopes you need. For most workflows: contents:read, pull_requests:write, issues:read. Fewer scopes means a smaller blast radius if the token leaks.
Step 2 — Add the token to your environment
Never hardcode the token in your config file. Export it from your shell profile instead:
bash
# ~/.zshrc or ~/.bashrc
export GITHUB_PERSONAL_ACCESS_TOKEN=ghp_xxxxxxxxxxxxxxxxxxxxStep 3 — Register the MCP server
Option A — via CLI (global, only for you):
bash
claude mcp add github-mcp \
-e GITHUB_PERSONAL_ACCESS_TOKEN=$GITHUB_PERSONAL_ACCESS_TOKEN \
-- npx -y @modelcontextprotocol/server-githubOption B — via .mcp.json at project root (shared with your team):
json
{
"mcpServers": {
"github": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-github"],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "${GITHUB_PERSONAL_ACCESS_TOKEN}"
}
}
}
}💡 Pro tip: The.mcp.jsonapproach is the closest thing to a "single config" that works for both Claude Code and VS Code's Copilot MCP client. Both tools read.mcp.jsonfrom the project root — though this is a convention, not a guaranteed cross-tool standard.
Step 4 — Verify
Inside a Claude Code session, run:
/mcpYou should see ● github: connected in the output.
⚠️ Known issue: If you set GitHub via the claude.ai Connectors UI, it may not automatically sync to Claude Code. There is a reported bug where GitHub specifically fails to appear in /mcp even when all other connectors sync correctly. Use direct CLI or JSON config as shown above instead.GitHub Copilot CLI
This is where Copilot CLI has a structural advantage — GitHub built both the CLI and the MCP server, so GitHub access is baked in from the start. No tokens, no JSON files, no npx commands.
Installation
bash
# Install
npm install -g @github/copilot-cli
# Launch and authenticate with your existing GitHub account
copilotOn first launch you complete a standard GitHub OAuth flow in your browser — the same account you already use for GitHub. That is it. GitHub MCP is active immediately.
Verify GitHub MCP is available
Inside a Copilot CLI session:
/toolsLook for entries like github___create_pull_request, github___search_issues, github___get_file_contents — there are 40+ tools available out of the box.
Amazon Q Developer
Amazon Q sits in the middle: it requires manual setup like Claude Code, but supports OAuth authentication like Copilot — giving you more flexibility than either. Config lives in ~/.aws/amazonq/mcp.json (global) or .amazonq/mcp.json (workspace-scoped).
Option A — Remote GitHub MCP via OAuth (recommended)
This uses the remote GitHub MCP server hosted by GitHub, authenticated with OAuth — no PAT needed.
json
{
"mcpServers": {
"github": {
"type": "http",
"url": "https://api.githubcopilot.com/mcp/"
}
}
}Save this to ~/.aws/amazonq/mcp.json. When you start a Q session, it will prompt you to complete an OAuth browser flow to authenticate with GitHub.
Option B — Local GitHub MCP server via PAT
Prefer local execution or need specific scopes? Use the official GitHub MCP server via Docker with a PAT:
json
{
"mcpServers": {
"github": {
"command": "docker",
"args": [
"run", "-i", "--rm",
"-e", "GITHUB_PERSONAL_ACCESS_TOKEN",
"ghcr.io/github/github-mcp-server"
],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "${GITHUB_PERSONAL_ACCESS_TOKEN}"
}
}
}
}Workspace-scoped config
To scope the config to a single project, place it at .amazonq/mcp.json in your repo root instead of the global path.
Verify inside a Q session
bash
q # start a session
/tools # look for github (MCP) entries in the list💡 Tool trust: By default, GitHub MCP tools in Amazon Q are marked not trusted and will prompt for confirmation on every invocation. Run /tools trust github___<tool_name> to auto-approve specific tools you use frequently.Key Takeaways
If you want zero friction and already pay for GitHub Copilot, the CLI is the obvious choice — GitHub MCP is built in, authenticated with your existing account, and ready instantly.
If you want fine-grained control over exactly what GitHub actions your AI agent can take, Claude Code's PAT approach is actually an advantage. You decide the exact scopes, and nothing happens outside them. For an agentic tool that can run autonomously, that is a meaningful security property.
If you are on AWS or want the best of both worlds, Amazon Q gives you OAuth convenience with the option to drop down to a PAT when you need tighter scoping — a flexible middle ground.
None of these tools currently share a single config file that works everywhere. The closest approximation is a project-level .mcp.json at your repo root, which both Claude Code and VS Code's Copilot MCP client will pick up — but that is a convention, not a guarantee, and it does not help for global configuration.
📖 Further reading: GitHub's official MCP server repo https://github.com/github/github-mcp-server includes install guides for all three tools covered here, plus Claude Desktop, JetBrains, and Visual Studio. The MCP spec itself is maintained at https://modelcontextprotocol.io/docs/getting-started/intro.