-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Allow MCP/Bash tools by default in headless mode #9538
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Learn moreAll Green is an AI agent that automatically: ✅ Addresses code review comments ✅ Fixes failing CI checks ✅ Resolves merge conflicts |
4 similar comments
Learn moreAll Green is an AI agent that automatically: ✅ Addresses code review comments ✅ Fixes failing CI checks ✅ Resolves merge conflicts |
Learn moreAll Green is an AI agent that automatically: ✅ Addresses code review comments ✅ Fixes failing CI checks ✅ Resolves merge conflicts |
Learn moreAll Green is an AI agent that automatically: ✅ Addresses code review comments ✅ Fixes failing CI checks ✅ Resolves merge conflicts |
Learn moreAll Green is an AI agent that automatically: ✅ Addresses code review comments ✅ Fixes failing CI checks ✅ Resolves merge conflicts |
|
|
✅ Review Complete Code Review Summary |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No issues found across 3 files
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>
a0b3127 to
913d00b
Compare

Summary
MCP tools are now allowed by default in both headless and interactive modes by adding an explicit policy for
mcp__*pattern withallowpermission.Inspired by @aaronlippold's work here #9327
Problem
Previously, MCP tools fell under the wildcard
*policy which defaults toaskpermission. In headless mode, tools withaskpermission 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.Solution
Added an explicit default policy for MCP tools (
mcp__*pattern) withallowpermission before the wildcard fallback policy.With this change:
--allowflagaskby default)Changes
{ tool: "mcp__*", permission: "allow" }policyTesting
mcp__*policy exists withallowpermissionmcp__*pattern matching already verify the permission checker works correctlyThis task was co-authored by dallin and Continue.
Continue Tasks
Powered by Continue