Skip to content

Commit 8aff77c

Browse files
continue[bot]Continuenate
committed
docs: add allowHeadless documentation for MCP servers in CLI headless mode
- Add allowHeadless property to mcpServers reference documentation - Add comprehensive section in MCP deep dive explaining headless mode behavior - Update CLI overview to mention MCP tools headless mode exclusion - Include examples and security considerations for allowHeadless usage Generated with [Continue](https://continue.dev) Co-Authored-By: Continue <noreply@continue.dev> Co-authored-by: nate <nate@continue.dev>
1 parent 5c232db commit 8aff77c

File tree

3 files changed

+55
-0
lines changed

3 files changed

+55
-0
lines changed

docs/cli/overview.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@ cn -p "Update documentation based on recent code changes"
8787

8888
**In headless mode**, tools with "ask" permission are automatically excluded to prevent the AI from seeing tools it cannot call. This ensures reliable automation without user intervention.
8989

90+
**MCP tools** are excluded in headless mode by default. To enable specific trusted MCP servers in headless workflows, set `allowHeadless: true` in your [MCP server configuration](/customize/deep-dives/mcp#how-to-use-mcp-servers-in-cli-headless-mode).
91+
9092
**In TUI mode**, tools with "ask" permission are available and will prompt for confirmation when the AI attempts to use them.
9193

9294
💡 **Tip**: If your workflow requires tools that need confirmation (like file writes or terminal commands), use TUI mode. For fully automated workflows with read-only operations, use headless mode.

docs/customize/deep-dives/mcp.mdx

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,52 @@ These remote transport options allow you to connect to MCP servers hosted on rem
151151

152152
For detailed information about transport mechanisms and their use cases, refer to the official MCP documentation on [transports](https://modelcontextprotocol.io/docs/concepts/transports#server-sent-events-sse).
153153

154+
### How to Use MCP Servers in CLI Headless Mode
155+
156+
By default, MCP tools are not available in [CLI headless mode](/cli/overview#headless-mode-production-automation) for security reasons. This prevents untrusted tools from executing without user approval during automated workflows.
157+
158+
<Note>
159+
**What is headless mode?**
160+
161+
Headless mode is used for automated, non-interactive workflows like CI/CD pipelines, git hooks, and scripting. In this mode, the CLI cannot prompt for user confirmation.
162+
</Note>
163+
164+
To enable specific trusted MCP servers in headless mode, add `allowHeadless: true` to your server configuration:
165+
166+
```yaml
167+
mcpServers:
168+
- name: Brave Search
169+
command: npx
170+
args:
171+
- "-y"
172+
- "@modelcontextprotocol/server-brave-search"
173+
allowHeadless: true # Enable in headless mode
174+
env:
175+
BRAVE_API_KEY: ${{ secrets.BRAVE_API_KEY }}
176+
```
177+
178+
<Warning>
179+
**Security consideration:** Only set `allowHeadless: true` for MCP servers you fully trust, as their tools will be able to execute without user confirmation in automated workflows.
180+
</Warning>
181+
182+
**When to use `allowHeadless`:**
183+
184+
<CardGroup cols={2}>
185+
<Card title="✅ Good candidates" icon="check">
186+
- Read-only search APIs
187+
- Documentation retrieval services
188+
- Trusted internal tools
189+
- Well-scoped automation utilities
190+
</Card>
191+
192+
<Card title="⚠️ Use with caution" icon="triangle-exclamation">
193+
- File system modification tools
194+
- Database write operations
195+
- External API calls that modify state
196+
- Tools with broad permissions
197+
</Card>
198+
</CardGroup>
199+
154200
### How to Work with Secrets in MCP Servers
155201

156202
With some MCP servers you will need to use API keys or other secrets. You can leverage locally stored environments secrets

docs/reference.mdx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,7 @@ The [Model Context Protocol](https://modelcontextprotocol.io/introduction) is a
316316
- `cwd`: An optional working directory to run the command in. Can be absolute or relative path.
317317
- `requestOptions`: Optional request options for `sse` and `streamable-http` servers. Same format as [model requestOptions](#models).
318318
- `connectionTimeout`: Optional timeout for _initial_ connection to MCP server
319+
- `allowHeadless`: Enable this MCP server's tools in [CLI headless mode](/cli/overview#headless-mode-production-automation). Defaults to `false`. When `true`, tools from this server can be used in automated workflows without user confirmation.
319320

320321
**Example:**
321322

@@ -333,6 +334,12 @@ mcpServers:
333334
cwd: /Users/NAME/project
334335
env:
335336
NODE_ENV: production
337+
- name: Brave Search
338+
command: npx
339+
args:
340+
- "-y"
341+
- "@modelcontextprotocol/server-brave-search"
342+
allowHeadless: true # Enable in CLI headless mode for automation
336343
```
337344

338345
### `data`

0 commit comments

Comments
 (0)