apple-notes-mcp 2.6.8 → 2.6.10
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.
- package/README.md +1 -1
- package/build/index.js +41 -11
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -211,7 +211,7 @@ Searches for notes by title or content.
|
|
|
211
211
|
| `account` | string | No | Account to search in (defaults to iCloud) |
|
|
212
212
|
| `folder` | string | No | Limit search to a specific folder (supports nested paths like `"Work/Clients"`) |
|
|
213
213
|
| `modifiedSince` | string | No | ISO 8601 date string to filter notes modified on or after this date (e.g., `"2025-01-01"`) |
|
|
214
|
-
| `limit` | number | No | Maximum number of results to return |
|
|
214
|
+
| `limit` | number | No | Maximum number of results to return. **Defaults to 50** — a broad query reads several properties per match via AppleScript (~200ms/note), so an unbounded search over hundreds of matches can exceed Notes' 30s timeout and return an error instead of results. Pass a higher value to see more; the applied limit (and whether it truncated the results) is disclosed in the response. |
|
|
215
215
|
|
|
216
216
|
**Example - Search titles:**
|
|
217
217
|
```json
|
package/build/index.js
CHANGED
|
@@ -3110,9 +3110,9 @@ var require_data = __commonJS({
|
|
|
3110
3110
|
}
|
|
3111
3111
|
});
|
|
3112
3112
|
|
|
3113
|
-
// node_modules/.pnpm/fast-uri@3.1.
|
|
3113
|
+
// node_modules/.pnpm/fast-uri@3.1.4/node_modules/fast-uri/lib/utils.js
|
|
3114
3114
|
var require_utils = __commonJS({
|
|
3115
|
-
"node_modules/.pnpm/fast-uri@3.1.
|
|
3115
|
+
"node_modules/.pnpm/fast-uri@3.1.4/node_modules/fast-uri/lib/utils.js"(exports, module) {
|
|
3116
3116
|
"use strict";
|
|
3117
3117
|
var isUUID = RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu);
|
|
3118
3118
|
var isIPv4 = RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);
|
|
@@ -3423,9 +3423,9 @@ var require_utils = __commonJS({
|
|
|
3423
3423
|
}
|
|
3424
3424
|
});
|
|
3425
3425
|
|
|
3426
|
-
// node_modules/.pnpm/fast-uri@3.1.
|
|
3426
|
+
// node_modules/.pnpm/fast-uri@3.1.4/node_modules/fast-uri/lib/schemes.js
|
|
3427
3427
|
var require_schemes = __commonJS({
|
|
3428
|
-
"node_modules/.pnpm/fast-uri@3.1.
|
|
3428
|
+
"node_modules/.pnpm/fast-uri@3.1.4/node_modules/fast-uri/lib/schemes.js"(exports, module) {
|
|
3429
3429
|
"use strict";
|
|
3430
3430
|
var { isUUID } = require_utils();
|
|
3431
3431
|
var URN_REG = /([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu;
|
|
@@ -3633,9 +3633,9 @@ var require_schemes = __commonJS({
|
|
|
3633
3633
|
}
|
|
3634
3634
|
});
|
|
3635
3635
|
|
|
3636
|
-
// node_modules/.pnpm/fast-uri@3.1.
|
|
3636
|
+
// node_modules/.pnpm/fast-uri@3.1.4/node_modules/fast-uri/index.js
|
|
3637
3637
|
var require_fast_uri = __commonJS({
|
|
3638
|
-
"node_modules/.pnpm/fast-uri@3.1.
|
|
3638
|
+
"node_modules/.pnpm/fast-uri@3.1.4/node_modules/fast-uri/index.js"(exports, module) {
|
|
3639
3639
|
"use strict";
|
|
3640
3640
|
var { normalizeIPv6, removeDotSegments, recomposeAuthority, normalizePercentEncoding, normalizePathEncoding, escapePreservingEscapes, reescapeHostDelimiters, isIPv4, nonSimpleDomain } = require_utils();
|
|
3641
3641
|
var { SCHEMES, getSchemeHandler } = require_schemes();
|
|
@@ -3776,6 +3776,7 @@ var require_fast_uri = __commonJS({
|
|
|
3776
3776
|
return uriTokens.join("");
|
|
3777
3777
|
}
|
|
3778
3778
|
var URI_PARSE = /^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;
|
|
3779
|
+
var AUTHORITY_PREFIX = /^(?:[^#/:?]+:)?\/\/([^/?#]*)/;
|
|
3779
3780
|
function getParseError(parsed, matches) {
|
|
3780
3781
|
if (matches[2] !== void 0 && parsed.path && parsed.path[0] !== "/") {
|
|
3781
3782
|
return 'URI path must start with "/" when authority is present.';
|
|
@@ -3805,6 +3806,11 @@ var require_fast_uri = __commonJS({
|
|
|
3805
3806
|
uri = "//" + uri;
|
|
3806
3807
|
}
|
|
3807
3808
|
}
|
|
3809
|
+
const authorityMatch = uri.match(AUTHORITY_PREFIX);
|
|
3810
|
+
if (authorityMatch !== null && authorityMatch[1].indexOf("\\") !== -1) {
|
|
3811
|
+
parsed.error = "URI authority must not contain a literal backslash.";
|
|
3812
|
+
malformedAuthorityOrPort = true;
|
|
3813
|
+
}
|
|
3808
3814
|
const matches = uri.match(URI_PARSE);
|
|
3809
3815
|
if (matches) {
|
|
3810
3816
|
parsed.scheme = matches[1];
|
|
@@ -3848,7 +3854,7 @@ var require_fast_uri = __commonJS({
|
|
|
3848
3854
|
if (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport)) {
|
|
3849
3855
|
if (parsed.host && (options.domainHost || schemeHandler && schemeHandler.domainHost) && isIP === false && nonSimpleDomain(parsed.host)) {
|
|
3850
3856
|
try {
|
|
3851
|
-
parsed.host = URL
|
|
3857
|
+
parsed.host = new URL("http://" + parsed.host).hostname;
|
|
3852
3858
|
} catch (e) {
|
|
3853
3859
|
parsed.error = parsed.error || "Host's domain name can not be converted to ASCII: " + e;
|
|
3854
3860
|
}
|
|
@@ -41849,6 +41855,22 @@ function resolveUpdateResponseTitle(currentTitle, newTitle, format, newContent)
|
|
|
41849
41855
|
return newTitle || currentTitle;
|
|
41850
41856
|
}
|
|
41851
41857
|
|
|
41858
|
+
// src/utils/searchLimit.ts
|
|
41859
|
+
var DEFAULT_SEARCH_LIMIT = 50;
|
|
41860
|
+
function resolveSearchLimit(limit) {
|
|
41861
|
+
if (limit !== void 0 && Number.isFinite(limit) && limit > 0) {
|
|
41862
|
+
return Math.floor(limit);
|
|
41863
|
+
}
|
|
41864
|
+
return DEFAULT_SEARCH_LIMIT;
|
|
41865
|
+
}
|
|
41866
|
+
function describeSearchLimit(effectiveLimit, wasDefault, resultCount) {
|
|
41867
|
+
const info = ` (limit: ${effectiveLimit}${wasDefault ? ", default" : ""})`;
|
|
41868
|
+
const truncationNote = resultCount >= effectiveLimit ? `
|
|
41869
|
+
|
|
41870
|
+
\u2139\uFE0F Showing the first ${effectiveLimit}${wasDefault ? " (default limit)" : ""}; there may be more. Narrow the query, filter with \`folder\`/\`modifiedSince\`, or pass a higher \`limit\` to see additional matches.` : "";
|
|
41871
|
+
return { info, truncationNote };
|
|
41872
|
+
}
|
|
41873
|
+
|
|
41852
41874
|
// src/tools/doctor.ts
|
|
41853
41875
|
import { spawnSync } from "child_process";
|
|
41854
41876
|
function runDoctor(manager) {
|
|
@@ -42130,7 +42152,9 @@ server.registerTool(
|
|
|
42130
42152
|
modifiedSince: external_exports.string().max(64).optional().describe(
|
|
42131
42153
|
"ISO 8601 date string to filter notes modified on or after this date (e.g., '2025-01-01'). Useful for searching only recent notes in large collections."
|
|
42132
42154
|
),
|
|
42133
|
-
limit: external_exports.number().int().positive().optional().describe(
|
|
42155
|
+
limit: external_exports.number().int().positive().optional().describe(
|
|
42156
|
+
"Maximum number of results to return. Defaults to 50 \u2014 a broad query reads several properties per match via AppleScript, so an unbounded search can time out. Pass a higher value to see more; the applied limit is disclosed in the response."
|
|
42157
|
+
)
|
|
42134
42158
|
},
|
|
42135
42159
|
outputSchema: {
|
|
42136
42160
|
notes: external_exports.array(external_exports.object({}).passthrough()).optional(),
|
|
@@ -42138,18 +42162,24 @@ server.registerTool(
|
|
|
42138
42162
|
}
|
|
42139
42163
|
},
|
|
42140
42164
|
withErrorHandling(({ query, searchContent = false, account, folder, modifiedSince, limit }) => {
|
|
42165
|
+
const effectiveLimit = resolveSearchLimit(limit);
|
|
42166
|
+
const limitWasDefault = limit === void 0;
|
|
42141
42167
|
const {
|
|
42142
42168
|
result: notes,
|
|
42143
42169
|
syncBefore,
|
|
42144
42170
|
syncInterference
|
|
42145
42171
|
} = withSyncAwarenessSync(
|
|
42146
42172
|
"search-notes",
|
|
42147
|
-
() => notesManager.searchNotes(query, searchContent, account, folder, modifiedSince,
|
|
42173
|
+
() => notesManager.searchNotes(query, searchContent, account, folder, modifiedSince, effectiveLimit)
|
|
42148
42174
|
);
|
|
42149
42175
|
const searchType = searchContent ? "content" : "titles";
|
|
42150
42176
|
const folderInfo = folder ? ` in folder "${folder}"` : "";
|
|
42151
42177
|
const dateInfo = modifiedSince ? ` modified since ${modifiedSince}` : "";
|
|
42152
|
-
const
|
|
42178
|
+
const { info: limitInfo, truncationNote } = describeSearchLimit(
|
|
42179
|
+
effectiveLimit,
|
|
42180
|
+
limitWasDefault,
|
|
42181
|
+
notes.length
|
|
42182
|
+
);
|
|
42153
42183
|
const syncWarnings = [];
|
|
42154
42184
|
if (syncBefore.syncDetected) {
|
|
42155
42185
|
syncWarnings.push(`\u26A0\uFE0F iCloud sync was active during search.`);
|
|
@@ -42177,7 +42207,7 @@ ${syncWarnings.join(" ")}` : "";
|
|
|
42177
42207
|
}).join("\n");
|
|
42178
42208
|
return successResponse(
|
|
42179
42209
|
`Found ${notes.length} notes (searched ${searchType}${folderInfo}${dateInfo}${limitInfo}):
|
|
42180
|
-
${noteList}${syncNote}`,
|
|
42210
|
+
${noteList}${truncationNote}${syncNote}`,
|
|
42181
42211
|
{ notes, count: notes.length }
|
|
42182
42212
|
);
|
|
42183
42213
|
}, "Error searching notes")
|
package/package.json
CHANGED