Skip to content

fix(permissions): require approval for user MCP tools - #1321

Merged
vastsa merged 1 commit into
mainfrom
fix/mcp-tool-permission-prompt
Oct 2, 2026
Merged

vastsa merged 1 commit into
mainfrom
fix/mcp-tool-permission-prompt

Conversation

@xiaobaZeo

Copy link
Copy Markdown
Collaborator

Summary

Fixes #1320.

PermissionManager classified every mcp_<serverId>_<tool> tool as Low risk, which auto-allows in every mode, so MCP tools ran without an approval card under ask and accept-edits.

  • Classify mcp_ tools as Medium (same as a plugin tool without a valid declaration). Server-declared risk / annotations are ignored and never lower the path.
  • ask / accept-edits: every call shows the approval card ("MCP server tool requires approval"); allow-session covers only that exact tool name.
  • auto still runs them without a card; Plan / Goal still deny them.
  • No change to dispatch, plugins.execute, the mcp_ namespace, host protocol, schema or persistence.
  • Docs: new ADR docs/adr/mcp-tool-approval-risk.md (D640); en + zh-CN tools-and-permissions, security, E2E plan and decisions log updated.

Testing

  • New unit tests in crates/host-core/src/permissions.rs: declared risk ignored, prompts under ask / accept-edits, auto-allow under auto, session-grant scope, denial in Plan / Goal.
  • cargo test -p host-core: 746 passed
  • cargo fmt -p host-core -- --check, cargo clippy -p host-core --all-targets -- -D warnings: clean
  • pnpm docs:check, pnpm check:agent-policy, pnpm check:pr-base: pass

Not covered

  • Desktop E2E journey E2E-MCP-tool-requires-approval not run yet (marked Draft).

MCP tools were classified as low risk and auto-allowed in every mode,
so ask/accept-edits never showed an approval card. Classify mcp_ tools
as medium and ignore server-declared risk. auto still runs them; Plan
and Goal still deny them.

Fixes #1320
@vastsa
vastsa merged commit 503183f into main Oct 2, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] MCP server tools bypass the approval prompt in ask / accept-edits mode

2 participants