Skip to content

Commit ebee9fe

Browse files
authored
Document non-interactive Copilot CLI MCP setup (#62636)
Copilot-Session: f9d8f374-49cb-45e4-bf8e-55086fefed76
1 parent f45ba61 commit ebee9fe

2 files changed

Lines changed: 33 additions & 5 deletions

File tree

content/copilot/how-tos/copilot-cli/use-copilot-cli/overview.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,23 @@ For more information, see [AUTOTITLE](/copilot/how-tos/copilot-cli/customize-cop
263263
264264
{% data variables.copilot.copilot_cli_short %} comes with the {% data variables.product.github %} MCP server already configured. This MCP server allows you to interact with resources on {% data variables.product.prodname_dotcom_the_website %}—for example, allowing you to merge pull requests from the CLI.
265265
266-
To extend the functionality available to you in {% data variables.copilot.copilot_cli_short %}, you can add more MCP servers:
266+
To extend the functionality available to you in {% data variables.copilot.copilot_cli_short %}, you can add more MCP servers.
267+
268+
To add a remote HTTP server directly from your terminal without starting an interactive session, use:
269+
270+
```shell copy
271+
copilot mcp add --transport http SERVER-NAME URL
272+
```
273+
274+
For example:
275+
276+
```shell copy
277+
copilot mcp add --transport http sentry https://mcp.sentry.dev/mcp
278+
```
279+
280+
For local servers and additional options, see [AUTOTITLE](/copilot/how-tos/copilot-cli/customize-copilot/add-mcp-servers#using-the-copilot-mcp-add-subcommand).
281+
282+
Alternatively, add a server from an interactive session:
267283
268284
1. Use the following slash command:
269285

content/copilot/reference/copilot-cli-reference/cli-command-reference.md

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -653,18 +653,30 @@ Use `copilot mcp` to manage MCP server configurations from the command line with
653653
|------------|-------------|
654654
| `list [--json]` | List all configured MCP servers grouped by source, including plugin-provided servers. |
655655
| `get <name> [--json]` | Show configuration and tools for a specific server. For plugin-provided servers, also shows the source plugin name and version. |
656-
| `add <name>` | Add a server to the user configuration. Writes to `~/.copilot/mcp-config.json`. |
656+
| `add [options] <name> [url]` | Add a server to the user configuration. Writes to `~/.copilot/mcp-config.json`. |
657657
| `remove <name>` | Remove a user-level server. Workspace servers must be edited in their configuration files directly. |
658658

659+
For local (stdio) servers, provide the command after `--`:
660+
661+
```shell copy
662+
copilot mcp add SERVER-NAME -- COMMAND [ARGS...]
663+
```
664+
665+
For remote HTTP or SSE servers, specify the transport and provide the URL:
666+
667+
```shell copy
668+
copilot mcp add --transport http SERVER-NAME URL
669+
```
670+
659671
**`copilot mcp add` options:**
660672

661673
| Option | Description |
662674
|--------|-------------|
663675
| `-- <command> [args...]` | Command and arguments for local (stdio) servers. |
664-
| `--url <url>` | URL for remote servers. |
665-
| `--type <type>` | Transport type: `local`, `stdio`, `http`, or `sse`. |
676+
| `<url>` | URL for remote servers. |
677+
| `--transport <transport>` | Transport type: `stdio`, `http`, or `sse`. The default is `stdio`. |
666678
| `--env KEY=VALUE` | Environment variable (repeatable). |
667-
| `--header KEY=VALUE` | HTTP header for remote servers (repeatable). |
679+
| `--header "HEADER: VALUE"` | HTTP header for remote servers (repeatable). |
668680
| `--tools <tools>` | Tool filter: `"*"` for all, a comma-separated list, or `""` for none. |
669681
| `--timeout <ms>` | Timeout in milliseconds. |
670682
| `--json` | Output added configuration as JSON. |

0 commit comments

Comments
 (0)