Skip to content

Commit e335503

Browse files
Update Claude Code installation command to use add-json format for v2.1.1+
Co-authored-by: SamMorrowDrums <[email protected]>
1 parent ff0e67e commit e335503

File tree

1 file changed

+24
-6
lines changed

1 file changed

+24
-6
lines changed

docs/installation-guides/install-claude.md

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,23 @@ echo -e ".env\n.mcp.json" >> .gitignore
2828

2929
### Remote Server Setup (Streamable HTTP)
3030

31+
> **Note**: For Claude Code versions **2.1.1 and newer**, use the `add-json` command format below. For older versions, see the [legacy command format](#for-older-versions-of-claude-code).
32+
3133
1. Run the following command in the terminal (not in Claude Code CLI):
3234
```bash
33-
claude mcp add --transport http github https://api.githubcopilot.com/mcp -H "Authorization: Bearer YOUR_GITHUB_PAT"
35+
claude mcp add-json github '{"type":"http","url":"https://api.githubcopilot.com/mcp","headers":{"Authorization":"Bearer YOUR_GITHUB_PAT"}}' --scope user
3436
```
3537

3638
With an environment variable:
3739
```bash
38-
claude mcp add --transport http github https://api.githubcopilot.com/mcp -H "Authorization: Bearer $(grep GITHUB_PAT .env | cut -d '=' -f2)"
40+
claude mcp add-json github '{"type":"http","url":"https://api.githubcopilot.com/mcp","headers":{"Authorization":"Bearer '"$(grep GITHUB_PAT .env | cut -d '=' -f2)"'"}}' --scope user
3941
```
42+
43+
> **About the `--scope` flag**: This specifies where the configuration is stored. Options:
44+
> - `local` (default): Available only to you in the current project (was called `project` in older versions)
45+
> - `project`: Shared with everyone in the project via `.mcp.json` file
46+
> - `user`: Available to you across all projects (was called `global` in older versions)
47+
4048
2. Restart Claude Code
4149
3. Run `claude mcp list` to see if the GitHub server is configured
4250

@@ -72,6 +80,19 @@ claude mcp list
7280
claude mcp get github
7381
```
7482

83+
### For Older Versions of Claude Code
84+
85+
If you're using Claude Code version **2.1.0 or earlier**, use this legacy command format:
86+
87+
```bash
88+
claude mcp add --transport http github https://api.githubcopilot.com/mcp -H "Authorization: Bearer YOUR_GITHUB_PAT"
89+
```
90+
91+
With an environment variable:
92+
```bash
93+
claude mcp add --transport http github https://api.githubcopilot.com/mcp -H "Authorization: Bearer $(grep GITHUB_PAT .env | cut -d '=' -f2)"
94+
```
95+
7596
---
7697

7798
## Claude Desktop
@@ -161,7 +182,4 @@ Add this codeblock to your `claude_desktop_config.json`:
161182

162183
- The npm package `@modelcontextprotocol/server-github` is deprecated as of April 2025
163184
- Remote server requires Streamable HTTP support (check your Claude version)
164-
- Configuration scopes for Claude Code:
165-
- `-s user`: Available across all projects
166-
- `-s project`: Shared via `.mcp.json` file
167-
- Default: `local` (current project only)
185+
- For Claude Code configuration scopes, see the `--scope` flag documentation in the [Remote Server Setup](#remote-server-setup-streamable-http) section

0 commit comments

Comments
 (0)