apple-notes-mcp 2.8.37 → 2.8.39

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 +54 -3
  2. package/build/index.js +925 -343
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -819,6 +819,12 @@ check of the note's original folder run in one AppleScript: if Notes.app accepts
819
819
  the delete but the note is still listed in that folder, the call reports that
820
820
  nothing was deleted instead of claiming success.
821
821
 
822
+ A note that is already in Recently Deleted is refused, because deleting it there
823
+ removes it permanently. The folder is read live from Notes.app in the same
824
+ AppleScript; the Recently Deleted folder is recognised by its database id (with
825
+ Full Disk Access) or by its English name. To remove such a note for good, do it
826
+ in Notes.app.
827
+
822
828
  **⚠️ Safety:** Irreversible from the agent's side — requires explicit user confirmation before calling. Prefer `search-notes` / `list-notes` first to confirm the exact id(s) being deleted.
823
829
 
824
830
  ---
@@ -1005,6 +1011,7 @@ Lists all notes, optionally filtered by folder, date, and limit.
1005
1011
  | `folder` | string | No | Filter to notes in this folder only (supports nested paths like `"Work/Clients"`) |
1006
1012
  | `modifiedSince` | string | No | ISO 8601 date string to filter notes modified on or after this date (e.g., `"2025-01-01"`) |
1007
1013
  | `limit` | number | No | Maximum number of notes to return |
1014
+ | `includeRecentlyDeleted` | boolean | No | Also list notes in Recently Deleted, each flagged `inRecentlyDeleted: true` (default `false`) |
1008
1015
 
1009
1016
  **Example - All notes:**
1010
1017
  ```json
@@ -1026,7 +1033,7 @@ Lists all notes, optionally filtered by folder, date, and limit.
1026
1033
  }
1027
1034
  ```
1028
1035
 
1029
- **Returns:** List of notes as `{title, id}` pairs — `notes: Array<{title, id}>`, plus `count`. The human-readable line is ` - <title> [id: <id>]`. With Full Disk Access each entry also carries `identifier`, `folderIdentifier`, and `accountIdentifier` (see [Identifier forms](#identifier-forms)).
1036
+ **Returns:** List of notes as `{title, id}` pairs — `notes: Array<{title, id}>`, plus `count`. The human-readable line is ` - <title> [id: <id>]`. Notes in Recently Deleted are left out by default and counted in `excludedRecentlyDeleted` (present only when nonzero); with `includeRecentlyDeleted: true` they are listed with `inRecentlyDeleted: true` and a `[RECENTLY DELETED]` marker. Notes.app's own listing includes them, so the Recently Deleted folder is recognised by its database id (with Full Disk Access) or by its English name. With Full Disk Access each entry also carries `identifier`, `folderIdentifier`, and `accountIdentifier` (see [Identifier forms](#identifier-forms)).
1030
1037
 
1031
1038
  Use the returned `id` for any follow-up read/update/move/delete rather than re-resolving the title: titles are not unique, and a by-title lookup resolves a duplicated title to the same one note every time, silently skipping the others.
1032
1039
 
@@ -1234,7 +1241,7 @@ Deletes multiple notes at once by ID.
1234
1241
  |-----------|------|----------|-------------|
1235
1242
  | `notes` | object[] | Yes | Array of `{id, expectedContentHash}` snapshots to delete (max 500 per request) |
1236
1243
 
1237
- **Returns:** Summary of successes and failures.
1244
+ **Returns:** Summary of successes and failures. A note already in Recently Deleted fails without being deleted, as in `delete-note`.
1238
1245
 
1239
1246
  **⚠️ Safety:** Irreversible — requires explicit user confirmation before calling. Prefer `search-notes` / `list-notes` first to confirm the exact ids being deleted.
1240
1247
 
@@ -1360,6 +1367,50 @@ deleted if a later step fails.
1360
1367
 
1361
1368
  ---
1362
1369
 
1370
+ #### `export-notes-html`
1371
+
1372
+ Exports one note, or the notes of one folder, as one standalone HTML file
1373
+ rendered from the decoded note body. It uses the same block model and
1374
+ attachment handling as [`export-notes-markdown`](#export-notes-markdown).
1375
+ Headings become `h1`-`h3`, lists nest by indent as `ul`/`ol`, checklists show
1376
+ disabled checkboxes, block quotes and monospaced paragraphs become
1377
+ `blockquote` and `pre`, and inline runs keep bold, italic, underline,
1378
+ strikethrough, highlight, superscript, subscript, text color and safe links.
1379
+ Tables are semantic `<table>` elements with a header row. Images, drawings
1380
+ (Notes' fallback image, or its preview), scans (PDF with preview), audio,
1381
+ video, files and link cards (title, domain and preview thumbnail) appear in
1382
+ body order. Attachments with no body marker are appended in creation order.
1383
+ An attachment with no usable source renders a visible
1384
+ `[Image unavailable: name]` marker. The document contains no script, no
1385
+ `file:` URL and no Notes library path.
1386
+
1387
+ A folder export is one presentation document with notes separated by
1388
+ `<hr class="note-separator">`. It is not a backup or restore format.
1389
+
1390
+ **Requires:** Full Disk Access. Password-protected notes are skipped in a
1391
+ folder export and refused for a single note.
1392
+
1393
+ | Parameter | Type | Required | Description |
1394
+ |-----------|------|----------|-------------|
1395
+ | `id` | string | One of `id`/`folder` | Exact note ID |
1396
+ | `folder` | string | One of `id`/`folder` | Folder path, as for `list-notes` |
1397
+ | `account` | string | No | Account holding `folder` |
1398
+ | `limit` | number | No | Maximum notes read from the folder (default 100, max 1000) |
1399
+ | `outputPath` | string | Yes | Absolute HTML file to create. Create-only: an existing file is refused with `[output_exists]` |
1400
+ | `embedAssets` | boolean | No | Embed assets as data URLs (default `true`). Each asset is capped at 10 MiB and a document at 256 MiB of embedded assets; a larger one renders as unavailable with a hint to use `embedAssets: false` |
1401
+ | `assetsDir` | string | No | With `embedAssets: false`, the sidecar directory (default `<output stem>.assets` beside the file). Existing files are never replaced; a taken name gets `-2`, `-3`, ... |
1402
+
1403
+ The HTML is always written to a file, because an embedded document is too
1404
+ large for an MCP message. Paths follow the `save-attachment` rules and may not
1405
+ point inside the Notes library container. Sidecar URLs are relative to the
1406
+ HTML file, so the file and its `.assets` directory can be moved together.
1407
+
1408
+ **Returns:** `format`, `count`, `bytes`, `output`, either `embedded` (assets
1409
+ embedded) or `assets` (`dir`, `files`), `stats`, and `skipped`. Nothing
1410
+ already written is deleted if a later step fails.
1411
+
1412
+ ---
1413
+
1363
1414
  #### `get-checklist-state`
1364
1415
 
1365
1416
  Reads checklist done/undone state for a note. This bypasses the AppleScript limitation where `body of note` strips checklist state, by reading directly from the NoteStore SQLite database.
@@ -1978,7 +2029,7 @@ MCP stores no secrets, but as a general rule keep only non-secret config here.
1978
2029
 
1979
2030
  ## Full Disk Access
1980
2031
 
1981
- Several tools read directly from the Apple Notes SQLite database, which lives in a macOS-protected directory. Those tools require **Full Disk Access** for the process running the MCP server: `get-checklist-state`, `get-note-metadata`, `get-note-blocks`, `export-notes-markdown`, `get-audio-transcripts`, `list-special-notes`, `list-native-tags`, `get-note-link`, the checklist annotations in `get-note-markdown`, `list-attachments` with `includePaths` or `firstImage`, `export-attachments`, `list-paper-attachments`, `export-paper-image`, and the database half of `get-sync-status`.
2032
+ Several tools read directly from the Apple Notes SQLite database, which lives in a macOS-protected directory. Those tools require **Full Disk Access** for the process running the MCP server: `get-checklist-state`, `get-note-metadata`, `get-note-blocks`, `export-notes-markdown`, `export-notes-html`, `get-audio-transcripts`, `list-special-notes`, `list-native-tags`, `get-note-link`, the checklist annotations in `get-note-markdown`, `list-attachments` with `includePaths` or `firstImage`, `export-attachments`, `list-paper-attachments`, `export-paper-image`, and the database half of `get-sync-status`.
1982
2033
 
1983
2034
  > 📘 **For the full why-and-how walkthrough (which app to grant, verifying with `doctor`, graceful degradation), see the [Full Disk Access Setup Guide](https://github.com/sweetrb/apple-notes-mcp/blob/main/docs/FULL-DISK-ACCESS.md).** The summary below is the quick version.
1984
2035