@mgcrea/mcp-apple-mail 1.31.0 → 1.34.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
@@ -138,15 +138,15 @@ npx @modelcontextprotocol/inspector node dist/cli.js
138
138
 
139
139
  ## Tools
140
140
 
141
- | Tool | Does |
142
- | ----------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ |
143
- | `apple_mail_diagnostics` | What the server can currently do and why. **Call this first when anything looks wrong** — it names the exact System Settings pane to open. |
144
- | `apple_mail_list_accounts` | Accounts with UUIDs, addresses and mailbox names. Start here. |
145
- | `apple_mail_list_mailboxes` | Mailboxes, optionally with counts (~0.3 s each). |
146
- | `apple_mail_list_messages` | Newest N of one mailbox, with a `ref` per message. |
147
- | `apple_mail_search_messages` | Any combination of filters. `body` searches message text — see [Body search](#body-search). |
148
- | `apple_mail_count_messages` | Totals and unread, labelled by source. |
149
- | `apple_mail_list_open_drafts` | The drafts open in Mail right now, own text apart from the quote — for "review my draft". |
141
+ | Tool | Does |
142
+ | ----------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
143
+ | `apple_mail_diagnostics` | What the server can currently do and why. **Call this first when anything looks wrong** — it names the exact System Settings pane to open. |
144
+ | `apple_mail_list_accounts` | Accounts with UUIDs, addresses and mailbox names. Start here. |
145
+ | `apple_mail_list_mailboxes` | Mailboxes, optionally with counts — from the index in one pass, ~0.3 s each without it. |
146
+ | `apple_mail_list_messages` | Newest N of one mailbox, with a `ref` per message. |
147
+ | `apple_mail_search_messages` | Any combination of filters. `body` searches message text — see [Body search](#body-search). |
148
+ | `apple_mail_count_messages` | Totals and unread, labelled by source. |
149
+ | `apple_mail_list_open_drafts` | The drafts open in Mail right now, each with a `composer` handle, recipients and its own text apart from the quote, read by the app's `apple_desktop_mail_composers` verb. |
150
150
 
151
151
  Every message carries an opaque `ref` (`m1:<accountUuid>/<mailbox>#<id>`) which the read and action
152
152
  tools take. It is versioned and carries its mailbox, so a row id can never be applied to the wrong
@@ -206,21 +206,23 @@ and a tripwire that refuses to run any script containing a `${`.
206
206
 
207
207
  ## Configure
208
208
 
209
- | Variable | Default | Notes |
210
- | ---------------------------------- | ------------- | ------------------------------------------------------------------------------- |
211
- | `APPLE_MAIL_ALLOW_WRITES` | `0` | Register the mutating tools. |
212
- | `APPLE_MAIL_ACCOUNTS` | all | Comma-separated account names or UUIDs. |
213
- | `APPLE_MAIL_DEBUG` | off | Verbose logging to stderr. |
214
- | `APPLE_MAIL_INDEX_MODE` | `auto` | `auto` \| `ro` \| `immutable` \| `off`. `off` disables the index lane entirely. |
215
- | `APPLE_MAIL_ROOT` | auto | Override Mail's data root. Normally discovered from Mail itself. |
216
- | `APPLE_MAIL_ENVELOPE_INDEX` | auto | Explicit index path, for tests and forensic copies. |
217
- | `APPLE_MAIL_OSASCRIPT_TIMEOUT_MS` | `30000` | Sized for the first-run permission prompt, which blocks. |
218
- | `APPLE_MAIL_DEGRADED_MAX_MESSAGES` | `50` | Cap for the Apple Events listing lane. |
219
- | `APPLE_MAIL_MAX_RESULTS` | `200` | Ceiling for search results. |
220
- | `APPLE_MAIL_BODY_MAX_BYTES` | `262144` | Body truncation, to protect the context window. |
221
- | `APPLE_MAIL_ATTACHMENT_DIR` | `~/Downloads` | The only directory attachments may be saved into. |
222
- | `APPLE_MAIL_ALLOW_FILE_SEND` | off | Let a compose tool attach local files and send in the same call. |
223
- | `APPLE_MAIL_MAILBOX_CACHE_TTL_MS` | `60000` | How long the account/mailbox map is cached. |
209
+ | Variable | Default | Notes |
210
+ | ---------------------------------- | ------------- | ------------------------------------------------------------------------------------------- |
211
+ | `APPLE_MAIL_ALLOW_WRITES` | `0` | Register the mutating tools. |
212
+ | `APPLE_MAIL_ACCOUNTS` | all | Comma-separated account names or UUIDs. |
213
+ | `APPLE_MAIL_DEBUG` | off | Verbose logging to stderr. |
214
+ | `APPLE_MAIL_INDEX_MODE` | `auto` | `auto` \| `ro` \| `immutable` \| `off`. `off` disables the index lane entirely. |
215
+ | `APPLE_MAIL_ROOT` | auto | Override Mail's data root. Normally discovered from Mail itself. |
216
+ | `APPLE_MAIL_ENVELOPE_INDEX` | auto | Explicit index path, for tests and forensic copies. |
217
+ | `APPLE_MAIL_OSASCRIPT_TIMEOUT_MS` | `30000` | Sized for the first-run permission prompt, which blocks. |
218
+ | `APPLE_MAIL_DEGRADED_MAX_MESSAGES` | `50` | Cap for the Apple Events listing lane. |
219
+ | `APPLE_MAIL_MAX_RESULTS` | `200` | Ceiling for search results. |
220
+ | `APPLE_MAIL_BODY_MAX_BYTES` | `262144` | Body truncation, to protect the context window. |
221
+ | `APPLE_MAIL_ATTACHMENT_DIR` | `~/Downloads` | The only directory attachments may be saved into. |
222
+ | `APPLE_MAIL_ALLOW_FILE_SEND` | off | Let a compose tool attach local files and send in the same call. |
223
+ | `APPLE_MAIL_ALLOW_WATCHES` | off | Register `watch` and `unwatch`: a resource agents read and hosts can subscribe to. |
224
+ | `APPLE_MAIL_ALLOW_EVENTS` | off | Serve the experimental `mail.received` event (draft MCP Events extension, 2026-07-28 only). |
225
+ | `APPLE_MAIL_MAILBOX_CACHE_TTL_MS` | `60000` | How long the account/mailbox map is cached. |
224
226
 
225
227
  ## Notes
226
228
 
package/dist/cli.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { a as loadConfig, b as MAIL_SURFACE, j as BUILD_INFO, r as createServer } from "./server-DindWbYb.js";
2
+ import { a as loadConfig, b as MAIL_SURFACE, j as BUILD_INFO, r as createServer } from "./server-C19xfu1o.js";
3
3
  import { runStdioServer } from "@mgcrea/mcp-apple-core";
4
4
  //#region src/cli.ts
5
5
  const LOG_PREFIX = "apple-mail-mcp";
@@ -7,15 +7,16 @@ runStdioServer({
7
7
  build: BUILD_INFO,
8
8
  surface: MAIL_SURFACE,
9
9
  logPrefix: LOG_PREFIX,
10
- start: async (logger) => {
10
+ start: async (logger, ctx) => {
11
11
  const config = loadConfig();
12
12
  const { server } = createServer({
13
13
  config,
14
- logger
14
+ logger,
15
+ era: ctx.era
15
16
  });
16
17
  return {
17
18
  server,
18
- banner: `writes=${config.allowWrites ? "ENABLED" : "disabled"}, accounts=${config.accounts.length ? config.accounts.join("/") : "all"}, index=${config.indexMode}`
19
+ banner: `writes=${config.allowWrites ? "ENABLED" : "disabled"}, watches=${config.allowWatches ? "ENABLED" : "disabled"}, accounts=${config.accounts.length ? config.accounts.join("/") : "all"}, index=${config.indexMode}`
19
20
  };
20
21
  }
21
22
  }).catch((err) => {
package/dist/cli.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cli.js","names":[],"sources":["../src/cli.ts"],"sourcesContent":["#!/usr/bin/env node\nimport { runStdioServer } from \"@mgcrea/mcp-apple-core\";\n\nimport { BUILD_INFO } from \"./build-info.js\";\nimport { MAIL_SURFACE } from \"./client/errors.js\";\nimport { loadConfig } from \"./config.js\";\nimport { createServer } from \"./server.js\";\n\nconst LOG_PREFIX = \"apple-mail-mcp\";\n\nrunStdioServer({\n build: BUILD_INFO,\n surface: MAIL_SURFACE,\n logPrefix: LOG_PREFIX,\n start: async (logger) => {\n const config = loadConfig();\n const { server } = createServer({ config, logger });\n return {\n server,\n banner:\n `writes=${config.allowWrites ? \"ENABLED\" : \"disabled\"}, ` +\n `accounts=${config.accounts.length ? config.accounts.join(\"/\") : \"all\"}, ` +\n `index=${config.indexMode}`,\n };\n },\n}).catch((err: unknown) => {\n console.error(`[${LOG_PREFIX}] fatal:`, err);\n process.exit(1);\n});\n"],"mappings":";;;;AAQA,MAAM,aAAa;AAEnB,eAAe;CACb,OAAO;CACP,SAAS;CACT,WAAW;CACX,OAAO,OAAO,WAAW;EACvB,MAAM,SAAS,WAAW;EAC1B,MAAM,EAAE,WAAW,aAAa;GAAE;GAAQ;EAAO,CAAC;EAClD,OAAO;GACL;GACA,QACE,UAAU,OAAO,cAAc,YAAY,WAAW,aAC1C,OAAO,SAAS,SAAS,OAAO,SAAS,KAAK,GAAG,IAAI,MAAM,UAC9D,OAAO;EACpB;CACF;AACF,CAAC,CAAC,CAAC,OAAO,QAAiB;CACzB,QAAQ,MAAM,IAAI,WAAW,WAAW,GAAG;CAC3C,QAAQ,KAAK,CAAC;AAChB,CAAC"}
1
+ {"version":3,"file":"cli.js","names":[],"sources":["../src/cli.ts"],"sourcesContent":["#!/usr/bin/env node\nimport { runStdioServer } from \"@mgcrea/mcp-apple-core\";\n\nimport { BUILD_INFO } from \"./build-info.js\";\nimport { MAIL_SURFACE } from \"./client/errors.js\";\nimport { loadConfig } from \"./config.js\";\nimport { createServer } from \"./server.js\";\n\nconst LOG_PREFIX = \"apple-mail-mcp\";\n\nrunStdioServer({\n build: BUILD_INFO,\n surface: MAIL_SURFACE,\n logPrefix: LOG_PREFIX,\n start: async (logger, ctx) => {\n const config = loadConfig();\n const { server } = createServer({ config, logger, era: ctx.era });\n return {\n server,\n banner:\n `writes=${config.allowWrites ? \"ENABLED\" : \"disabled\"}, ` +\n `watches=${config.allowWatches ? \"ENABLED\" : \"disabled\"}, ` +\n `accounts=${config.accounts.length ? config.accounts.join(\"/\") : \"all\"}, ` +\n `index=${config.indexMode}`,\n };\n },\n}).catch((err: unknown) => {\n console.error(`[${LOG_PREFIX}] fatal:`, err);\n process.exit(1);\n});\n"],"mappings":";;;;AAQA,MAAM,aAAa;AAEnB,eAAe;CACb,OAAO;CACP,SAAS;CACT,WAAW;CACX,OAAO,OAAO,QAAQ,QAAQ;EAC5B,MAAM,SAAS,WAAW;EAC1B,MAAM,EAAE,WAAW,aAAa;GAAE;GAAQ;GAAQ,KAAK,IAAI;EAAI,CAAC;EAChE,OAAO;GACL;GACA,QACE,UAAU,OAAO,cAAc,YAAY,WAAW,YAC3C,OAAO,eAAe,YAAY,WAAW,aAC5C,OAAO,SAAS,SAAS,OAAO,SAAS,KAAK,GAAG,IAAI,MAAM,UAC9D,OAAO;EACpB;CACF;AACF,CAAC,CAAC,CAAC,OAAO,QAAiB;CACzB,QAAQ,MAAM,IAAI,WAAW,WAAW,GAAG;CAC3C,QAAQ,KAAK,CAAC;AAChB,CAAC"}