Skip to content

Commit 46680db

Browse files
authored
Improve Copilot CLI installation doc (#1972)
* improve copilot cli installation doc * revert custom config intro * apply copilot suggestion
1 parent 121d50a commit 46680db

File tree

1 file changed

+62
-26
lines changed

1 file changed

+62
-26
lines changed

docs/installation-guides/install-copilot-cli.md

Lines changed: 62 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,48 @@
11
# Install GitHub MCP Server in Copilot CLI
22

3-
## Prerequisites
3+
The GitHub MCP server comes pre-installed in Copilot CLI, with read-only tools enabled by default.
44

5-
1. Copilot CLI installed (see [official Copilot CLI documentation](https://docs.github.com/en/copilot/concepts/agents/about-copilot-cli))
6-
2. [GitHub Personal Access Token](https://github.com/settings/personal-access-tokens/new) with appropriate scopes
7-
3. For local installation: [Docker](https://www.docker.com/) installed and running
5+
## Built-in Server
6+
7+
To verify the server is available, from an active Copilot CLI session:
8+
9+
```bash
10+
/mcp show github-mcp-server
11+
```
12+
13+
### Per-Session Customization
14+
15+
Use CLI flags to customize the server for a session:
16+
17+
```bash
18+
# Enable an additional toolset
19+
copilot --add-github-mcp-toolset discussions
20+
21+
# Enable multiple additional toolsets
22+
copilot --add-github-mcp-toolset discussions --add-github-mcp-toolset stargazers
23+
24+
# Enable all toolsets
25+
copilot --enable-all-github-mcp-tools
26+
27+
# Enable a specific tool
28+
copilot --add-github-mcp-tool list_discussions
29+
30+
# Disable the built-in server entirely
31+
copilot --disable-builtin-mcps
32+
```
33+
34+
Run `copilot --help` for all available flags. For the list of toolsets, see [Available toolsets](../../README.md#available-toolsets); for the list of tools, see [Tools](../../README.md#tools).
35+
36+
## Custom Configuration
37+
38+
You can configure the GitHub MCP server in Copilot CLI using either the interactive command or by manually editing the configuration file.
39+
40+
> **Server naming:** Name your server `github-mcp-server` to replace the built-in server, or use a different name (e.g., `github`) to run alongside it.
41+
42+
### Prerequisites
43+
44+
1. [GitHub Personal Access Token](https://github.com/settings/personal-access-tokens/new) with appropriate scopes
45+
2. For local server: [Docker](https://www.docker.com/) installed and running
846

947
<details>
1048
<summary><b>Storing Your PAT Securely</b></summary>
@@ -19,21 +57,17 @@ export GITHUB_PERSONAL_ACCESS_TOKEN=your_token_here
1957

2058
</details>
2159

22-
## GitHub MCP Server Configuration
23-
24-
You can configure the GitHub MCP server in Copilot CLI using either the interactive command or by manually editing the configuration file.
25-
2660
### Method 1: Interactive Setup (Recommended)
2761

28-
Use the Copilot CLI to interactively add the MCP server:
62+
From an active Copilot CLI session, run the interactive command:
2963

3064
```bash
3165
/mcp add
3266
```
3367

34-
Follow the prompts to configure the GitHub MCP server.
68+
Follow the prompts to configure the server.
3569

36-
### Method 2: Manual Configuration
70+
### Method 2: Manual Setup
3771

3872
Create or edit the configuration file `~/.copilot/mcp-config.json` and add one of the following configurations:
3973

@@ -45,6 +79,7 @@ Connect to the hosted MCP server:
4579
{
4680
"mcpServers": {
4781
"github": {
82+
"type": "http",
4883
"url": "https://api.githubcopilot.com/mcp/",
4984
"headers": {
5085
"Authorization": "Bearer ${GITHUB_PERSONAL_ACCESS_TOKEN}"
@@ -54,6 +89,8 @@ Connect to the hosted MCP server:
5489
}
5590
```
5691

92+
For additional options like toolsets and read-only mode, see the [remote server documentation](../remote-server.md#optional-headers).
93+
5794
#### Local Docker
5895

5996
With Docker running, you can run the GitHub MCP server in a container:
@@ -81,9 +118,13 @@ With Docker running, you can run the GitHub MCP server in a container:
81118

82119
#### Binary
83120

84-
You can download the latest binary release from the [GitHub releases page](https://github.com/github/github-mcp-server/releases) or build it from source by running `go build -o github-mcp-server ./cmd/github-mcp-server`.
121+
You can download the latest binary release from the [GitHub releases page](https://github.com/github/github-mcp-server/releases) or build it from source by running:
85122

86-
Then, replacing `/path/to/binary` with the actual path to your binary, configure Copilot CLI with:
123+
```bash
124+
go build -o github-mcp-server ./cmd/github-mcp-server
125+
```
126+
127+
Then configure (replace `/path/to/binary` with the actual path):
87128

88129
```json
89130
{
@@ -101,35 +142,30 @@ Then, replacing `/path/to/binary` with the actual path to your binary, configure
101142

102143
## Verification
103144

104-
To verify that the GitHub MCP server has been configured:
105-
106-
1. Start or restart Copilot CLI
107-
2. The GitHub tools should be available for use in your conversations
145+
1. Restart Copilot CLI
146+
2. Run `/mcp show` to list configured servers
147+
3. Try: "List my GitHub repositories"
108148

109149
## Troubleshooting
110150

111151
### Local Server Issues
112152

113153
- **Docker errors**: Ensure Docker Desktop is running
114-
```bash
115-
docker --version
116-
```
117154
- **Image pull failures**: Try `docker logout ghcr.io` then retry
118-
- **Docker not found**: Install Docker Desktop and ensure it's running
119155

120156
### Authentication Issues
121157

122158
- **Invalid PAT**: Verify your GitHub PAT has correct scopes:
123-
- `repo` - Repository operations
124-
- `read:packages` - Docker image access (if using Docker)
159+
- `repo` - Repository operations
160+
- `read:packages` - Docker image access (if using Docker)
125161
- **Token expired**: Generate a new GitHub PAT
126162

127163
### Configuration Issues
128164

129165
- **Invalid JSON**: Validate your configuration:
130-
```bash
131-
cat ~/.copilot/mcp-config.json | jq .
132-
```
166+
```bash
167+
cat ~/.copilot/mcp-config.json | jq .
168+
```
133169

134170
## References
135171

0 commit comments

Comments
 (0)