From fb9ccebc060b861525d18f8f552666eee2745972 Mon Sep 17 00:00:00 2001 From: Christopher Harrison Date: Tue, 27 Jan 2026 11:40:55 -0800 Subject: [PATCH 1/5] docs: add Copilot CLI installation guide --- README.md | 2 + docs/installation-guides/README.md | 2 + .../install-copilot-cli.md | 136 ++++++++++++++++++ 3 files changed, 140 insertions(+) create mode 100644 docs/installation-guides/install-copilot-cli.md diff --git a/README.md b/README.md index 975175c61..afe003002 100644 --- a/README.md +++ b/README.md @@ -81,6 +81,7 @@ Alternatively, to manually configure VS Code, choose the appropriate JSON block ### Install in other MCP hosts +- **[Copilot CLI](/docs/installation-guides/install-copilot-cli.md)** - Installation guide for GitHub Copilot CLI - **[GitHub Copilot in other IDEs](/docs/installation-guides/install-other-copilot-ides.md)** - Installation for JetBrains, Visual Studio, Eclipse, and Xcode with GitHub Copilot - **[Claude Applications](/docs/installation-guides/install-claude.md)** - Installation guide for Claude Desktop and Claude Code CLI - **[Codex](/docs/installation-guides/install-codex.md)** - Installation guide for OpenAI Codex @@ -350,6 +351,7 @@ Optionally, you can add a similar example (i.e. without the mcp key) to a file c For other MCP host applications, please refer to our installation guides: +- **[Copilot CLI](docs/installation-guides/install-copilot-cli.md)** - Installation guide for GitHub Copilot CLI - **[GitHub Copilot in other IDEs](/docs/installation-guides/install-other-copilot-ides.md)** - Installation for JetBrains, Visual Studio, Eclipse, and Xcode with GitHub Copilot - **[Claude Code & Claude Desktop](docs/installation-guides/install-claude.md)** - Installation guide for Claude Code and Claude Desktop - **[Cursor](docs/installation-guides/install-cursor.md)** - Installation guide for Cursor IDE diff --git a/docs/installation-guides/README.md b/docs/installation-guides/README.md index be967f81d..4a300e3f4 100644 --- a/docs/installation-guides/README.md +++ b/docs/installation-guides/README.md @@ -3,6 +3,7 @@ This directory contains detailed installation instructions for the GitHub MCP Server across different host applications and IDEs. Choose the guide that matches your development environment. ## Installation Guides by Host Application +- **[Copilot CLI](install-copilot-cli.md)** - Installation guide for GitHub Copilot CLI - **[GitHub Copilot in other IDEs](install-other-copilot-ides.md)** - Installation for JetBrains, Visual Studio, Eclipse, and Xcode with GitHub Copilot - **[Antigravity](install-antigravity.md)** - Installation for Google Antigravity IDE - **[Claude Applications](install-claude.md)** - Installation guide for Claude Web, Claude Desktop and Claude Code CLI @@ -15,6 +16,7 @@ This directory contains detailed installation instructions for the GitHub MCP Se | Host Application | Local GitHub MCP Support | Remote GitHub MCP Support | Prerequisites | Difficulty | |-----------------|---------------|----------------|---------------|------------| +| Copilot CLI | ✅ | ✅ PAT + ❌ No OAuth | Docker or Go build, GitHub PAT | Easy | | Copilot in VS Code | ✅ | ✅ Full (OAuth + PAT) | Local: Docker or Go build, GitHub PAT
Remote: VS Code 1.101+ | Easy | | Copilot Coding Agent | ✅ | ✅ Full (on by default; no auth needed) | Any _paid_ copilot license | Default on | | Copilot in Visual Studio | ✅ | ✅ Full (OAuth + PAT) | Local: Docker or Go build, GitHub PAT
Remote: Visual Studio 17.14+ | Easy | diff --git a/docs/installation-guides/install-copilot-cli.md b/docs/installation-guides/install-copilot-cli.md new file mode 100644 index 000000000..2dbe596ed --- /dev/null +++ b/docs/installation-guides/install-copilot-cli.md @@ -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 + +
+Storing Your PAT Securely +
+ +For security, avoid hardcoding your token. Set your PAT as an environment variable: + +```bash +# Add to your shell profile (~/.bashrc, ~/.zshrc, etc.) +export GITHUB_PERSONAL_ACCESS_TOKEN=your_token_here +``` + +
+ +## 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: + +``` +/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) From 4bb96913907caf89983cc906cc1e995a925eeb60 Mon Sep 17 00:00:00 2001 From: Christopher Harrison Date: Tue, 27 Jan 2026 11:42:32 -0800 Subject: [PATCH 2/5] Update docs/installation-guides/install-copilot-cli.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- docs/installation-guides/install-copilot-cli.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/installation-guides/install-copilot-cli.md b/docs/installation-guides/install-copilot-cli.md index 2dbe596ed..6e20450a7 100644 --- a/docs/installation-guides/install-copilot-cli.md +++ b/docs/installation-guides/install-copilot-cli.md @@ -27,7 +27,7 @@ You can configure the GitHub MCP server in Copilot CLI using either the interact Use the Copilot CLI to interactively add the MCP server: -``` +```bash /mcp add ``` From 1820a0ff11cc2ff91476066ab3c6088e9f6dfa1e Mon Sep 17 00:00:00 2001 From: Christopher Harrison Date: Tue, 27 Jan 2026 15:31:02 -0800 Subject: [PATCH 3/5] Apply suggestion from @GeekTrainer --- docs/installation-guides/install-copilot-cli.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/installation-guides/install-copilot-cli.md b/docs/installation-guides/install-copilot-cli.md index 6e20450a7..5f95a03ef 100644 --- a/docs/installation-guides/install-copilot-cli.md +++ b/docs/installation-guides/install-copilot-cli.md @@ -10,7 +10,7 @@ Storing Your PAT Securely
-For security, avoid hardcoding your token. Set your PAT as an environment variable: +To set your PAT as an environment variable: ```bash # Add to your shell profile (~/.bashrc, ~/.zshrc, etc.) From 9fcf93260bf1cf3de141b7c8ac1bf8a3aeeadbf2 Mon Sep 17 00:00:00 2001 From: Tony Truong Date: Tue, 3 Feb 2026 12:09:31 +0100 Subject: [PATCH 4/5] adding trailing slash to uploads url (#1947) --- internal/ghmcp/server.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/ghmcp/server.go b/internal/ghmcp/server.go index 37aabb0a6..b6e744d3a 100644 --- a/internal/ghmcp/server.go +++ b/internal/ghmcp/server.go @@ -497,7 +497,7 @@ func newGHECHost(hostname string) (apiHost, error) { return apiHost{}, fmt.Errorf("failed to parse GHEC GraphQL URL: %w", err) } - uploadURL, err := url.Parse(fmt.Sprintf("https://uploads.%s", u.Hostname())) + uploadURL, err := url.Parse(fmt.Sprintf("https://uploads.%s/", u.Hostname())) if err != nil { return apiHost{}, fmt.Errorf("failed to parse GHEC Upload URL: %w", err) } From fb53abdbe2f734f5d4e2b686bdac448e8e043048 Mon Sep 17 00:00:00 2001 From: Roberto Nacu Date: Tue, 3 Feb 2026 15:42:14 +0000 Subject: [PATCH 5/5] replace context.Background() (#1948) --- pkg/github/pullrequests.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/github/pullrequests.go b/pkg/github/pullrequests.go index 62952783e..f546865b2 100644 --- a/pkg/github/pullrequests.go +++ b/pkg/github/pullrequests.go @@ -1502,7 +1502,7 @@ func SubmitPendingPullRequestReview(ctx context.Context, client *githubv4.Client "prNum": githubv4.Int(params.PullNumber), } - if err := client.Query(context.Background(), &getLatestReviewForViewerQuery, vars); err != nil { + if err := client.Query(ctx, &getLatestReviewForViewerQuery, vars); err != nil { return ghErrors.NewGitHubGraphQLErrorResponse(ctx, "failed to get latest review for current user", err, @@ -1587,7 +1587,7 @@ func DeletePendingPullRequestReview(ctx context.Context, client *githubv4.Client "prNum": githubv4.Int(params.PullNumber), } - if err := client.Query(context.Background(), &getLatestReviewForViewerQuery, vars); err != nil { + if err := client.Query(ctx, &getLatestReviewForViewerQuery, vars); err != nil { return ghErrors.NewGitHubGraphQLErrorResponse(ctx, "failed to get latest review for current user", err, @@ -1761,7 +1761,7 @@ func AddCommentToPendingReview(t translations.TranslationHelperFunc) inventory.S "prNum": githubv4.Int(params.PullNumber), } - if err := client.Query(context.Background(), &getLatestReviewForViewerQuery, vars); err != nil { + if err := client.Query(ctx, &getLatestReviewForViewerQuery, vars); err != nil { return ghErrors.NewGitHubGraphQLErrorResponse(ctx, "failed to get latest review for current user", err,