Skip to content

Send messages behind Allow writes and a shared confirmation - #344

Closed
oliverames wants to merge 25 commits into
mattt:mainfrom
oliverames:feat/messages-send
Closed

oliverames wants to merge 25 commits into
mattt:mainfrom
oliverames:feat/messages-send

Conversation

@oliverames

@oliverames oliverames commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Review guide. This builds on #342 (itself stacked on #339) and includes the commits of #305 (16 by @mattt). Only one commit is new here: the one after #305 on top of #342 shows all 17. Merge #339, then #342, then this. To try it: turn on Messages writes, then ask a client to send a message and confirm in the window.


What it does and why

This is #305 merged onto the "Allow writes" switch (#342) and the shared send confirmation. It includes #305 and #342, so it can go in on its own or after them.

What changed

  • messages_send is off until Messages writes are turned on.
  • Every send goes through the shared confirmation window, showing the client name, the exact recipients and the full text.
  • The recipient checks, the fixed script with typed Apple event parameters, and the re-check before sending are Add a messages_send tool that asks before each send #305's, unchanged.

Testing

  • The full suite passes.
  • Live on my Mac: an approved send arrived once, cancelling and letting it time out sent nothing, and turning writes off hid the tool.
  • CI: both builds (macOS 26 with Xcode 26.0, macOS 27 with Xcode 27.0) pass.

Not verified

  • A signed, sandboxed build through the normal imcp-server client flow. @lunaroja has offered to check delivery, cancellation, timeout, and the write switch there.

@lunaroja

Copy link
Copy Markdown

Thanks for bringing Messages sending forward to Allow writes, @oliverames. I can independently validate a signed, sandboxed build of this PR on macOS through the normal imcp-server client flow, including delivery, cancellation, timeout, and the write switch.

@mattt, would you prefer one follow-up PR or two for these changes?

  • Send-only access: allow sending to an exact, existing one-to-one iMessage conversation without granting iMCP access to Messages history.
  • Per-client confirmation setting: add a switch in Clients settings that lets a user skip the send preview for a selected credentialed client. The switch defaults to off, so confirmation remains the default and Allow writes still gates all sends.

I verified both behaviors in a signed local fork build and can adapt them to the upstream implementation.

Oliver Ames added 8 commits November 17, 2026 12:56
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

Thanks for offering to run a signed sandboxed check, @lunaroja. The branch is rebased onto main at c22ba57 with CI green. Any results on delivery, cancellation, timeout, and the write switch would be helpful.

@oliverames

Copy link
Copy Markdown
Contributor Author

Replaced by #383, the same change cut as one PR (on top of #377) so it can merge on its own.

@oliverames oliverames closed this Nov 18, 2026
@oliverames
oliverames deleted the feat/messages-send 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.

3 participants