You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
# Install GitHub MCP Server in Claude Applications
This guide covers installation of the GitHub MCP server for Claude Code CLI, Claude Desktop, and Claude Web applications.
## Claude Web (claude.ai)
Claude Web supports remote MCP servers through the Integrations built-in feature.
## Claude Code CLI
### Prerequisites
- Claude Code CLI installed
- [GitHub Personal Access Token](https://github.com/settings/personal-access-tokens/new)
- For local setup: [Docker](https://www.docker.com/) installed and running
- Open Claude Code inside the directory for your project (recommended for best experience and clear scope of configuration)
1. Claude Pro, Team, or Enterprise account (Integrations not available on free plan)
2. [GitHub Personal Access Token](https://github.com/settings/personal-access-tokens/new)
### Installation
**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:
1. Go to [claude.ai](https://claude.ai) and log in
2. Click your profile icon → **Settings**
3. Navigate to **Integrations** section
4. Click **+ Add integration** or **Add More**
5. Enter the remote server URL
6. Follow the OAuth authentication flow when prompted
<details>
<summary><b>Storing Your PAT Securely</b></summary>
<br>
**Alternative**: Use Claude Desktop or Claude Code CLI for reliable GitHub MCP Server integration.
For security, avoid hardcoding your token. One common approach:
---
## Claude Code CLI
Claude Code CLI provides command-line access to Claude with MCP server integration.
### Prerequisites
1. Store your token in `.env` file
```
GITHUB_PAT=your_token_here
```
1. Claude Code CLI installed
2. [GitHub Personal Access Token](https://github.com/settings/personal-access-tokens/new)
3. [Docker](https://www.docker.com/) installed and running
2. Add to .gitignore
```bash
echo -e ".env\n.mcp.json" >> .gitignore
```
### Installation
</details>
Run the following command to add the GitHub MCP server using Docker:
### Remote Server Setup (Streamable HTTP)
1. Run the following command in the Claude Code CLI
```bash
claude mcp addgithub -- docker run -i --rm -e GITHUB_PERSONAL_ACCESS_TOKEN ghcr.io/github/github-mcp-server
claude mcp add--transport http github https://api.githubcopilot.com/mcp -H "Authorization: Bearer YOUR_GITHUB_PAT"
```
Then set the environment variable:
With an environment variable:
```bash
claude mcpupdategithub-e GITHUB_PERSONAL_ACCESS_TOKEN=your_github_pat
claude mcp add github-e GITHUB_PERSONAL_ACCESS_TOKEN=YOUR_GITHUB_PAT -- dockerrun -i--rm -eGITHUB_PERSONAL_ACCESS_TOKENghcr.io/github/github-mcp-server
```
**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.
3. Run `claude mcp list` to see if the GitHub server is configured
### Verification
Run the following command to verify the installation:
```bash
claude mcp list
claude mcp get github
```
---
## Claude Desktop
Claude Desktop provides a graphical interface for interactingwiththe GitHubMCPServer.
> ⚠️ **Note**: Some users have reported compatibility issueswithClaude Desktop and Docker-basedMCPservers. We're investigating. If you experience issues, try using another MCP host, while we look into it!
### Prerequisites
- Claude Desktop installed (latest version)
- [GitHub Personal Access Token](https://github.com/settings/personal-access-tokens/new)
- [Docker](https://www.docker.com/) installed and running
1. Claude Desktop installed
2. [GitHub Personal Access Token](https://github.com/settings/personal-access-tokens/new)
3. [Docker](https://www.docker.com/) installed and running
> **Note**: Claude Desktop supports MCP servers that are both local (stdio) and remote ("connectors"). Remote servers can generally be added via Settings → Connectors → "Add custom connector". However, the GitHub remote MCP server requires OAuth authentication through a registered GitHub App (or OAuth App), which is not currently supported. Use the local Docker setup instead.
**Important**: The npm package `@modelcontextprotocol/server-github` is no longer supported as of April 2025. Use the officialDocker image `ghcr.io/github/github-mcp-server` instead.
### Local Server Setup (Docker)
### Using Environment Variables
Claude Desktop supports environment variable references. You can use:
Add this codeblock to your `claude_desktop_config.json`:
```json
{
Expand All
@@ -134,71 +108,60 @@ Claude Desktop supports environment variable references. You can use:
"ghcr.io/github/github-mcp-server"
],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "$GITHUB_PAT"
"GITHUB_PERSONAL_ACCESS_TOKEN": "YOUR_GITHUB_PAT"
}
}
}
}
```
Then set the environment variable in your system before starting Claude Desktop.
### Installation Steps
### Manual Setup Steps
1. Open Claude Desktop
2. Go to Settings(from the Claude menu)→ Developer → Edit Config
3.Add your chosenconfiguration
4.Savethe file
5. Restart Claude Desktop
### Verification
After restarting, you should see:
- An MCP icon intheClaude Desktop interface
- The GitHub server listed as "running" in Developer settings
2. Go to Settings → Developer → Edit Config
3.Paste the code block above in yourconfiguration file
4.If you're navigating totheconfigurationfile outside of the app:
- If pull fails: `docker logout ghcr.io` then retry
**Server Not Starting / Tools Not Showing:**
- Run `claude mcp list` to view currently configured MCP servers
- Validate JSON syntax
- If using an environment variable to store your PAT, make sure you're properly sourcing your PAT using the environment variable
- Restart Claude Code and check `/mcp` command
- Delete the GitHub server by running `claude mcp remove github` and repeating the setup process with a different method
- Make sure you're running Claude Code within the project you're currently working on to ensure the MCP configuration is properly scoped to your project
- Check logs:
- Claude Code: Use `/mcp` command
- Claude Desktop: `ls ~/Library/Logs/Claude/` and `cat ~/Library/Logs/Claude/mcp-server-*.log` (macOS) or `%APPDATA%\Claude\logs\` (Windows)
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.