Repository navigation
Add notes_create and notes_create_folder behind a Notes setting - #339
oliverames wants to merge 5 commits into
Conversation
|
I tested Could you add That round-trip also caught a title duplication bug in our first version. Passing I’m happy to run the same signed check on the revised head, including first-use consent, creation and readback, and disabling writes on the existing connection. |
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.
a2d3ae2 to
e0fbfaf
Compare
|
Thank you for the signed-build test, @lunaroja, and for tracing the failure to the TCC log.
An exact readback assertion needs a live Notes app, so the unit tests in |
What it does and why
Notes is read-only in iMCP, so an agent can't save what it finds or drafts. This adds
notes_createandnotes_create_folder, using AppleScript and nothing else: no helper app, no Shortcuts, and no private APIs. It follows what Mattt suggested on #311, which is to start with creating notes and folders and discuss updates separately. sweetrb/apple-notes-mcp was the design reference for what a Notes MCP should cover.What changed
App/App.entitlementsandApp/App.Debug.entitlements) declarecom.apple.security.automation.apple-eventsalongsidecom.apple.Notesin the Apple Events temporary exception list.App/Info.plistupdates the Apple Events usage description. The entitlement was added after @lunaroja's signed-build test traced a failure to its absence.notes_createtakes a title, a body in plaintext, Markdown, or HTML, an optional folder path likeParent/Child, an account, andcreateMissingFolders.notes_create_foldertakes a name, a parent path, and an account. A missing folder is an error unlesscreateMissingFoldersis set.text (url)and checklists become ☐ and ☑ bullets. The README documents these limits.body, never asname, which avoids a duplicated title.toolstoreadToolsinNotes.swift, so it will need a small rebase after Add Notes filters, accounts, stats, tags, and attachment listing #337.Testing
NotesWriteTestsand others) cover the generated body, the input checks, and a test that sends quotes,do shell script, andend tellin a title through a real handler call. CI lint, the Debug build, and the 204 tests passed when this was written.<b>in the title, kept nested bullets, and raised the expected error for a missing subfolder.Not verified
notes_fetchandnotes_read, and turning writes off on an existing connection.Screenshots
This is the Notes page in the current Settings window of my integration build, whose sidebar still says "Developer & Advanced" (since renamed "Advanced"). "Create Note" and "Create Note Folder" are this PR's. The "Private Notes features" section and the "Allow writes" row come from other work (#342 and a fork-only branch), not from this PR.