You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/copilot/reference/copilot-cli-reference/cli-command-reference.md
+46-4Lines changed: 46 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,6 +26,7 @@ docsTeamMetrics:
26
26
|`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`). |
27
27
|`copilot logout`| Sign out of {% data variables.product.github %} and remove stored credentials. |
28
28
|`copilot plugin`| Manage plugins and plugin marketplaces. |
29
+
|`copilot mcp`| Manage MCP server configurations from the command line. |
29
30
30
31
## Global shortcuts in the interactive interface
31
32
@@ -272,6 +273,8 @@ copilot --allow-tool='MyMCP'
272
273
|`COPILOT_GITHUB_TOKEN`| Authentication token. Takes precedence over `GH_TOKEN` and `GITHUB_TOKEN`. |
273
274
|`COPILOT_HOME`| Override the configuration and state directory. Default: `$HOME/.copilot`. |
274
275
|`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`. |
275
278
|`GH_TOKEN`| Authentication token. Takes precedence over `GITHUB_TOKEN`. |
276
279
|`GITHUB_TOKEN`| Authentication token. |
277
280
|`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
850
853
851
854
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.
852
855
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`. |
|`--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
+
853
885
### Transport types
854
886
855
887
| Type | Description | Required fields |
@@ -918,8 +950,7 @@ MCP servers are loaded from multiple sources, each with a different trust level.
918
950
|--------|-------------|----------------|
919
951
| Built-in | High | No |
920
952
| 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 |
923
954
| User config (`~/.copilot/mcp-config.json`) | User-defined | User responsibility |
924
955
| Remote servers | Low | Always |
925
956
@@ -969,7 +1000,7 @@ Custom agents are specialized AI agents defined in Markdown files. The filename
969
1000
| Agent | Default model | Description |
970
1001
|-------|--------------|-------------|
971
1002
|`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. |
973
1004
|`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. |
974
1005
|`general-purpose`| claude-sonnet-4.5 | Full-capability agent for complex multi-step tasks. Runs in a separate context window. |
975
1006
|`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
996
1027
997
1028
Project-level agents take precedence over user-level agents. Plugin agents have the lowest priority.
998
1029
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
+
999
1041
## Permission approval responses
1000
1042
1001
1043
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
1188
1230
1189
1231
| Flag | Tier | Description |
1190
1232
|------|------|-------------|
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 |
1192
1234
|`BACKGROUND_SESSIONS`| experimental | Multiple concurrent sessions with background management |
1193
1235
|`MULTI_TURN_AGENTS`| experimental | Multi-turn subagent message passing via `write_agent`|
1194
1236
|`EXTENSIONS`| experimental | Programmatic extensions with custom tools and hooks |
Copy file name to clipboardExpand all lines: content/copilot/reference/copilot-cli-reference/cli-config-dir-reference.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -75,7 +75,7 @@ For a full list of configuration settings, enter `copilot help config` in your t
75
75
76
76
### `mcp-config.json`
77
77
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.
79
79
80
80
For more information, see [AUTOTITLE](/copilot/how-tos/copilot-cli/customize-copilot/add-mcp-servers).
Copy file name to clipboardExpand all lines: content/copilot/reference/copilot-cli-reference/cli-plugin-reference.md
+5-6Lines changed: 5 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -146,9 +146,9 @@ For more information, see [AUTOTITLE](/copilot/how-tos/copilot-cli/customize-cop
146
146
| Marketplace manifest |`marketplace.json`, `.plugin/marketplace.json`, `.github/plugin/marketplace.json`, or `.claude-plugin/marketplace.json` (checked in this order) |
147
147
| Agents |`agents/` (default, overridable in manifest) |
148
148
| Skills |`skills/` (default, overridable in manifest) |
149
-
| Hooks config |`hooks.json` or `hooks/hooks.json`|
0 commit comments