This guide covers installation of the GitHub MCP server for Claude Code CLI, Claude Desktop, and Claude Web applications.
Claude Web supports remote MCP servers through the Integrations built-in feature.
- Claude Pro, Team, or Enterprise account (Integrations not available on free plan)
- GitHub Personal Access Token
Note: As of July 2025, the remote GitHub MCP Server has known compatibility issues with Claude Web. While Claude Web supports remote MCP servers from other providers (like Atlassian, Zapier, Notion), the GitHub MCP Server integration may not work reliably.
For other remote MCP servers that do work with Claude Web:
- Go to claude.ai and log in
- Click your profile icon → Settings
- Navigate to Integrations section
- Click + Add integration or Add More
- Enter the remote server URL
- Follow the OAuth authentication flow when prompted
Alternative: Use Claude Desktop or Claude Code CLI for reliable GitHub MCP Server integration.
Claude Code CLI provides command-line access to Claude with MCP server integration.
- Claude Code CLI installed
- GitHub Personal Access Token
- Docker installed and running
Run the following command to add the GitHub MCP server using Docker:
claude mcp add github -- docker run -i --rm -e GITHUB_PERSONAL_ACCESS_TOKEN ghcr.io/github/github-mcp-serverThen set the environment variable:
claude mcp update github -e GITHUB_PERSONAL_ACCESS_TOKEN=your_github_patOr as a single command with the token inline:
claude mcp add-json github '{"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"}}'Important: The npm package @modelcontextprotocol/server-github is no longer supported as of April 2025. Use the official Docker image ghcr.io/github/github-mcp-server instead.
- Use
-s userto add the server to your user configuration (available across all projects) - Use
-s projectto add the server to project-specific configuration (shared via.mcp.json) - Default scope is
local(available only to you in the current project)
Run the following command to verify the installation:
claude mcp listClaude Desktop provides a graphical interface for interacting with the GitHub MCP Server.
- Claude Desktop installed
- GitHub Personal Access Token
- Docker installed and running
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json - Linux:
~/.config/Claude/claude_desktop_config.json(unofficial support)
Add the following to your claude_desktop_config.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": "your_github_pat"
}
}
}
}Important: The npm package @modelcontextprotocol/server-github is no longer supported as of April 2025. Use the official Docker image ghcr.io/github/github-mcp-server instead.
Claude Desktop supports environment variable references. You can use:
{
"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_PAT"
}
}
}
}Then set the environment variable in your system before starting Claude Desktop.
- Open Claude Desktop
- Go to Settings (from the Claude menu) → Developer → Edit Config
- Add your chosen configuration
- Save the file
- Restart Claude Desktop
After restarting, you should see:
- An MCP icon in the Claude Desktop interface
- The GitHub server listed as "running" in Developer settings
- Currently experiencing compatibility issues with the GitHub MCP Server
- Try other remote MCP servers (Atlassian, Zapier, Notion) which work reliably
- Use Claude Desktop or Claude Code CLI as alternatives for GitHub integration
- Verify the command syntax is correct (note the single quotes around the JSON)
- Ensure Docker is running:
docker --version - Use
/mcpcommand within Claude Code to check server status
- Check logs at:
- macOS:
~/Library/Logs/Claude/ - Windows:
%APPDATA%\Claude\logs\
- macOS:
- Look for
mcp-server-github.logfor server-specific errors - Ensure configuration file is valid JSON
- Try running the Docker command manually in terminal to diagnose issues
- Invalid JSON: Validate your configuration at jsonlint.com
- PAT issues: Ensure your GitHub PAT has required scopes
- Docker not found: Install Docker Desktop and ensure it's running
- Docker image pull fails: Try
docker logout ghcr.iothen retry
- Protect configuration files: Set appropriate file permissions
- Use environment variables when possible instead of hardcoding tokens
- Limit PAT scope to only necessary permissions
- Regularly rotate your GitHub Personal Access Tokens
- Never commit configuration files containing tokens to version control