apple-mail-mcp 2.10.12 → 2.10.14

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 CHANGED
@@ -579,7 +579,7 @@ Dropped connections reconnect with backoff, and the watchers shut down cleanly o
579
579
 
580
580
  Enable it in your MCP client config alongside the IMAP settings:
581
581
 
582
- ```jsonc
582
+ ```json
583
583
  {
584
584
  "mcpServers": {
585
585
  "apple-mail": {
@@ -680,6 +680,20 @@ Return an attachment's bytes as base64 (the read counterpart to inline-base64 se
680
680
 
681
681
  ---
682
682
 
683
+ #### `resolve-message-id`
684
+
685
+ Map `imap:` message IDs to their numeric Mail.app IDs, via each message's RFC 5322 `Message-ID` (the join key both backends share). Needed only for the two tools that are numeric-ID-only — `reply-to-message` and `forward-message`. Numeric IDs pass through unchanged.
686
+
687
+ | Parameter | Type | Required | Description |
688
+ |-----------|------|----------|-------------|
689
+ | `ids` | string[] | Yes | 1–100 message IDs, each numeric or `imap:…` |
690
+
691
+ **Returns:** For each input ID, its `numericId` (or `null` when it can't be resolved) and the `messageId` used, plus `count` and `resolvedCount`. The lookup scopes to the message's account and checks its INBOX first, to avoid scanning a large All Mail/Archive mailbox.
692
+
693
+ > **You do not need this for flag colors (v2.10.0+).** Colors used to require the numeric-ID path, and older docs and tool descriptions said so. `flag-message` and `batch-flag-messages` now write the color over IMAP directly, as Mail.app's `$MailFlagBit0/1/2` keywords, so a smart mailbox keyed on flag color matches an IMAP-flagged message. Resolving IDs just to apply a color reintroduces the AppleScript/TCC dependency 2.10.0 removed. Flag, move, mark, and delete all accept `imap:` IDs as-is.
694
+
695
+ ---
696
+
683
697
  #### `reply-to-message`
684
698
 
685
699
  Reply to an existing message.
@@ -1309,7 +1323,7 @@ This repo ships a `.mcp.json` at its root so that, when you run `claude` from in
1309
1323
 
1310
1324
  The entrypoint is written as:
1311
1325
 
1312
- ```json
1326
+ ```text
1313
1327
  "args": ["${CLAUDE_PROJECT_DIR:-.}/build/index.js"]
1314
1328
  ```
1315
1329
 
@@ -1375,21 +1389,33 @@ When sending content containing backslashes (`\`) to this MCP server, **you must
1375
1389
 
1376
1390
  **Why:** The MCP protocol uses JSON for parameter passing. In JSON, a single backslash is an escape character. To include a literal backslash in content, it must be escaped as `\\`.
1377
1391
 
1378
- **Example - Email with file path:**
1392
+ **Correct email containing a shell path with an escaped space:**
1393
+
1379
1394
  ```json
1380
1395
  {
1381
1396
  "to": ["colleague@company.com"],
1382
1397
  "subject": "File Location",
1383
- "body": "The file is at C:\\\\Users\\\\Documents\\\\report.pdf"
1398
+ "body": "Run: cp ~/Library/Mobile\\ Documents/report.pdf ~/Desktop/"
1384
1399
  }
1385
1400
  ```
1386
1401
 
1387
- The `\\\\` in JSON becomes `\\` in the actual string, which represents a single `\` in the email.
1402
+ arrives as: `Run: cp ~/Library/Mobile\ Documents/report.pdf ~/Desktop/`
1403
+
1404
+ In a JSON string literal, `\\` — two characters — denotes **one** literal backslash. Four backslashes (`\\\\`) denote **two** literal backslashes, so send those only when the text genuinely contains `\\`.
1405
+
1406
+ **Incorrect — the unescaped backslash makes this invalid JSON:**
1407
+
1408
+ ```text
1409
+ "body": "Run: cp ~/Library/Mobile\ Documents/report.pdf ~/Desktop/"
1410
+ ```
1411
+
1412
+ `\ ` (backslash-space) is not a valid JSON escape sequence, so the call is rejected — or, with a laxer parser, the backslash is silently dropped.
1388
1413
 
1389
1414
  **Common patterns requiring escaping:**
1390
- - Windows paths: `C:\Users\` → `C:\\\\Users\\\\` in JSON
1391
- - Shell escaped spaces: `Mobile\ Documents` → `Mobile\\\\ Documents` in JSON
1392
- - Regex patterns: `\d+` → `\\\\d+` in JSON
1415
+
1416
+ - Shell escaped spaces: `Mobile\ Documents` → `Mobile\\ Documents` in JSON
1417
+ - Regex patterns: `\d+` → `\\d+` in JSON
1418
+ - A literal double backslash: `\\` → `\\\\` in JSON
1393
1419
 
1394
1420
  **If you see errors** when sending emails with backslashes, double-check that backslashes are properly escaped in the JSON payload.
1395
1421
 
@@ -111,7 +111,7 @@ The server reads `APPLE_MAIL_MCP_*` settings. There are two ways to supply them;
111
111
  Works with clients that pass an `env` block through to the server (e.g. **Claude
112
112
  Code** via `~/.claude.json`, and most standard `mcpServers` configs).
113
113
 
114
- ```jsonc
114
+ ```json
115
115
  {
116
116
  "mcpServers": {
117
117
  "apple-mail": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "apple-mail-mcp",
3
- "version": "2.10.12",
3
+ "version": "2.10.14",
4
4
  "description": "MCP server for Apple Mail - read, search, send, and manage emails via Claude and other AI assistants",
5
5
  "type": "module",
6
6
  "main": "build/index.js",
@@ -54,6 +54,7 @@
54
54
  "@typescript-eslint/eslint-plugin": "^8.0.0",
55
55
  "@typescript-eslint/parser": "^8.0.0",
56
56
  "@vitest/coverage-v8": "^4.1.9",
57
+ "ajv": "^8.17.1",
57
58
  "esbuild": "^0.28.1",
58
59
  "eslint": "^9.0.0",
59
60
  "globals": "^17.0.0",