-
Notifications
You must be signed in to change notification settings - Fork 3.5k
docs: add Copilot CLI installation guide #1913
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
SamMorrowDrums
merged 3 commits into
github:main
from
GeekTrainer:add-copilot-cli-installation-guide
Jan 28, 2026
+140
−0
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,136 @@ | ||
| # Install GitHub MCP Server in Copilot CLI | ||
|
|
||
| ## Prerequisites | ||
|
|
||
| 1. Copilot CLI installed (see [official Copilot CLI documentation](https://docs.github.com/en/copilot/concepts/agents/about-copilot-cli)) | ||
| 2. [GitHub Personal Access Token](https://github.com/settings/personal-access-tokens/new) with appropriate scopes | ||
| 3. For local installation: [Docker](https://www.docker.com/) installed and running | ||
|
|
||
| <details> | ||
| <summary><b>Storing Your PAT Securely</b></summary> | ||
| <br> | ||
|
|
||
| To set your PAT as an environment variable: | ||
|
|
||
| ```bash | ||
| # Add to your shell profile (~/.bashrc, ~/.zshrc, etc.) | ||
| export GITHUB_PERSONAL_ACCESS_TOKEN=your_token_here | ||
| ``` | ||
|
|
||
| </details> | ||
|
|
||
| ## GitHub MCP Server Configuration | ||
|
|
||
| You can configure the GitHub MCP server in Copilot CLI using either the interactive command or by manually editing the configuration file. | ||
|
|
||
| ### Method 1: Interactive Setup (Recommended) | ||
|
|
||
| Use the Copilot CLI to interactively add the MCP server: | ||
|
|
||
| ```bash | ||
| /mcp add | ||
| ``` | ||
|
|
||
| Follow the prompts to configure the GitHub MCP server. | ||
|
|
||
| ### Method 2: Manual Configuration | ||
|
|
||
| Create or edit the configuration file `~/.copilot/mcp-config.json` and add one of the following configurations: | ||
|
|
||
| #### Remote Server | ||
|
|
||
| Connect to the hosted MCP server: | ||
|
|
||
| ```json | ||
| { | ||
| "mcpServers": { | ||
| "github": { | ||
| "url": "https://api.githubcopilot.com/mcp/", | ||
| "headers": { | ||
| "Authorization": "Bearer ${GITHUB_PERSONAL_ACCESS_TOKEN}" | ||
| } | ||
| } | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| #### Local Docker | ||
|
|
||
| With Docker running, you can run the GitHub MCP server in a container: | ||
|
|
||
| ```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": "${GITHUB_PERSONAL_ACCESS_TOKEN}" | ||
| } | ||
| } | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| #### Binary | ||
|
|
||
| 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`. | ||
|
|
||
| Then, replacing `/path/to/binary` with the actual path to your binary, configure Copilot CLI with: | ||
|
|
||
| ```json | ||
| { | ||
| "mcpServers": { | ||
| "github": { | ||
| "command": "/path/to/binary", | ||
| "args": ["stdio"], | ||
| "env": { | ||
| "GITHUB_PERSONAL_ACCESS_TOKEN": "${GITHUB_PERSONAL_ACCESS_TOKEN}" | ||
| } | ||
| } | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| ## Verification | ||
|
|
||
| To verify that the GitHub MCP server has been configured: | ||
|
|
||
| 1. Start or restart Copilot CLI | ||
| 2. The GitHub tools should be available for use in your conversations | ||
|
|
||
| ## Troubleshooting | ||
|
|
||
| ### Local Server Issues | ||
|
|
||
| - **Docker errors**: Ensure Docker Desktop is running | ||
| ```bash | ||
| docker --version | ||
| ``` | ||
| - **Image pull failures**: Try `docker logout ghcr.io` then retry | ||
| - **Docker not found**: Install Docker Desktop and ensure it's running | ||
|
|
||
| ### Authentication Issues | ||
|
|
||
| - **Invalid PAT**: Verify your GitHub PAT has correct scopes: | ||
| - `repo` - Repository operations | ||
| - `read:packages` - Docker image access (if using Docker) | ||
| - **Token expired**: Generate a new GitHub PAT | ||
|
|
||
| ### Configuration Issues | ||
|
|
||
| - **Invalid JSON**: Validate your configuration: | ||
| ```bash | ||
| cat ~/.copilot/mcp-config.json | jq . | ||
| ``` | ||
|
|
||
| ## References | ||
|
|
||
| - [Copilot CLI Documentation](https://docs.github.com/en/copilot/concepts/agents/about-copilot-cli) | ||
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.
Uh oh!
There was an error while loading. Please reload this page.