continue-custom/extensions
RomneyDa 913d00bed4 Allow MCP tools in headless mode, ask in TUI mode
MCP tools now have context-aware permissions:
- In headless mode: automatically allowed (no user to ask)
- In TUI mode: require user confirmation (ask permission)

Previously, MCP tools fell under the wildcard '*' policy which defaults to
'ask' permission. In headless mode, tools with 'ask' permission are filtered
out to prevent the AI from seeing tools it cannot call. This caused MCP tools
to be unavailable in headless mode unless explicitly allowed via command-line
flags or agent file configuration.

Implementation:
- Added generateHeadlessPolicies() method to ToolPermissionService
- Headless policies inject 'mcp__*' allow policy before other policies
- Default policies keep MCP tools as 'ask' (appropriate for TUI mode)
- Headless policy only applies when isHeadless flag is true

Benefits:
- ✅ MCP tools work in headless mode without explicit --allow flags
- ✅ MCP tools still require confirmation in TUI mode for safety
- ✅ Consistent with agent file behavior
- ✅ Maintains security for other unmatched tools

Changes:
- Added generateHeadlessPolicies() in ToolPermissionService
- Updated initializeSync to include headless policies
- Added comprehensive tests for headless mode behavior
- Updated documentation to reflect context-aware permissions

Co-authored-by: dallin <dallin@continue.dev>
Generated with [Continue](https://continue.dev)

Co-Authored-By: Continue <noreply@continue.dev>
2026-01-14 23:13:47 +00:00
..
cli Allow MCP tools in headless mode, ask in TUI mode 2026-01-14 23:13:47 +00:00
intellij Merge pull request #9085 from rossigee/fix/overzealous-security-pattern 2025-12-15 16:58:27 -08:00
vscode Merge pull request #9483 from nicdumz/do-not-overwrite-settings 2026-01-14 13:27:36 -08:00