apple-notes-mcp 2.8.35 → 2.8.37

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 +93 -8
  2. package/build/index.js +2012 -420
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -56,7 +56,7 @@ Install as a Claude Code plugin for automatic configuration and enhanced AI beha
56
56
 
57
57
  This method also installs a **skill** that teaches Claude when and how to use Apple Notes effectively.
58
58
 
59
- On the first tool call, macOS shows an Automation permission prompt ("Claude" wants access to control "Notes") — click **OK**. Optionally, grant **Full Disk Access** to the app that launches the server to enable the database-backed tools (`get-checklist-state`, `get-note-metadata`, `get-audio-transcripts`, `get-note-link`, checklist annotations in `get-note-markdown`, and full `get-sync-status` detail); see the [Full Disk Access Setup Guide](https://github.com/sweetrb/apple-notes-mcp/blob/main/docs/FULL-DISK-ACCESS.md). The rest of the server is pure AppleScript and works without it.
59
+ On the first tool call, macOS shows an Automation permission prompt ("Claude" wants access to control "Notes") — click **OK**. Optionally, grant **Full Disk Access** to the app that launches the server to enable the database-backed tools (`get-checklist-state`, `get-note-metadata`, `get-audio-transcripts`, `list-special-notes`, `list-native-tags`, `get-note-link`, checklist annotations in `get-note-markdown`, and full `get-sync-status` detail); see the [Full Disk Access Setup Guide](https://github.com/sweetrb/apple-notes-mcp/blob/main/docs/FULL-DISK-ACCESS.md). The rest of the server is pure AppleScript and works without it.
60
60
 
61
61
  Native tag, checklist, table, pin, and rich append operations use two packaged
62
62
  Apple Shortcuts. A third, `Apple Notes MCP - Create Markdown Note`, is optional:
@@ -631,11 +631,25 @@ stable code in brackets, such as `[encrypted]` or `[no-full-disk-access]`.
631
631
 
632
632
  #### `list-native-tags`
633
633
 
634
- Lists actual native Notes tags used within one explicit `account` and `folder`,
635
- mapping each tag to its matching note IDs. This differs from textual hashtag
636
- search. The response reports `complete: false` and per-note errors when some
637
- native metadata is unavailable. This tool is read-only and requires Full Disk
638
- Access.
634
+ Lists actual native Notes tags. This differs from textual hashtag search. It is
635
+ read-only and requires Full Disk Access.
636
+
637
+ - **Folder mode** (pass `folder`, optionally `account`): maps each tag used in that
638
+ folder to its matching note IDs. The response reports `complete: false` and per-note
639
+ errors when some native metadata is unavailable.
640
+ - **Inventory mode** (omit `folder`): an account-wide inventory with counts, read-only from the
641
+ database. `account` narrows it to one account; omit it to count every
642
+ account. Each `inventory` entry has `tag`, `noteCount` (distinct notes, Recently
643
+ Deleted excluded), per-account counts in `accounts`, and any other `spellings` Notes
644
+ treats as the same tag. Tags with no remaining notes are listed with `noteCount: 0`.
645
+ A tag counts for a note only while the note body still references it. Locked or
646
+ unreadable bodies are counted from the tag objects alone and reported through
647
+ `unverifiedNotes` and `complete: false`.
648
+
649
+ | Parameter | Type | Required | Description |
650
+ |-----------|------|----------|-------------|
651
+ | `folder` | string | No | Folder to list (nested paths supported). Omit for the inventory |
652
+ | `account` | string | No | Account name, exact or unique prefix |
639
653
 
640
654
  ---
641
655
 
@@ -1297,6 +1311,55 @@ Gets a note's content as Markdown instead of HTML. If the note contains checklis
1297
1311
 
1298
1312
  ---
1299
1313
 
1314
+ #### `export-notes-markdown`
1315
+
1316
+ Exports one note, or the notes of one folder, as a single Markdown document
1317
+ rendered from the decoded note body (the same block model as
1318
+ [`get-note-blocks`](#get-note-blocks)). Titles render as `#`, headings as `##`,
1319
+ subheadings as `###`. Bulleted, dashed and numbered lists keep their indent
1320
+ (four spaces per level), checklists render as `- [x]`/`- [ ]`, block quotes as
1321
+ `>`, and monospaced paragraphs as fenced code. Inline runs keep bold, italic,
1322
+ strikethrough, underline (`<u>`), highlight (`==`), superscript and subscript
1323
+ (`<sup>`/`<sub>`), and links whose scheme is http(s), `notes:`, `applenotes:`
1324
+ or `mailto:`. Tables render as GitHub tables. Attachments stay in body order:
1325
+ with `assetsDir` they link to copies of their files (images inline, drawings
1326
+ through Notes' fallback image, scans as their PDF), and without it they render
1327
+ as labeled placeholders such as `\[Image: name\]`. An attachment whose file
1328
+ cannot be found renders as `\[Image unavailable: name\]`. This tool leaves
1329
+ `get-note-markdown` unchanged.
1330
+
1331
+ A folder export is one presentation document with notes separated by `---`.
1332
+ It is not a backup or restore format; use `export-notes-json` for that.
1333
+
1334
+ **Requires:** Full Disk Access. Password-protected notes are skipped in a
1335
+ folder export (listed in `skipped` with code `encrypted`) and refused for a
1336
+ single note.
1337
+
1338
+ | Parameter | Type | Required | Description |
1339
+ |-----------|------|----------|-------------|
1340
+ | `id` | string | One of `id`/`folder` | Exact note ID |
1341
+ | `folder` | string | One of `id`/`folder` | Folder path, as for `list-notes` |
1342
+ | `account` | string | No | Account holding `folder` |
1343
+ | `limit` | number | No | Maximum notes read from the folder (default 100, max 1000) |
1344
+ | `outputPath` | string | No | Absolute file to create. Create-only: an existing file (or symlink) is refused with `[output_exists]` |
1345
+ | `assetsDir` | string | No | Absolute directory for attachment copies. Existing files are never replaced; a taken name gets `-2`, `-3`, ... |
1346
+ | `wrap` | number | No | Hard-wrap prose at this many columns. Code, tables and headings are never wrapped |
1347
+
1348
+ Both paths follow the `save-attachment` rules (absolute, under the home
1349
+ directory, a temp directory, or `/Volumes`, no symlink escapes) and may not
1350
+ point inside the Notes library container. With `outputPath`, asset links are
1351
+ relative to the document's directory; without it they are absolute paths.
1352
+
1353
+ **Returns:** without `outputPath`, the Markdown itself (refused with
1354
+ `[too-large]` above half of `APPLE_NOTES_MCP_EXPORT_MAX_BYTES`, because the
1355
+ document travels in both the text and structured result). With `outputPath`, a
1356
+ receipt: `format`, `count`, `bytes`, `output`, and `assets` (`dir`, `files`).
1357
+ Both carry `stats` (attachments, placed, placeholders, unavailable, tables,
1358
+ unreadableTables, unreferenced) and `skipped`. Nothing already written is
1359
+ deleted if a later step fails.
1360
+
1361
+ ---
1362
+
1300
1363
  #### `get-checklist-state`
1301
1364
 
1302
1365
  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.
@@ -1341,6 +1404,27 @@ Reads note metadata that AppleScript cannot expose, by querying the NoteStore SQ
1341
1404
 
1342
1405
  ---
1343
1406
 
1407
+ #### `list-special-notes`
1408
+
1409
+ Lists a set of notes that AppleScript cannot enumerate: pinned notes, Quick Notes, notes in Recently Deleted, or password-protected notes. It reads the NoteStore database read-only and returns metadata only, never body text.
1410
+
1411
+ **Requires:** Full Disk Access for the MCP host process (see [Full Disk Access Setup](#full-disk-access)).
1412
+
1413
+ | Parameter | Type | Required | Description |
1414
+ |-----------|------|----------|-------------|
1415
+ | `kind` | string | Yes | `pinned`, `quick-notes`, `recently-deleted`, or `locked` |
1416
+ | `account` | string | No | Only this account (exact or unique-prefix name). Omit for every account |
1417
+ | `limit` | number | No | Maximum rows, 1–1000 (default 100) |
1418
+
1419
+ **Returns:** `notes`, newest first, each with `id`, `identifier` (Notes UUID), `title`, `folder` (path in `list-folders` syntax, or `null`), `account`, `created`, `modified`, and the flags `pinned`, `locked`, `quickNote`, `inRecentlyDeleted`, and `markedForDeletion`. Unlocked rows add the stored `snippet`. The `locked` listing adds `passwordHint` when one is set. Also returns `count`, `total` (matches before `limit`), `limit`, and `supported`.
1420
+
1421
+ - `pinned` and `quick-notes` cover notes in folders outside Recently Deleted. Folderless Quick Note drafts, which Notes.app never shows, are left out.
1422
+ - `recently-deleted` lists notes in each account's Recently Deleted folder and skips tombstones already waiting to sync away.
1423
+ - `locked` lists every password-protected note, including trashed and folderless ones, so a misplaced locked note can still be found. Their flags and `folder` say where each one is.
1424
+ - `supported: false` means this macOS version's database has no column for that kind (for example, Quick Notes before macOS 12).
1425
+
1426
+ ---
1427
+
1344
1428
  #### `get-audio-transcripts`
1345
1429
 
1346
1430
  Reads the transcript, and the summary when one exists, that Notes already computed for the audio recordings in a note. It does not transcribe anything itself. Notes keeps each recording's transcript as word-level mergeable data on the audio attachment's database row, and this tool decodes it read-only.
@@ -1864,7 +1948,7 @@ All configuration is optional — the server works out of the box. Override beha
1864
1948
  | `APPLE_NOTES_MCP_MAX_INLINE_IMAGE_BYTES` | `262144` (256 KB) | Per-image cap on the base64 payload kept inline in a [`get-note-content`](#get-note-content) response. Inline images over the cap are replaced with placeholders (with a warning appended) so an image-heavy note cannot exceed the MCP client's message limit and drop the connection; export the real files with [`save-attachment`](#save-attachment) or [`fetch-attachment`](#fetch-attachment). Raise it to keep bigger images inline. |
1865
1949
  | `APPLE_NOTES_MCP_CONFIG_FILE` | `~/Library/Application Support/apple-notes-mcp/config.json` | Path to the JSON config file (see below). |
1866
1950
  | `APPLE_NOTES_MCP_TIMEOUT_MS` | `30000` (30 s) | Total AppleScript operation timeout, including retry attempts and delays. Raise it if full-library operations (large searches, exports) time out on a big Notes library. Per-call `timeoutMs` options still win, and a write tool's `timeoutSeconds` argument overrides it for that call. |
1867
- | `APPLE_NOTES_MCP_EXPORT_MAX_BYTES` | `8388608` (8 MB) | Largest response `export-notes-json` sends; a page closes early to stay under it. The default sits below the 10 MB per-message limit of MCP SDK stdio clients, which drop the connection on anything larger. Raise it only if your MCP client accepts bigger messages. |
1951
+ | `APPLE_NOTES_MCP_EXPORT_MAX_BYTES` | `8388608` (8 MB) | Largest response `export-notes-json` sends; a page closes early to stay under it. `export-notes-markdown` returns inline Markdown up to half of it. The default sits below the 10 MB per-message limit of MCP SDK stdio clients, which drop the connection on anything larger. Raise it only if your MCP client accepts bigger messages. |
1868
1952
  | `APPLE_NOTES_MCP_BLOCKS_MAX_BYTES` | `4194304` (4 MB) | Largest block payload one [`get-note-blocks`](#get-note-blocks) page returns; the page closes early to stay under it, and a single oversized paragraph comes back with `textOmitted: true`. |
1869
1953
  | `APPLE_NOTES_MCP_MAX_RETRIES` | `2` | Maximum attempts for a read-only AppleScript call that fails with a **transient** error (Notes.app busy / not responding / lost connection). `2` means one retry; set `1` to fail fast with no retries. Retries share the single `APPLE_NOTES_MCP_TIMEOUT_MS` budget rather than each getting a fresh one, and a retry is skipped when under a second of that budget remains — so this is a ceiling, not a guarantee. In particular a call that exhausts the budget with a **timeout** has no time left to retry by construction. Mutating operations run once because a timeout can occur after Notes.app applied the change. Non-transient errors (e.g. "note not found") never retry. |
1870
1954
  | `APPLE_NOTES_MCP_RETRY_DELAY_MS` | `1000` (1 s) | Base delay before the first retry; subsequent retries back off exponentially (1s, 2s, 4s, ...). |
@@ -1894,7 +1978,7 @@ MCP stores no secrets, but as a general rule keep only non-secret config here.
1894
1978
 
1895
1979
  ## Full Disk Access
1896
1980
 
1897
- 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`, `get-audio-transcripts`, `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`.
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`.
1898
1982
 
1899
1983
  > 📘 **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.
1900
1984
 
@@ -1915,6 +1999,7 @@ Several tools read directly from the Apple Notes SQLite database, which lives in
1915
1999
  Every tool that does not read the Notes database works normally without Full Disk Access — that is the whole AppleScript surface (create, read, search, update, move, delete, folders, accounts, attachments, stats, export). The database-backed tools degrade like this:
1916
2000
  - `get-checklist-state` returns an error explaining that database access is needed
1917
2001
  - `get-note-metadata` returns the same kind of error — it has no non-database path
2002
+ - `list-special-notes` and the `list-native-tags` inventory return the same kind of error
1918
2003
  - `get-note-link` returns an error on macOS 26+; on macOS 12–15 it still works via the AppleScript `note link` fallback
1919
2004
  - `get-note-markdown` returns plain list items without `[x]`/`[ ]` annotations (graceful fallback)
1920
2005
  - `get-sync-status` still answers, but reports no pending uploads and no active sync — treat that as "unknown", not "idle"