Skip to content

Add four global approval modes for tool calls - #354

Closed
oliverames wants to merge 26 commits into
mattt:mainfrom
oliverames:feat/approval-modes
Closed

oliverames wants to merge 26 commits into
mattt:mainfrom
oliverames:feat/approval-modes

Conversation

@oliverames

@oliverames oliverames commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

This adds four global approval modes in General settings and enforces them in one place, CallTool, so every tool call goes through the same gate. To try it, pick a mode under General settings and call a read and a write tool from a client.

Stacked on #342 (Allow writes) and #344 (Messages send). The diff includes their commits; only one commit is new. Merge #342 and #344 first, then review that commit.

The modes

  1. Ask for Everything (askEverything): prompts in iMCP before every read and write tool call.
  2. Ask for Writes Only (askWritesOnly): prompts before write tool calls (readOnlyHint != true) and runs read-only calls immediately.
  3. Ask in Agent (Full Access in iMCP) (agentManaged): full read and write access inside iMCP without iMCP pop-ups, and shows setup instructions for Claude Desktop, Claude Code, claude.ai, Duet and Muse.
  4. Allow Everything (allowEverything): full read and write access inside iMCP without individual approvals, and explains how to permit all iMCP tools in those five clients.

What else changed

  • Concurrent tool confirmations are serialized through ToolConfirmationQueue, so parallel tool calls wait their turn instead of failing with .busy.
  • ToolCallContext.alreadyConfirmedByGlobalGate stops messages_send from prompting twice after the global gate has confirmed it.
  • Modes 3 and 4 bypass per-service "Allow writes" blocks without overwriting the stored per-service preferences, and skip MacOutboundConfirmer pop-ups.

Testing

  • swift format lint --strict --recursive . is clean, and a full Debug build of iMCP succeeds.
  • xcodebuild test -scheme imcp-serverTests: 290 tests run, 1 skipped (pre-existing, in HomeProxyTests), 0 failures, including 12 new tests in ApprovalModeTests.
  • CI: both jobs pass (macOS 26 with Xcode 26.0 and macOS 27 with Xcode 27.0).

Not verified

  • I have not driven the four modes from a real client against a running app, so the prompts, the queue under parallel calls and the per-client setup instructions were checked only by unit tests.
  • The setup instructions for each client have not been followed step by step in that client.

mattt and others added 26 commits October 26, 2026 08:10
The Notes service is about to create notes and folders through Notes'
scripting interface, which the sandbox permits only for apps listed in
the apple-events exception.
A script built by interpolating text into its source can be changed by
that text. Calling a handler of a fixed script sends each argument as a
typed Apple event descriptor, so no value can alter the script.
Both tools create only. They run handlers of a fixed script in Notes and
pass every value as a parameter. Notes lists them, and runs them, only
while "Allow iMCP to create notes and folders" is on in Notes settings,
which is off by default. Markdown converts to the HTML that Notes keeps.
The README said iMCP never changes notes. Say what the opt-in tools do and
which formatting Notes loses when a note is created through scripting.
Replaces the Notes-only setting. Write tools (readOnlyHint not true) are
hidden from tools/list and refused at call time while a service's setting
is off. notesWritesEnabled migrates to writesEnabled.NotesService.
Brings in messages_send from upstream PR 305 and puts it on this branch's
Allow writes setting and OutboundConfirming window:

- Messages writes start off, and each send is confirmed with no always-allow.
- The confirmation names the client from ToolCallContext, the exact recipient
  handles, the service, and the full text.
- The send script is called as an Apple event subroutine with typed
  parameters through NSAppleScript.Subroutine, which gains an enum code
  parameter and a beforeSending check.
- PR 305's own confirmation view, window controller, gate, and answer type
  are removed in favor of OutboundConfirmation.
@oliverames

Copy link
Copy Markdown
Contributor Author

Replaced by #377, the same change cut from main as one PR so it can merge on its own.

@oliverames oliverames closed this Nov 18, 2026
@oliverames
oliverames deleted the feat/approval-modes branch November 18, 2026 21:44
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.

2 participants