Skip to content

Commit d62855b

Browse files
docs-botgithub-actions[bot]CopilothubwriterCopilot
authored
docs: update copilot-cli content from source docs (#60696)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: hubwriter <54933897+hubwriter@users.noreply.github.com> Co-authored-by: hubwriter <hubwriter@github.com> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent 0982013 commit d62855b

File tree

4 files changed

+53
-12
lines changed

4 files changed

+53
-12
lines changed

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

Lines changed: 46 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ docsTeamMetrics:
2626
| `copilot login` | Authenticate with {% data variables.product.prodname_copilot_short %} via the OAuth device flow. Accepts `--host HOST` to specify the {% data variables.product.github %} host URL (default: `https://github.com`). |
2727
| `copilot logout` | Sign out of {% data variables.product.github %} and remove stored credentials. |
2828
| `copilot plugin` | Manage plugins and plugin marketplaces. |
29+
| `copilot mcp` | Manage MCP server configurations from the command line. |
2930

3031
## Global shortcuts in the interactive interface
3132

@@ -272,6 +273,8 @@ copilot --allow-tool='MyMCP'
272273
| `COPILOT_GITHUB_TOKEN` | Authentication token. Takes precedence over `GH_TOKEN` and `GITHUB_TOKEN`. |
273274
| `COPILOT_HOME` | Override the configuration and state directory. Default: `$HOME/.copilot`. |
274275
| `COPILOT_CACHE_HOME` | Override the cache directory (used for marketplace caches, auto-update packages, and other ephemeral data). See [AUTOTITLE](/copilot/reference/copilot-cli-reference/cli-config-dir-reference#changing-the-location-of-the-configuration-directory) for platform defaults. |
276+
| `COPILOT_SUBAGENT_MAX_DEPTH` | Maximum subagent nesting depth. Default: `6`. Range: `1``256`. |
277+
| `COPILOT_SUBAGENT_MAX_CONCURRENT` | Maximum concurrent subagents across the entire session tree. Default: `32`. Range: `1``256`. |
275278
| `GH_TOKEN` | Authentication token. Takes precedence over `GITHUB_TOKEN`. |
276279
| `GITHUB_TOKEN` | Authentication token. |
277280
| `USE_BUILTIN_RIPGREP` | Set to `false` to use the system ripgrep instead of the bundled version. |
@@ -850,6 +853,35 @@ If multiple hooks of the same type are configured, they execute in order. For `p
850853

851854
MCP servers provide additional tools to the CLI agent. Configure persistent servers in `~/.copilot/mcp-config.json`. Use `--additional-mcp-config` to add servers for a single session.
852855

856+
### `copilot mcp` subcommand
857+
858+
Use `copilot mcp` to manage MCP server configurations from the command line without starting an interactive session.
859+
860+
| Subcommand | Description |
861+
|------------|-------------|
862+
| `list [--json]` | List all configured MCP servers grouped by source. |
863+
| `get <name> [--json]` | Show configuration and tools for a specific server. |
864+
| `add <name>` | Add a server to the user configuration. Writes to `~/.copilot/mcp-config.json`. |
865+
| `remove <name>` | Remove a user-level server. Workspace servers must be edited in their configuration files directly. |
866+
867+
**`copilot mcp add` options:**
868+
869+
| Option | Description |
870+
|--------|-------------|
871+
| `-- <command> [args...]` | Command and arguments for local (stdio) servers. |
872+
| `--url <url>` | URL for remote servers. |
873+
| `--type <type>` | Transport type: `local`, `stdio`, `http`, or `sse`. |
874+
| `--env KEY=VALUE` | Environment variable (repeatable). |
875+
| `--header KEY=VALUE` | HTTP header for remote servers (repeatable). |
876+
| `--tools <tools>` | Tool filter: `"*"` for all, a comma-separated list, or `""` for none. |
877+
| `--timeout <ms>` | Timeout in milliseconds. |
878+
| `--json` | Output added configuration as JSON. |
879+
| `--show-secrets` | Show full environment variable and header values. |
880+
| `--config-dir <path>` | Path to the configuration directory. |
881+
882+
> [!CAUTION]
883+
> `--show-secrets` can print sensitive environment variable and header values to your terminal or logs. Only use this option in trusted environments, and avoid copying, pasting, or otherwise capturing the output in shared logs or history.
884+
853885
### Transport types
854886

855887
| Type | Description | Required fields |
@@ -918,8 +950,7 @@ MCP servers are loaded from multiple sources, each with a different trust level.
918950
|--------|-------------|----------------|
919951
| Built-in | High | No |
920952
| Repository (`.github/mcp.json`) | Medium | Recommended |
921-
| Workspace (`.mcp.json`, `.vscode/mcp.json`) | Medium | Recommended |
922-
| Dev Container (`.devcontainer/devcontainer.json`) | Medium | Recommended |
953+
| Workspace (`.mcp.json`) | Medium | Recommended |
923954
| User config (`~/.copilot/mcp-config.json`) | User-defined | User responsibility |
924955
| Remote servers | Low | Always |
925956

@@ -969,7 +1000,7 @@ Custom agents are specialized AI agents defined in Markdown files. The filename
9691000
| Agent | Default model | Description |
9701001
|-------|--------------|-------------|
9711002
| `code-review` | claude-sonnet-4.5 | High signal-to-noise code review. Analyzes diffs for bugs, security issues, and logic errors. |
972-
| `critic` | complementary model | Rubber-duck adversarial feedback on proposals, designs, and implementations. Identifies weak points and suggests improvements. Available for Claude models. Experimental—requires `--experimental`. |
1003+
| `rubber-duck` | complementary model | Use a complementary model to provide a constructive critique of proposals, designs, implementations, or tests. Identifies weak points and suggests improvements. Only available in experimental mode. |
9731004
| `explore` | claude-haiku-4.5 | Fast codebase exploration. Searches files, reads code, and answers questions. Returns focused answers under 300 words. Safe to run in parallel. |
9741005
| `general-purpose` | claude-sonnet-4.5 | Full-capability agent for complex multi-step tasks. Runs in a separate context window. |
9751006
| `research` | claude-sonnet-4.6 | Deep research agent. Generates a report based on information in your codebase, in relevant repositories, and on the web. |
@@ -996,6 +1027,17 @@ Custom agents are specialized AI agents defined in Markdown files. The filename
9961027

9971028
Project-level agents take precedence over user-level agents. Plugin agents have the lowest priority.
9981029

1030+
### Subagent limits
1031+
1032+
The CLI enforces depth and concurrency limits to prevent runaway agent spawning.
1033+
1034+
| Limit | Default | Environment variable |
1035+
|-------|---------|---------------------|
1036+
| Max depth | `6` | `COPILOT_SUBAGENT_MAX_DEPTH` |
1037+
| Max concurrent | `32` | `COPILOT_SUBAGENT_MAX_CONCURRENT` |
1038+
1039+
**Depth** counts how many agents are nested within one another. When the depth limit is reached, the innermost agent cannot spawn further subagents. **Concurrency** counts how many subagents are running simultaneously across the entire session tree. When the limit is reached, new subagent requests are rejected until an active agent completes. Values are clamped between `1` and `256`.
1040+
9991041
## Permission approval responses
10001042

10011043
When the CLI prompts for permission to execute an operation, you can respond with the following keys.
@@ -1188,7 +1230,7 @@ Feature flags enable functionality that is not yet generally available. Enable f
11881230

11891231
| Flag | Tier | Description |
11901232
|------|------|-------------|
1191-
| `RUBBER_DUCK_AGENT` | experimental | Rubber-duck subagent for adversarial feedback on code and designs (available for Claude models) |
1233+
| `RUBBER_DUCK_AGENT` | experimental | Rubber-duck subagent for adversarial feedback on code and designs |
11921234
| `BACKGROUND_SESSIONS` | experimental | Multiple concurrent sessions with background management |
11931235
| `MULTI_TURN_AGENTS` | experimental | Multi-turn subagent message passing via `write_agent` |
11941236
| `EXTENSIONS` | experimental | Programmatic extensions with custom tools and hooks |

content/copilot/reference/copilot-cli-reference/cli-config-dir-reference.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ For a full list of configuration settings, enter `copilot help config` in your t
7575
7676
### `mcp-config.json`
7777

78-
Defines MCP (Model Context Protocol) servers available at the user level. These servers are available in all your sessions, regardless of which project directory you're in. Project-level MCP configurations (in `.mcp.json`, `.github/mcp.json`, or `.vscode/mcp.json`) take precedence over user-level definitions when server names conflict.
78+
Defines MCP (Model Context Protocol) servers available at the user level. These servers are available in all your sessions, regardless of which project directory you're in. Project-level MCP configurations (in `.mcp.json` or `.github/mcp.json`) take precedence over user-level definitions when server names conflict.
7979

8080
For more information, see [AUTOTITLE](/copilot/how-tos/copilot-cli/customize-copilot/add-mcp-servers).
8181

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

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,9 @@ For more information, see [AUTOTITLE](/copilot/how-tos/copilot-cli/customize-cop
146146
| Marketplace manifest | `marketplace.json`, `.plugin/marketplace.json`, `.github/plugin/marketplace.json`, or `.claude-plugin/marketplace.json` (checked in this order) |
147147
| Agents | `agents/` (default, overridable in manifest) |
148148
| Skills | `skills/` (default, overridable in manifest) |
149-
| Hooks config | `hooks.json` or `hooks/hooks.json` |
150-
| MCP config | `.mcp.json`, `.vscode/mcp.json`, `.devcontainer/devcontainer.json`, `.github/mcp.json` |
151-
| LSP config | `lsp.json` or `.github/lsp.json` |
149+
| Hooks configuration | `hooks.json` or `hooks/hooks.json` |
150+
| MCP configuration | `.mcp.json`, `.github/mcp.json` |
151+
| LSP configuration | `lsp.json` or `.github/lsp.json` |
152152

153153
## Loading order and precedence
154154

@@ -202,9 +202,8 @@ The following diagram illustrates the loading order and precedence rules.
202202
┌──────────────────────▼──────────────────────────────────────────────┐
203203
│ MCP SERVERS - LAST LOADED IS USED (dedup by server name) │
204204
│ 1. ~/.copilot/mcp-config.json (lowest priority) │
205-
│ 2. .vscode/mcp.json (workspace) │
206-
│ 3. PLUGIN: MCP configs (plugins) │
207-
│ 4. --additional-mcp-config flag (highest priority) │
205+
│ 2. PLUGIN: MCP configs (plugins) │
206+
│ 3. --additional-mcp-config flag (highest priority) │
208207
└─────────────────────────────────────────────────────────────────────┘
209208
```
210209

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
ed524424679cf44e46cf94e5beb5b8aa9974b554
1+
36e4da8c7502ef8fc3f3380182cd7ea164365662

0 commit comments

Comments
 (0)