Skip to content

Commit 57069bf

Browse files
authored
Update installation guide for GitHub MCP server in Claude...
...applications, emphasizing Docker usage and deprecating NPX.
1 parent 812b674 commit 57069bf

1 file changed

Lines changed: 21 additions & 33 deletions

File tree

docs/installation-guides/install-claude.md

Lines changed: 21 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Install GitHub MCP Server in Claude Applications
22

3-
This guide covers installation for both Claude Code CLI and Claude Desktop applications.
3+
This guide covers installation of the GitHub MCP server for both Claude Code CLI and Claude Desktop applications.
44

55
## Claude Code CLI
66

@@ -10,21 +10,28 @@ Claude Code CLI provides command-line access to Claude with MCP server integrati
1010

1111
1. Claude Code CLI installed
1212
2. [GitHub Personal Access Token](https://github.com/settings/personal-access-tokens/new)
13-
3. Node.js/npm or Docker (depending on installation method)
13+
3. [Docker](https://www.docker.com/) installed and running
1414

15-
### Installation Methods
15+
### Installation
16+
17+
Run the following command to add the GitHub MCP server using Docker:
1618

17-
#### Method 1: Using Docker (Recommended)
1819
```bash
19-
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"}}'
20+
claude mcp add github -- docker run -i --rm -e GITHUB_PERSONAL_ACCESS_TOKEN ghcr.io/github/github-mcp-server
21+
```
22+
23+
Then set the environment variable:
24+
```bash
25+
claude mcp update github -e GITHUB_PERSONAL_ACCESS_TOKEN=your_github_pat
2026
```
2127

22-
#### Method 2: Using NPX (Legacy)
23-
Note: The npm package has moved to GitHub's official repository but remains functional.
28+
Or as a single command with the token inline:
2429
```bash
25-
claude mcp add-json github '{"command": "npx", "args": ["-y", "@modelcontextprotocol/server-github"], "env": {"GITHUB_PERSONAL_ACCESS_TOKEN": "your_github_pat"}}'
30+
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"}}'
2631
```
2732

33+
**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.
34+
2835
### Configuration Options
2936

3037
- Use `-s user` to add the server to your user configuration (available across all projects)
@@ -48,17 +55,15 @@ Claude Desktop provides a graphical interface for interacting with the GitHub MC
4855

4956
1. Claude Desktop installed
5057
2. [GitHub Personal Access Token](https://github.com/settings/personal-access-tokens/new)
51-
3. Node.js/npm or Docker (depending on installation method)
58+
3. [Docker](https://www.docker.com/) installed and running
5259

5360
### Configuration File Location
5461

5562
- **macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
5663
- **Windows**: `%APPDATA%\Claude\claude_desktop_config.json`
5764
- **Linux**: `~/.config/Claude/claude_desktop_config.json` (unofficial support)
5865

59-
### Installation Methods
60-
61-
#### Method 1: Using Docker (Recommended)
66+
### Installation
6267

6368
Add the following to your `claude_desktop_config.json`:
6469

@@ -83,23 +88,7 @@ Add the following to your `claude_desktop_config.json`:
8388
}
8489
```
8590

86-
#### Method 2: Using NPX (Legacy)
87-
88-
Note: The npm package has moved to GitHub's official repository but remains functional.
89-
90-
```json
91-
{
92-
"mcpServers": {
93-
"github": {
94-
"command": "npx",
95-
"args": ["-y", "@modelcontextprotocol/server-github"],
96-
"env": {
97-
"GITHUB_PERSONAL_ACCESS_TOKEN": "your_github_pat"
98-
}
99-
}
100-
}
101-
}
102-
```
91+
**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.
10392

10493
### Using Environment Variables
10594

@@ -148,8 +137,7 @@ After restarting, you should see:
148137

149138
### Claude Code CLI
150139
- Verify the command syntax is correct (note the single quotes around the JSON)
151-
- Check that Node.js/npm is installed: `node --version`
152-
- For Docker method, ensure Docker is running
140+
- Ensure Docker is running: `docker --version`
153141
- Use `/mcp` command within Claude Code to check server status
154142

155143
### Claude Desktop
@@ -158,13 +146,13 @@ After restarting, you should see:
158146
- **Windows**: `%APPDATA%\Claude\logs\`
159147
- Look for `mcp-server-github.log` for server-specific errors
160148
- Ensure configuration file is valid JSON
161-
- Try running the command manually in terminal to diagnose issues
149+
- Try running the Docker command manually in terminal to diagnose issues
162150

163151
### Common Issues
164152
- **Invalid JSON**: Validate your configuration at [jsonlint.com](https://jsonlint.com)
165153
- **PAT issues**: Ensure your GitHub PAT has required scopes
166154
- **Docker not found**: Install Docker Desktop and ensure it's running
167-
- **NPX not found**: Install Node.js from [nodejs.org](https://nodejs.org)
155+
- **Docker image pull fails**: Try `docker logout ghcr.io` then retry
168156

169157
---
170158

0 commit comments

Comments
 (0)