apple-mail-mcp 1.3.0 → 1.4.0

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
@@ -724,6 +724,16 @@ If installed from source, use this configuration:
724
724
  | Attachment save path restrictions | `save-attachment` only allows saving to home directory, `/tmp`, `/private/tmp`, and `/Volumes`; path traversal is blocked |
725
725
  | Attachment count limit | `send-email` and `create-draft` accept a maximum of 20 file attachments |
726
726
 
727
+ ### Reply / Forward from Background Processes (Fixed in v1.4.0)
728
+
729
+ Prior to v1.4.0, `reply-to-message` and `forward-message` would send messages with **empty body text** when the MCP server ran as a background process (e.g., spawned via `execSync` from Node.js, which is how Claude Code invokes it).
730
+
731
+ **Root cause:** The AppleScript `reply msg with opening window` command creates a GUI compose window asynchronously. When `set content` runs immediately after, the window may not be ready, and the content assignment is silently ignored. Delays (`delay 1`, `delay 2`) were unreliable — the compose window's readiness depends on system load, Mail.app state, and whether the process has GUI access.
732
+
733
+ **Fix:** Replaced `with opening window` with `without opening window` for both `reply` and `forward` commands. With this approach, `set content` works immediately and reliably from background processes. `In-Reply-To` and `References` headers are still set correctly by Mail.app, and no GUI compose window is opened.
734
+
735
+ See [#7](https://github.com/sweetrb/apple-mail-mcp/issues/7) for full details and the list of approaches that were tested.
736
+
727
737
  ### Backslash Escaping (Important for AI Agents)
728
738
 
729
739
  When sending content containing backslashes (`\`) to this MCP server, **you must escape them as `\\`** in the JSON parameters.
@@ -826,8 +826,8 @@ export class AppleMailManager {
826
826
  set matchingMsgs to (messages of mb whose id is ${Number(id)})
827
827
  if (count of matchingMsgs) > 0 then
828
828
  set msg to item 1 of matchingMsgs
829
- set theReply to reply msg with opening window${replyAllClause}
830
- set content of theReply to "${safeBody}" & return & return & content of theReply
829
+ set theReply to reply msg without opening window${replyAllClause}
830
+ set content of theReply to "${safeBody}"
831
831
  ${sendAction}
832
832
  return "ok"
833
833
  end if
@@ -871,9 +871,9 @@ export class AppleMailManager {
871
871
  set matchingMsgs to (messages of mb whose id is ${Number(id)})
872
872
  if (count of matchingMsgs) > 0 then
873
873
  set msg to item 1 of matchingMsgs
874
- set theForward to forward msg with opening window
874
+ set theForward to forward msg without opening window
875
875
  ${recipientCommands}
876
- ${safeBody ? `set content of theForward to "${safeBody}" & return & return & content of theForward` : ""}
876
+ ${safeBody ? `set content of theForward to "${safeBody}"` : ""}
877
877
  ${sendAction}
878
878
  return "ok"
879
879
  end if
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "apple-mail-mcp",
3
- "version": "1.3.0",
3
+ "version": "1.4.0",
4
4
  "description": "MCP server for Apple Mail - read, search, send, and manage emails via Claude",
5
5
  "type": "module",
6
6
  "main": "build/index.js",