From 451b2d84c5f12345c20469d99b88db4ad3728300 Mon Sep 17 00:00:00 2001 From: kerobbi Date: Mon, 9 Feb 2026 15:08:06 +0000 Subject: [PATCH 1/3] improve copilot cli installation doc --- .../install-copilot-cli.md | 88 +++++++++++++------ 1 file changed, 62 insertions(+), 26 deletions(-) diff --git a/docs/installation-guides/install-copilot-cli.md b/docs/installation-guides/install-copilot-cli.md index 5f95a03ef..f26778d44 100644 --- a/docs/installation-guides/install-copilot-cli.md +++ b/docs/installation-guides/install-copilot-cli.md @@ -1,10 +1,48 @@ # Install GitHub MCP Server in Copilot CLI -## Prerequisites +The GitHub MCP server comes pre-installed in Copilot CLI, with read-only tools enabled by default. -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 +## Built-in Server + +To verify the server is available, from an active Copilot CLI session: + +```bash +/mcp show github-mcp-server +``` + +### Per-Session Customization + +Use CLI flags to customize the server for a session: + +```bash +# Enable an additional toolset +copilot --add-github-mcp-toolset discussions + +# Enable multiple additional toolsets +copilot --add-github-mcp-toolset discussions --add-github-mcp-toolset stargazers + +# Enable all toolsets +copilot --enable-all-github-mcp-tools + +# Enable a specific tool +copilot --add-github-mcp-tool list_discussions + +# Disable the built-in server entirely +copilot --disable-builtin-mcps +``` + +Run `copilot --help` for all available flags. For the list of toolsets and tools, see the [toolsets documentation](../../README.md#available-toolsets). + +## Custom Configuration + +Configure the server using one of the methods below. + +> **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. + +### Prerequisites + +1. [GitHub Personal Access Token](https://github.com/settings/personal-access-tokens/new) with appropriate scopes +2. For local server: [Docker](https://www.docker.com/) installed and running
Storing Your PAT Securely @@ -19,21 +57,17 @@ 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: +From an active Copilot CLI session, run the interactive command: ```bash /mcp add ``` -Follow the prompts to configure the GitHub MCP server. +Follow the prompts to configure the server. -### Method 2: Manual Configuration +### Method 2: Manual Setup Create or edit the configuration file `~/.copilot/mcp-config.json` and add one of the following configurations: @@ -45,6 +79,7 @@ Connect to the hosted MCP server: { "mcpServers": { "github": { + "type": "http", "url": "https://api.githubcopilot.com/mcp/", "headers": { "Authorization": "Bearer ${GITHUB_PERSONAL_ACCESS_TOKEN}" @@ -54,6 +89,8 @@ Connect to the hosted MCP server: } ``` +For additional options like toolsets and read-only mode, see the [remote server documentation](../remote-server.md#optional-headers). + #### Local Docker 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: #### 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`. +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: + +```bash +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: +Then configure (replace `/path/to/binary` with the actual path): ```json { @@ -101,35 +142,30 @@ Then, replacing `/path/to/binary` with the actual path to your binary, configure ## 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 +1. Restart Copilot CLI +2. Run `/mcp show` to list configured servers +3. Try: "List my GitHub repositories" ## 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) + - `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 . - ``` + ```bash + cat ~/.copilot/mcp-config.json | jq . + ``` ## References From d074bab3286827cdacf04e116c59bd8049925c4d Mon Sep 17 00:00:00 2001 From: kerobbi Date: Mon, 9 Feb 2026 15:22:18 +0000 Subject: [PATCH 2/3] revert custom config intro --- 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 f26778d44..a17b5a0ff 100644 --- a/docs/installation-guides/install-copilot-cli.md +++ b/docs/installation-guides/install-copilot-cli.md @@ -35,7 +35,7 @@ Run `copilot --help` for all available flags. For the list of toolsets and tools ## Custom Configuration -Configure the server using one of the methods below. +You can configure the GitHub MCP server in Copilot CLI using either the interactive command or by manually editing the configuration file. > **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. From c4b6dfd49161bd0671ae07a8dc9f3fa1eec84f4e Mon Sep 17 00:00:00 2001 From: kerobbi Date: Mon, 9 Feb 2026 15:43:10 +0000 Subject: [PATCH 3/3] apply copilot suggestion --- 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 a17b5a0ff..4ac5b3712 100644 --- a/docs/installation-guides/install-copilot-cli.md +++ b/docs/installation-guides/install-copilot-cli.md @@ -31,7 +31,7 @@ copilot --add-github-mcp-tool list_discussions copilot --disable-builtin-mcps ``` -Run `copilot --help` for all available flags. For the list of toolsets and tools, see the [toolsets documentation](../../README.md#available-toolsets). +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). ## Custom Configuration