apple-notes-mcp 2.9.16 → 2.9.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +80 -2
  2. package/build/index.js +485 -152
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -1355,7 +1355,7 @@ Lists all folders in an account with full hierarchical paths.
1355
1355
  {}
1356
1356
  ```
1357
1357
 
1358
- **Returns:** List of folders with IDs, paths, account names, and shared state, plus `identifier`, `parentIdentifier`, and `accountIdentifier` when Full Disk Access is granted. Nested folders are shown as full paths (e.g., `Work/Clients/Omnia`). Duplicate folder names are disambiguated by their full path. Literal slashes in folder names are escaped as `\/` (e.g., `Spain\/Portugal 2023`).
1358
+ **Returns:** List of folders with IDs, paths, account names, and shared state, plus `identifier`, `parentIdentifier`, and `accountIdentifier` when Full Disk Access is granted. Nested folders are shown as full paths (e.g., `Work/Clients/Omnia`). Duplicate folder names are disambiguated by their full path. Literal slashes in folder names are escaped as `\/` (e.g., `Spain\/Portugal 2023`). Smart folders are listed too, because Notes' AppleScript lists them like ordinary folders; with Full Disk Access they carry `smartFolder: true` (and `(smart folder)` in the text list). A smart folder cannot hold notes or folders.
1359
1359
 
1360
1360
  ---
1361
1361
 
@@ -2016,7 +2016,8 @@ Each take gets a deadline of 1.5 times its length plus a minute (at most 30 minu
2016
2016
  Adds one nonempty local file of at most 64 MiB to an exact note using `id`, the
2017
2017
  latest `expectedContentHash`, and an absolute `path`. The server never retries
2018
2018
  the insertion. It verifies that existing rich content survived and compares the
2019
- fetched attachment bytes with the source before reporting success.
2019
+ size and streamed SHA-256 of Notes' saved copy with the source before reporting
2020
+ success, with no read cap below the 64 MiB write limit.
2020
2021
 
2021
2022
  | Parameter | Type | Required | Description |
2022
2023
  |-----------|------|----------|-------------|
@@ -2072,6 +2073,72 @@ calling this tool again, which would create a second note.
2072
2073
 
2073
2074
  ---
2074
2075
 
2076
+ #### `add-attachment-from-pasteboard`
2077
+
2078
+ Attaches whatever image, PDF, or file is on the pasteboard (a screenshot, "Copy
2079
+ Image", or a file copied in Finder) to an exact note. The pasteboard is read once
2080
+ through AppKit's public `NSPasteboard` API (via JXA, no native build) and its
2081
+ bytes are frozen into a private temporary file before anything touches the note.
2082
+ The pasteboard itself is never written. The note and `expectedContentHash` are
2083
+ checked before the pasteboard is read, so a request with a wrong id, a stale
2084
+ revision, or a malformed `filename` never captures your clipboard. The frozen
2085
+ file then goes through [`add-attachment`](#add-attachment)'s checks.
2086
+
2087
+ | Parameter | Type | Required | Description |
2088
+ |-----------|------|----------|-------------|
2089
+ | `id` | string | Yes | Note ID |
2090
+ | `expectedContentHash` | string | Yes | The note's current `contentHash` (from `get-note-content`) |
2091
+ | `filename` | string | No | Attachment name. Defaults to the copied file's name, or `Pasted image.png` / `Pasted document.pdf` for image or PDF data. Without an extension, the pasted type's extension is added; with one, it must match the pasted type. Otherwise the same rules as `add-attachment` |
2092
+ | `allowPasteAlert` | boolean | No | Default `false`. Read the pasteboard even when macOS will show its paste alert (see **Paste privacy** below). Never overrides a Deny setting |
2093
+
2094
+ **Returns:** the `add-attachment` result plus `source` (`kind`: `file` or
2095
+ `data`, the pasteboard `type`, and the default `filename`). A copied file wins
2096
+ over image data; among data types PNG is preferred, then JPEG, HEIC, GIF, TIFF,
2097
+ and PDF.
2098
+
2099
+ **Paste privacy (macOS 15.4 and later):** macOS can show an alert asking
2100
+ whether to allow a paste when a process reads the general pasteboard without a
2101
+ user paste. Before reading anything, the tool checks AppKit's
2102
+ [`NSPasteboard.accessBehavior`](https://developer.apple.com/documentation/appkit/nspasteboard/accessbehavior-swift.enum).
2103
+ It reads only when the value is `alwaysAllow`, or when you pass
2104
+ `allowPasteAlert: true` and the value is `default` or `ask` (macOS then shows
2105
+ its alert, and the call waits for your answer up to the automation timeout).
2106
+ Otherwise it reads nothing and returns `code: "permission_denied"` with
2107
+ `pasteboardCode: "pasteboard_access_denied"` and `accessBehavior` (`default`,
2108
+ `ask`, `alwaysDeny`, or `unknown`). `alwaysDeny` is always refused; change it in
2109
+ System Settings, where macOS lists an app after its first paste alert. On macOS
2110
+ before 15.4 the property does not exist and the pasteboard is read as before.
2111
+
2112
+ **Errors** carry a `pasteboardCode` next to the shared `code`, and
2113
+ `committed: false` because nothing was written:
2114
+
2115
+ | `pasteboardCode` | `code` | Cause |
2116
+ |------------------|--------|-------|
2117
+ | `pasteboard_access_denied` | `permission_denied` | Reading would show the macOS paste alert, or pasting is denied (see above) |
2118
+ | `pasteboard_empty` | `validation_error` | Nothing is on the pasteboard |
2119
+ | `unsupported_content` | `validation_error` | No PNG, JPEG, HEIC, GIF, TIFF, PDF, or copied file (text belongs in `append-to-note`); the message and `types` list the pasteboard types found |
2120
+ | `multiple_files` | `validation_error` | More than one copied file; `count` says how many. Copy one file, or use `add-attachment` per file |
2121
+ | `too_large` | `validation_error` | More than 64 MiB |
2122
+ | `file_unreadable` | `validation_error` | The copied file is a symlink, empty, over 64 MiB, or unreadable |
2123
+ | `pasteboard_changed` | `operation_failed` | The pasteboard changed while it was being read; try again |
2124
+ | `pasteboard_timeout` | `operation_failed` | The read timed out (for example an unanswered paste alert) |
2125
+ | `pasteboard_unavailable` | `operation_failed` | The MCP host is not running in your logged-in GUI session (for example over SSH) |
2126
+ | `write_failed` | `operation_failed` | The temporary copy could not be written |
2127
+
2128
+ The pasteboard read uses the same timeout as other automation steps
2129
+ (`APPLE_NOTES_MCP_TIMEOUT_MS`, 30 seconds by default).
2130
+
2131
+ **Known limitation ([#236](https://github.com/sweetrb/apple-notes-mcp/issues/236)):** on macOS 27, Notes' AppleScript dictionary does not list
2132
+ PDF attachments, so a PDF (pasted or from `add-attachment`) is inserted but
2133
+ cannot be verified and the call reports "insertion outcome uncertain". Read the
2134
+ note before retrying.
2135
+
2136
+ For testing, `APPLE_NOTES_MCP_PASTEBOARD_NAME` makes the tool read a private
2137
+ named pasteboard instead of the general one, so a test never touches your
2138
+ clipboard.
2139
+
2140
+ ---
2141
+
2075
2142
  #### `list-attachments`
2076
2143
 
2077
2144
  Lists attachments in a note.
@@ -2287,6 +2354,17 @@ distinctive existing `scopeText` so the Shortcut and server can independently
2287
2354
  resolve the same note. Creating a note from Markdown is
2288
2355
  [`create-note`](#create-note) with `format: "markdown"`.
2289
2356
 
2357
+ When the Shortcut refuses a request (its Find Notes step did not return
2358
+ exactly one note with that exact title and `scopeText`) or stops with its own
2359
+ action error, and the note reads back unchanged, the tool reports the
2360
+ Shortcut's reason with `code: "operation_failed"`, `committed: false` and
2361
+ `indeterminate: false`: nothing was written, so a retry is safe once the cause
2362
+ is fixed. Notes search can lag behind a note created or edited moments ago, so
2363
+ a refusal on a brand-new note may clear after a minute. A timeout, or a failed
2364
+ readback on a note that did change, is still reported as indeterminate.
2365
+ If the Shortcut is not installed, the error is `code: "shortcut_not_installed"`
2366
+ with `committed: false`.
2367
+
2290
2368
  #### `get-capabilities`
2291
2369
 
2292
2370
  Reports which background operations are implemented, live-verified, installed,