Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Update Claude MCP install guide after testing#706

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
D1M1TR10S wants to merge6 commits intogithub:main
base:main
Choose a base branch
Loading
fromD1M1TR10S:main
Open
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
227 changes: 95 additions & 132 deletionsdocs/installation-guides/install-claude.md
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,124 +1,98 @@
# 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 mcpadd --transport httpgithubhttps://api.githubcopilot.com/mcp -H "Authorization: Bearer $(grep GITHUB_PAT .env | cut -d '=' -f2)
```
2. Restart Claude Code
3. Run `claude mcp list` to see if the GitHub server is configured

### Local Server Setup (Docker required)

Or as a single command with the token inline:
### With Docker
1. Run the following command in the Claude Code CLI:
```bash
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"}}'
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.
With an environment variable:
```bash
claude mcp add github -e GITHUB_PERSONAL_ACCESS_TOKEN=$(grep GITHUB_PAT .env | cut -d '=' -f2) -- docker run -i --rm -e GITHUB_PERSONAL_ACCESS_TOKEN ghcr.io/github/github-mcp-server
```
2. Restart Claude Code
3. Run `claude mcp list` to see if the GitHub server is configured

###Configuration Options
###With a Binary (no Docker)

- Use `-s user` to add the server to your user configuration (available across all projects)
- Use `-s project` to add the server to project-specific configuration (shared via `.mcp.json`)
- Default scope is `local` (available only to you in the current project)
1. Download [release binary](https://github.com/github/github-mcp-server/releases)
2. Add to your `PATH`
3. Run:
```bash
claude mcp add-json github '{"command": "github-mcp-server", "args": ["stdio"], "env": {"GITHUB_PERSONAL_ACCESS_TOKEN": "YOUR_GITHUB_PAT"}}'
```
2. Restart Claude Code
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.

### Configuration File Location

- **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)

### Installation

Add the following to your `claude_desktop_config.json`:

```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"
}
}
}
}
```
- **Linux**: `~/.config/Claude/claude_desktop_config.json`

**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:
- **macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
- **Windows**: `%APPDATA%\Claude\claude_desktop_config.json`
5. Open the file in a text editor
6. Paste one of the code blocks above, based on your chosen configuration (remote or local)
7. Replace `YOUR_GITHUB_PAT` with your actual token or $GITHUB_PAT environment variable
8. Savethefile
9. Restart Claude Desktop

---

## Troubleshooting

### Claude Web
- 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

### Claude Code CLI
- Verify the command syntax is correct (note the single quotes around the JSON)
- Ensure Docker is running: `docker --version`
- Use `/mcp` command within Claude Code to check server status

### Claude Desktop
- Check logs at:
- **macOS**: `~/Library/Logs/Claude/`
- **Windows**: `%APPDATA%\Claude\logs\`
- Look for `mcp-server-github.log` for server-specific errors
- Ensure configuration file is valid JSON
- Try running the Docker command manually in terminal to diagnose issues

### Common Issues
- **Invalid JSON**: Validate your configuration at [jsonlint.com](https://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.io` then retry

---

## Security Best Practices

- **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
**Authentication Failed:**
- Verify PAT has `repo` scope
- Check token hasn't expired

**Remote Server:**
- Verify URL: `https://api.githubcopilot.com/mcp`

**Docker Issues (Local Only):**
- Ensure Docker Desktop is running
- Try: `docker pull ghcr.io/github/github-mcp-server`
- 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)

---

##Additional Resources
##Important Notes

- [Model Context Protocol Documentation](https://modelcontextprotocol.io)
- [Claude Code MCP Documentation](https://docs.anthropic.com/en/docs/claude-code/mcp)
- [Claude Web Integrations Support](https://support.anthropic.com/en/articles/11175166-about-custom-integrations-using-remote-mcp)
- The npm package `@modelcontextprotocol/server-github` is deprecated as of April 2025
- Remote server requires Streamable HTTP support (check your Claude version)
- Configuration scopes for Claude Code:
- `-s user`: Available across all projects
- `-s project`: Shared via `.mcp.json` file
- Default: `local` (current project only)
Loading

[8]ページ先頭

©2009-2025 Movatter.jp