apple-notes-mcp 2.8.36 → 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 +51 -2
  2. package/build/index.js +1349 -240
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -1311,6 +1311,55 @@ Gets a note's content as Markdown instead of HTML. If the note contains checklis
1311
1311
 
1312
1312
  ---
1313
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
+
1314
1363
  #### `get-checklist-state`
1315
1364
 
1316
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.
@@ -1899,7 +1948,7 @@ All configuration is optional — the server works out of the box. Override beha
1899
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. |
1900
1949
  | `APPLE_NOTES_MCP_CONFIG_FILE` | `~/Library/Application Support/apple-notes-mcp/config.json` | Path to the JSON config file (see below). |
1901
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. |
1902
- | `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. |
1903
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`. |
1904
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. |
1905
1954
  | `APPLE_NOTES_MCP_RETRY_DELAY_MS` | `1000` (1 s) | Base delay before the first retry; subsequent retries back off exponentially (1s, 2s, 4s, ...). |
@@ -1929,7 +1978,7 @@ MCP stores no secrets, but as a general rule keep only non-secret config here.
1929
1978
 
1930
1979
  ## Full Disk Access
1931
1980
 
1932
- 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`, `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`.
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`.
1933
1982
 
1934
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.
1935
1984