apple-notes-mcp 2.8.23 → 2.8.24

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 +28 -0
  2. package/build/index.js +284 -12
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -1221,6 +1221,10 @@ Run a full setup diagnostic: Notes.app reachability, the Automation permission,
1221
1221
 
1222
1222
  **Returns:** A per-check report (`structuredContent` carries the raw `{healthy, checks[]}`). The Full Disk Access check tells you whether checklist-state features will work — see [Full Disk Access Setup](https://github.com/sweetrb/apple-notes-mcp/blob/main/docs/FULL-DISK-ACCESS.md).
1223
1223
 
1224
+ The report ends with the same feature matrix as [`get-capabilities`](#get-capabilities)
1225
+ (`structuredContent.runtimeOS` and `structuredContent.features`). It is
1226
+ informational: an unavailable optional feature never changes `healthy`.
1227
+
1224
1228
  ---
1225
1229
 
1226
1230
  #### `get-notes-stats`
@@ -1273,6 +1277,30 @@ resolve the same note. Creating a note from Markdown is
1273
1277
  Reports which background operations are implemented, live-verified, installed,
1274
1278
  and currently available, with a specific reason for each unavailable operation.
1275
1279
 
1280
+ It also reports `runtimeOS` (`platform`, `macOSVersion` from `sw_vers`,
1281
+ `darwinRelease`) and a `features` matrix, one entry per feature group:
1282
+ `applescriptCore`, `fullDiskAccessReads`, `shortcutsBridges`,
1283
+ `backgroundOperationsBridge`, `nativeTagsBridge`, `markdownNoteBridge`, and the
1284
+ placeholders `checklistToggle`, `smartFolders`, `paragraphLinks`, and
1285
+ `audioTranscription`, which need a native helper this server does not ship.
1286
+ Each entry carries `available`, `osSupported`, `minimumMacOSVersion`,
1287
+ `requirements`, `missing`, `unverified`, `tools`, and a machine-readable
1288
+ `reason` that is `null` when available and otherwise the first that applies:
1289
+
1290
+ | `reason` | Meaning |
1291
+ |----------|---------|
1292
+ | `unsupported_platform` | Not running on macOS |
1293
+ | `not_implemented` | The server has no implementation for this feature yet |
1294
+ | `unknown_os_version` | The feature has a macOS floor and `sw_vers` could not be read |
1295
+ | `requires_macos_<major>` | macOS is older than `minimumMacOSVersion`, e.g. `requires_macos_26` |
1296
+ | `full_disk_access_missing` | The Notes database is not readable by this process |
1297
+ | `shortcuts_unavailable` | The `shortcuts` command could not be run |
1298
+ | `shortcut_not_installed` | A bridge Shortcut is missing or installed more than once |
1299
+
1300
+ The probe never opens Notes.app or runs a Shortcut, so the Automation
1301
+ permission for Notes.app appears under `unverified` rather than being guessed;
1302
+ `doctor` and `health-check` confirm it by contacting Notes.
1303
+
1276
1304
  #### `append-native`
1277
1305
 
1278
1306
  Appends bounded plaintext, semantic HTML, or Markdown while preserving existing
package/build/index.js CHANGED
@@ -43598,13 +43598,19 @@ function addNativeTags(request, deps) {
43598
43598
  } : {}
43599
43599
  };
43600
43600
  }
43601
- function nativeTagsStatus(shortcut = process.env.APPLE_NOTES_MCP_TAGS_SHORTCUT || NATIVE_TAGS_SHORTCUT) {
43602
- const lines = execFileSync7("/usr/bin/shortcuts", ["list", "--show-identifiers"], {
43601
+ function listInstalledShortcuts() {
43602
+ return execFileSync7("/usr/bin/shortcuts", ["list", "--show-identifiers"], {
43603
43603
  encoding: "utf8",
43604
43604
  timeout: 15e3,
43605
43605
  maxBuffer: 1024 * 1024,
43606
43606
  stdio: ["ignore", "pipe", "pipe"]
43607
43607
  }).split(/\r?\n/u);
43608
+ }
43609
+ var nativeTagsShortcutName = () => process.env.APPLE_NOTES_MCP_TAGS_SHORTCUT || NATIVE_TAGS_SHORTCUT;
43610
+ function nativeTagsStatus(shortcut = nativeTagsShortcutName()) {
43611
+ return resolveShortcut(listInstalledShortcuts(), shortcut);
43612
+ }
43613
+ function resolveShortcut(lines, shortcut) {
43608
43614
  const matches = lines.flatMap((line) => {
43609
43615
  const match = /^(.*) \(([0-9A-Fa-f-]{36})\)$/.exec(line);
43610
43616
  return match && (match[1] === shortcut || match[2].toLowerCase() === shortcut.toLowerCase()) ? [{ name: match[1], identifier: match[2] }] : [];
@@ -43721,10 +43727,12 @@ function comparableVisibleText(html) {
43721
43727
 
43722
43728
  // src/services/backgroundNotes.ts
43723
43729
  var BACKGROUND_SHORTCUT = "Apple Notes MCP - Background Operations v5";
43724
- var backgroundStatus = () => nativeTagsStatus(process.env.APPLE_NOTES_MCP_BACKGROUND_SHORTCUT || BACKGROUND_SHORTCUT);
43730
+ var backgroundShortcutName = () => process.env.APPLE_NOTES_MCP_BACKGROUND_SHORTCUT || BACKGROUND_SHORTCUT;
43731
+ var backgroundStatus = () => nativeTagsStatus(backgroundShortcutName());
43725
43732
  var nativeTagBridgeStatus = () => nativeTagsStatus();
43726
43733
  var MARKDOWN_NOTE_SHORTCUT = "Apple Notes MCP - Create Markdown Note";
43727
- var markdownNoteStatus = () => nativeTagsStatus(process.env.APPLE_NOTES_MCP_MARKDOWN_SHORTCUT || MARKDOWN_NOTE_SHORTCUT);
43734
+ var markdownShortcutName = () => process.env.APPLE_NOTES_MCP_MARKDOWN_SHORTCUT || MARKDOWN_NOTE_SHORTCUT;
43735
+ var markdownNoteStatus = () => nativeTagsStatus(markdownShortcutName());
43728
43736
  function readBackgroundSnapshot(manager, id2) {
43729
43737
  if (!/^x-coredata:\/\/[0-9a-f-]+\/ICNote\/p\d+$/i.test(id2))
43730
43738
  throw new Error("Exact note ID required");
@@ -44145,8 +44153,261 @@ ${request.content}`
44145
44153
  }
44146
44154
  }
44147
44155
 
44156
+ // src/services/capabilityMatrix.ts
44157
+ import { execFileSync as execFileSync9 } from "node:child_process";
44158
+ import { release } from "node:os";
44159
+ var MACOS_SHORTCUTS_CLI = "12.0";
44160
+ var MACOS_MARKDOWN_IMPORT = "26.0";
44161
+ var FEATURES = [
44162
+ {
44163
+ name: "applescriptCore",
44164
+ description: "Create, read, search, update, move, and delete notes and folders through Notes.app's AppleScript interface",
44165
+ tools: [
44166
+ "create-note",
44167
+ "search-notes",
44168
+ "get-note-content",
44169
+ "update-note",
44170
+ "append-to-note",
44171
+ "insert-link",
44172
+ "delete-note",
44173
+ "move-note",
44174
+ "list-notes",
44175
+ "list-folders",
44176
+ "create-folder",
44177
+ "list-accounts"
44178
+ ],
44179
+ minimumMacOSVersion: null,
44180
+ requirements: [{ kind: "notes_automation" }]
44181
+ },
44182
+ {
44183
+ name: "fullDiskAccessReads",
44184
+ description: "Read-only reads of the Notes database: query-notes, checklist state, note metadata, note links, native objects, native tags, and sync detail",
44185
+ tools: [
44186
+ "query-notes",
44187
+ "get-checklist-state",
44188
+ "get-note-metadata",
44189
+ "get-note-link",
44190
+ "get-native-objects",
44191
+ "list-native-tags",
44192
+ "get-note-markdown (checklist annotations)",
44193
+ "get-sync-status (pending uploads)"
44194
+ ],
44195
+ minimumMacOSVersion: null,
44196
+ requirements: [{ kind: "full_disk_access" }]
44197
+ },
44198
+ {
44199
+ name: "shortcutsBridges",
44200
+ description: "Run the optional native-write Shortcut bridges in the background",
44201
+ tools: [],
44202
+ minimumMacOSVersion: MACOS_SHORTCUTS_CLI,
44203
+ requirements: [{ kind: "shortcuts_cli" }]
44204
+ },
44205
+ {
44206
+ name: "backgroundOperationsBridge",
44207
+ description: "Native background edits through the Background Operations bridge, verified by exact-ID database readback",
44208
+ tools: [
44209
+ "append-native",
44210
+ "create-checklist-item",
44211
+ "create-checklist-items",
44212
+ "create-table",
44213
+ "insert-note-link",
44214
+ "set-note-pinned",
44215
+ "remove-native-tags"
44216
+ ],
44217
+ minimumMacOSVersion: MACOS_SHORTCUTS_CLI,
44218
+ requirements: [
44219
+ { kind: "notes_automation" },
44220
+ { kind: "full_disk_access" },
44221
+ { kind: "shortcuts_cli" },
44222
+ { kind: "shortcut", name: backgroundShortcutName }
44223
+ ]
44224
+ },
44225
+ {
44226
+ name: "nativeTagsBridge",
44227
+ description: "Add real Notes tags through the Native Tags bridge",
44228
+ tools: ["add-native-tags", "replace-native-tag"],
44229
+ minimumMacOSVersion: MACOS_SHORTCUTS_CLI,
44230
+ requirements: [
44231
+ { kind: "notes_automation" },
44232
+ { kind: "full_disk_access" },
44233
+ { kind: "shortcuts_cli" },
44234
+ { kind: "shortcut", name: nativeTagsShortcutName }
44235
+ ]
44236
+ },
44237
+ {
44238
+ name: "markdownNoteBridge",
44239
+ description: "Create a note from Markdown with real Title, Heading, and Subheading styles through the Create Markdown Note bridge",
44240
+ tools: ['create-note (format: "markdown")'],
44241
+ minimumMacOSVersion: MACOS_MARKDOWN_IMPORT,
44242
+ requirements: [
44243
+ { kind: "notes_automation" },
44244
+ { kind: "full_disk_access" },
44245
+ { kind: "shortcuts_cli" },
44246
+ { kind: "shortcut", name: markdownShortcutName }
44247
+ ]
44248
+ },
44249
+ // Placeholders for features that need a native helper this server does not
44250
+ // ship. They always report `not_implemented` so clients can detect them.
44251
+ {
44252
+ name: "checklistToggle",
44253
+ description: "Check or uncheck an existing checklist item in place",
44254
+ tools: [],
44255
+ minimumMacOSVersion: null,
44256
+ requirements: [{ kind: "native_helper" }]
44257
+ },
44258
+ {
44259
+ name: "smartFolders",
44260
+ description: "Create or edit Smart Folders and their tag rules",
44261
+ tools: [],
44262
+ minimumMacOSVersion: null,
44263
+ requirements: [{ kind: "native_helper" }]
44264
+ },
44265
+ {
44266
+ name: "paragraphLinks",
44267
+ description: "Link to a specific paragraph or heading inside a note",
44268
+ tools: [],
44269
+ minimumMacOSVersion: null,
44270
+ requirements: [{ kind: "native_helper" }]
44271
+ },
44272
+ {
44273
+ name: "audioTranscription",
44274
+ description: "Transcribe audio recordings attached to a note",
44275
+ tools: [],
44276
+ minimumMacOSVersion: null,
44277
+ requirements: [{ kind: "native_helper" }]
44278
+ }
44279
+ ];
44280
+ function requirementLabel(requirement) {
44281
+ return requirement.kind === "shortcut" ? `shortcut:${requirement.name()}` : requirement.kind;
44282
+ }
44283
+ function compareVersions(a, b) {
44284
+ const pa = a.split(".").map((part) => Number.parseInt(part, 10) || 0);
44285
+ const pb = b.split(".").map((part) => Number.parseInt(part, 10) || 0);
44286
+ for (let i = 0; i < Math.max(pa.length, pb.length); i++) {
44287
+ const diff = (pa[i] ?? 0) - (pb[i] ?? 0);
44288
+ if (diff !== 0) return diff;
44289
+ }
44290
+ return 0;
44291
+ }
44292
+ function evaluateFeature(feature, env) {
44293
+ const isMac = env.platform === "darwin";
44294
+ const floor = feature.minimumMacOSVersion;
44295
+ const versionKnown = env.macOSVersion !== null;
44296
+ const osSupported = isMac && (floor === null || versionKnown && compareVersions(env.macOSVersion, floor) >= 0);
44297
+ const missing = [];
44298
+ const unverified = [];
44299
+ const failures = /* @__PURE__ */ new Set();
44300
+ for (const requirement of feature.requirements) {
44301
+ const label = requirementLabel(requirement);
44302
+ switch (requirement.kind) {
44303
+ case "notes_automation":
44304
+ unverified.push(label);
44305
+ break;
44306
+ case "full_disk_access":
44307
+ if (!env.fullDiskAccess) {
44308
+ missing.push(label);
44309
+ failures.add("full_disk_access_missing");
44310
+ }
44311
+ break;
44312
+ case "shortcuts_cli":
44313
+ if (env.shortcutLines === null) {
44314
+ missing.push(label);
44315
+ failures.add("shortcuts_unavailable");
44316
+ }
44317
+ break;
44318
+ case "shortcut":
44319
+ if (env.shortcutLines === null) unverified.push(label);
44320
+ else if (!resolveShortcut(env.shortcutLines, requirement.name()).installed) {
44321
+ missing.push(label);
44322
+ failures.add("shortcut_not_installed");
44323
+ }
44324
+ break;
44325
+ case "native_helper":
44326
+ missing.push(label);
44327
+ failures.add("not_implemented");
44328
+ break;
44329
+ }
44330
+ }
44331
+ let reason = null;
44332
+ if (!isMac) reason = "unsupported_platform";
44333
+ else if (failures.has("not_implemented")) reason = "not_implemented";
44334
+ else if (floor !== null && !versionKnown) reason = "unknown_os_version";
44335
+ else if (!osSupported) reason = `requires_macos_${Number.parseInt(floor, 10)}`;
44336
+ else if (failures.has("full_disk_access_missing")) reason = "full_disk_access_missing";
44337
+ else if (failures.has("shortcuts_unavailable")) reason = "shortcuts_unavailable";
44338
+ else if (failures.has("shortcut_not_installed")) reason = "shortcut_not_installed";
44339
+ return {
44340
+ description: feature.description,
44341
+ tools: feature.tools,
44342
+ available: reason === null,
44343
+ osSupported,
44344
+ minimumMacOSVersion: floor,
44345
+ requirements: feature.requirements.map(requirementLabel),
44346
+ missing,
44347
+ unverified,
44348
+ reason
44349
+ };
44350
+ }
44351
+ function evaluateFeatures(env, features = FEATURES) {
44352
+ return {
44353
+ runtimeOS: {
44354
+ platform: env.platform,
44355
+ macOSVersion: env.macOSVersion,
44356
+ darwinRelease: env.darwinRelease
44357
+ },
44358
+ features: Object.fromEntries(features.map((f) => [f.name, evaluateFeature(f, env)]))
44359
+ };
44360
+ }
44361
+ function readMacOSVersion() {
44362
+ if (process.platform !== "darwin") return null;
44363
+ try {
44364
+ const out = execFileSync9("/usr/bin/sw_vers", ["-productVersion"], {
44365
+ encoding: "utf8",
44366
+ timeout: 3e3,
44367
+ stdio: ["ignore", "pipe", "ignore"]
44368
+ }).trim();
44369
+ return /^\d+(\.\d+)*$/.test(out) ? out : null;
44370
+ } catch {
44371
+ return null;
44372
+ }
44373
+ }
44374
+ function probeCapabilityEnvironment() {
44375
+ const platform = process.platform;
44376
+ const isMac = platform === "darwin";
44377
+ let shortcutLines = null;
44378
+ if (isMac) {
44379
+ try {
44380
+ shortcutLines = listInstalledShortcuts();
44381
+ } catch {
44382
+ shortcutLines = null;
44383
+ }
44384
+ }
44385
+ return {
44386
+ platform,
44387
+ macOSVersion: readMacOSVersion(),
44388
+ darwinRelease: release(),
44389
+ fullDiskAccess: isMac && hasFullDiskAccess(),
44390
+ shortcutLines
44391
+ };
44392
+ }
44393
+ function getCapabilityMatrix(probe = probeCapabilityEnvironment) {
44394
+ return evaluateFeatures(probe());
44395
+ }
44396
+ function formatCapabilityMatrix(matrix) {
44397
+ const os5 = matrix.runtimeOS;
44398
+ const lines = [
44399
+ `Feature matrix (macOS ${os5.macOSVersion ?? "unknown"}, Darwin ${os5.darwinRelease}):`
44400
+ ];
44401
+ for (const [name, status] of Object.entries(matrix.features)) {
44402
+ lines.push(
44403
+ status.available ? ` \u2713 ${name}: available${status.unverified.length ? ` (unverified: ${status.unverified.join(", ")})` : ""}` : ` \u2717 ${name}: ${status.reason}${status.missing.length ? ` (missing: ${status.missing.join(", ")})` : ""}`
44404
+ );
44405
+ }
44406
+ return lines.join("\n");
44407
+ }
44408
+
44148
44409
  // src/tools/doctor.ts
44149
- function runDoctor(manager) {
44410
+ function runDoctor(manager, capabilityMatrix = getCapabilityMatrix) {
44150
44411
  const checks = [];
44151
44412
  const hc = manager.healthCheck();
44152
44413
  for (const c of hc.checks) {
@@ -44197,7 +44458,13 @@ function runDoctor(manager) {
44197
44458
  }
44198
44459
  checks.push(checkNodeRuntimeSignature());
44199
44460
  const healthy = !checks.some((c) => c.status === "fail");
44200
- return { healthy, checks };
44461
+ let matrix;
44462
+ try {
44463
+ matrix = capabilityMatrix();
44464
+ } catch {
44465
+ matrix = void 0;
44466
+ }
44467
+ return matrix ? { healthy, checks, runtimeOS: matrix.runtimeOS, features: matrix.features } : { healthy, checks };
44201
44468
  }
44202
44469
  function markdownBridgeDetail() {
44203
44470
  const purpose = 'needed only for create-note format: "markdown" on macOS 26+';
@@ -44241,6 +44508,8 @@ function formatDoctorReport(r) {
44241
44508
  const icon = (s) => s === "ok" ? "\u2705" : s === "warn" ? "\u26A0\uFE0F " : "\u274C";
44242
44509
  const lines = [`\u{1FA7A} apple-notes-mcp doctor \u2014 ${r.healthy ? "healthy" : "ISSUES FOUND"}`, ""];
44243
44510
  for (const c of r.checks) lines.push(`${icon(c.status)} ${c.name}: ${c.detail}`);
44511
+ if (r.runtimeOS && r.features)
44512
+ lines.push("", formatCapabilityMatrix({ runtimeOS: r.runtimeOS, features: r.features }));
44244
44513
  return lines.join("\n");
44245
44514
  }
44246
44515
 
@@ -45103,7 +45372,7 @@ function registerNativeOperations(server2, manager) {
45103
45372
  }
45104
45373
  tool(
45105
45374
  "get-capabilities",
45106
- "Use when: checking native background-edit support before calling a write tool.\nReturns: bridge installation, implementation, verification, availability, and specific limitations per operation.\nDo not use when: checking only the Native Tags bridge (native-tags-status).\nSafety: read-only; does not open Notes or run a mutation.",
45375
+ "Use when: checking native background-edit support or which feature groups this Mac supports before calling a tool.\nReturns: bridge installation, implementation, verification, availability, and specific limitations per operation; plus runtimeOS and an OS-version-aware features matrix (available, osSupported, minimumMacOSVersion, requirements, missing, unverified, machine reason code) per feature group.\nDo not use when: checking only the Native Tags bridge (native-tags-status).\nSafety: read-only; does not open Notes or run a mutation.",
45107
45376
  {},
45108
45377
  () => {
45109
45378
  let bridge;
@@ -45153,7 +45422,8 @@ function registerNativeOperations(server2, manager) {
45153
45422
  }
45154
45423
  ])
45155
45424
  ),
45156
- unavailable: UNAVAILABLE
45425
+ unavailable: UNAVAILABLE,
45426
+ ...getCapabilityMatrix()
45157
45427
  };
45158
45428
  },
45159
45429
  true
@@ -45380,7 +45650,7 @@ function registerNativeOperations(server2, manager) {
45380
45650
  // src/setupShortcuts.ts
45381
45651
  import { spawnSync as spawnSync2 } from "node:child_process";
45382
45652
  import { existsSync as existsSync8 } from "node:fs";
45383
- import { release } from "node:os";
45653
+ import { release as release2 } from "node:os";
45384
45654
  import { dirname as dirname2, resolve as resolve2 } from "node:path";
45385
45655
  import { fileURLToPath } from "node:url";
45386
45656
  var OPTIONAL_BRIDGE_NOTE = "(optional \u2014 needed only for create-note format: markdown, macOS 26+)";
@@ -45405,7 +45675,7 @@ function setupShortcuts(checkOnly, dependencies = {}) {
45405
45675
  return result.status === 0 ? { ok: true } : { ok: false, error: result.stderr || result.error?.message || "open failed" };
45406
45676
  });
45407
45677
  const baseDirectory = dependencies.baseDirectory || resolve2(dirname2(fileURLToPath(import.meta.url)), "../shortcuts");
45408
- const osRelease = (dependencies.osRelease || release)();
45678
+ const osRelease = (dependencies.osRelease || release2)();
45409
45679
  const darwinMajor = Number.parseInt(osRelease.split(".")[0], 10);
45410
45680
  const items = shortcutFiles.map(({ name, file, optional: optional2 }) => {
45411
45681
  const path5 = resolve2(baseDirectory, file);
@@ -46939,11 +47209,13 @@ ${fdaLine}`, {
46939
47209
  registerTool(
46940
47210
  "doctor",
46941
47211
  {
46942
- description: "Use when: diagnosing setup problems (Notes.app automation permission, account state, Full Disk Access) with actionable guidance.\nReturns: a detailed report plus structured fields.\nDo not use when: you just need a quick pass/fail (health-check).\nRead-only.",
47212
+ description: "Use when: diagnosing setup problems (Notes.app automation permission, account state, Full Disk Access) with actionable guidance.\nReturns: a detailed report plus structured fields, including runtimeOS and the same OS-version-aware features matrix as get-capabilities.\nDo not use when: you just need a quick pass/fail (health-check).\nRead-only.",
46943
47213
  inputSchema: {},
46944
47214
  outputSchema: {
46945
47215
  healthy: external_exports.boolean().optional(),
46946
- checks: external_exports.array(external_exports.object({}).passthrough()).optional()
47216
+ checks: external_exports.array(external_exports.object({}).passthrough()).optional(),
47217
+ runtimeOS: external_exports.object({}).passthrough().optional(),
47218
+ features: external_exports.record(external_exports.string(), external_exports.object({}).passthrough()).optional()
46947
47219
  }
46948
47220
  },
46949
47221
  withErrorHandling(() => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "apple-notes-mcp",
3
- "version": "2.8.23",
3
+ "version": "2.8.24",
4
4
  "description": "MCP server for Apple Notes - create, search, update, and manage notes via Claude and other AI assistants",
5
5
  "type": "module",
6
6
  "main": "build/index.js",