apple-mail-mcp 2.6.0 → 2.6.2
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 +44 -4
- package/build/index.js +43 -3
- package/build/services/imapClient.d.ts.map +1 -1
- package/build/services/imapClient.js +5 -1
- package/build/utils/mimeParse.d.ts.map +1 -1
- package/build/utils/mimeParse.js +14 -3
- package/build/utils/orphan.d.ts +25 -0
- package/build/utils/orphan.d.ts.map +1 -0
- package/build/utils/orphan.js +26 -0
- package/package.json +20 -21
package/README.md
CHANGED
|
@@ -186,7 +186,7 @@ Search for messages matching criteria. Searches all accounts by default.
|
|
|
186
186
|
| `isFlagged` | boolean | No | Filter by flagged status |
|
|
187
187
|
| `dateFrom` | string | No | Start date filter (e.g., "January 1, 2026") |
|
|
188
188
|
| `dateTo` | string | No | End date filter (e.g., "March 1, 2026") |
|
|
189
|
-
| `limit` | number | No | Max results (default: 50) |
|
|
189
|
+
| `limit` | number | No | Max results, 1–500 (default: 50) |
|
|
190
190
|
|
|
191
191
|
**Large mailboxes & partial results.** Apple Mail's AppleScript bridge cannot
|
|
192
192
|
search very large IMAP/Gmail mailboxes (tens of thousands of messages) before
|
|
@@ -222,6 +222,13 @@ Get the full content of a message.
|
|
|
222
222
|
|
|
223
223
|
**Returns:** Subject line and message body (plain text by default, HTML if `preferHtml` is true and HTML content is available).
|
|
224
224
|
|
|
225
|
+
> **Large messages / attachments:** reading a full message routes through
|
|
226
|
+
> `osascript`, whose captured output buffer defaults to **64 MB**. Override it
|
|
227
|
+
> with the `APPLE_MAIL_MCP_MAX_BUFFER` environment variable (in **bytes**) if you
|
|
228
|
+
> work with messages whose raw MIME (e.g. a large embedded attachment) exceeds
|
|
229
|
+
> that — a value below the message size makes the read fail with a buffer-overflow
|
|
230
|
+
> error rather than truncating ([#27](https://github.com/sweetrb/apple-mail-mcp/issues/27)).
|
|
231
|
+
|
|
225
232
|
---
|
|
226
233
|
|
|
227
234
|
#### `list-messages`
|
|
@@ -232,8 +239,8 @@ List messages in a mailbox.
|
|
|
232
239
|
|-----------|------|----------|-------------|
|
|
233
240
|
| `mailbox` | string | No | Mailbox name (omit to list from all mailboxes) |
|
|
234
241
|
| `account` | string | No | Account name |
|
|
235
|
-
| `limit` | number | No | Max messages (default: 50) |
|
|
236
|
-
| `offset` | number | No | Number of messages to skip (for pagination) |
|
|
242
|
+
| `limit` | number | No | Max messages, 1–500 (default: 50) |
|
|
243
|
+
| `offset` | number | No | Number of messages to skip, ≥ 0 (for pagination) |
|
|
237
244
|
| `from` | string | No | Filter by sender email address or name |
|
|
238
245
|
| `unreadOnly` | boolean | No | Only show unread messages |
|
|
239
246
|
|
|
@@ -424,7 +431,7 @@ for an explicitly-named IMAP account, never on an omitted account.
|
|
|
424
431
|
| `APPLE_MAIL_MCP_IMAP_KEYCHAIN_ACCOUNT` | No | = user | Keychain item account |
|
|
425
432
|
| `APPLE_MAIL_MCP_IMAP_ACCOUNTS` | No | — | JSON array of **additional** IMAP accounts for multi-account setups (see below) |
|
|
426
433
|
| `APPLE_MAIL_MCP_IMAP_IDLE` | No | `0` | Set `1` to enable IMAP IDLE push notifications (new-mail alerts) for every configured account |
|
|
427
|
-
| `APPLE_MAIL_MCP_IMAP_IDLE_MS` | No | `
|
|
434
|
+
| `APPLE_MAIL_MCP_IMAP_IDLE_MS` | No | `30000` | Idle timeout (ms) before a pooled IMAP connection is closed (`0` = never close) |
|
|
428
435
|
|
|
429
436
|
**Multiple IMAP accounts (C2):** set `APPLE_MAIL_MCP_IMAP_ACCOUNTS` to a JSON array, e.g.
|
|
430
437
|
`[{"account":"Work","user":"me@co.com","host":"imap.co.com","keychainService":"imap.co.com"}]`.
|
|
@@ -446,6 +453,32 @@ config. Gmail label semantics: common names (`All Mail`, `Sent`, `Trash`,
|
|
|
446
453
|
> (e.g. `iCloud`), and use an **app-specific password** (from appleid.apple.com)
|
|
447
454
|
> stored in the Keychain.
|
|
448
455
|
|
|
456
|
+
##### Connection footprint (playing nice with Gmail)
|
|
457
|
+
|
|
458
|
+
IMAP connections are a shared, capped resource: **Gmail allows at most 15
|
|
459
|
+
simultaneous IMAP connections per account**, and Apple Mail itself needs some of
|
|
460
|
+
those slots. This server keeps its footprint small:
|
|
461
|
+
|
|
462
|
+
- **One pooled connection per account**, reused across calls and **closed after
|
|
463
|
+
~30s idle** (tune with `APPLE_MAIL_MCP_IMAP_IDLE_MS`; `0` = never close). So a
|
|
464
|
+
server that isn't actively serving IMAP calls holds **zero** connections.
|
|
465
|
+
- **IMAP IDLE is opt-in** (`APPLE_MAIL_MCP_IMAP_IDLE=1`). When on, it adds **one
|
|
466
|
+
persistent connection per account** (a long-lived watcher), on top of the
|
|
467
|
+
pooled request connection — leave it off if you don't need push notifications.
|
|
468
|
+
- **Connections are dropped on shutdown** — SIGINT/SIGTERM and stdin-EOF (the
|
|
469
|
+
MCP client/parent going away). As of **v2.6.1** the server also **self-exits if
|
|
470
|
+
it becomes orphaned** (parent force-quit/crashed → reparented to launchd),
|
|
471
|
+
polling every 30s, so it can't linger holding sockets after its session is gone.
|
|
472
|
+
|
|
473
|
+
The catch is **multiple concurrent instances**. A host like the Claude desktop
|
|
474
|
+
app spawns a *separate* set of MCP servers per open conversation (and respawns
|
|
475
|
+
them after a crash), so the footprint is **per instance × accounts**. With IDLE
|
|
476
|
+
off, an idle instance trends to 0 connections; with many *active* conversations
|
|
477
|
+
or IDLE on, the per-account total climbs toward Gmail's 15-connection cap and can
|
|
478
|
+
starve Apple Mail of slots (→ intermittent "cannot connect"). If you hit that,
|
|
479
|
+
close idle Claude conversations, keep `APPLE_MAIL_MCP_IMAP_IDLE` off unless you
|
|
480
|
+
need push, and/or lower `APPLE_MAIL_MCP_IMAP_IDLE_MS`.
|
|
481
|
+
|
|
449
482
|
##### Configuration file (when the host strips `env`)
|
|
450
483
|
|
|
451
484
|
Some host apps (e.g. Claude Desktop) launch the MCP server with a scrubbed
|
|
@@ -1030,6 +1063,13 @@ AI: [calls list-messages with account="Work Exchange", mailbox="INBOX"]
|
|
|
1030
1063
|
"Your Work account has 5 unread messages..."
|
|
1031
1064
|
```
|
|
1032
1065
|
|
|
1066
|
+
To pin which account is used when a tool call omits `account`, set the
|
|
1067
|
+
`APPLE_MAIL_MCP_DEFAULT_ACCOUNT` environment variable to an account **name or
|
|
1068
|
+
email**. When unset (the default), the server falls back to Mail.app's
|
|
1069
|
+
default-send account if it is enabled, otherwise the first enabled account. A
|
|
1070
|
+
**disabled** account is never selected implicitly — this env var (an explicit,
|
|
1071
|
+
deliberate pin) is one of the few ways to target one ([#47](https://github.com/sweetrb/apple-mail-mcp/issues/47)).
|
|
1072
|
+
|
|
1033
1073
|
### Sending Emails Safely
|
|
1034
1074
|
|
|
1035
1075
|
```
|
package/build/index.js
CHANGED
|
@@ -37,6 +37,7 @@ import { registerResourcesAndPrompts } from "./tools/resourcesAndPrompts.js";
|
|
|
37
37
|
import { normalizeSubject, subjectFromGetMessage } from "./tools/thread.js";
|
|
38
38
|
import { ImapIdleWatcher } from "./services/imapIdle.js";
|
|
39
39
|
import { loadFileConfig } from "./services/fileConfig.js";
|
|
40
|
+
import { isOrphaned } from "./utils/orphan.js";
|
|
40
41
|
// Load file-based config FIRST (2.1.1) — before anything reads APPLE_MAIL_MCP_*.
|
|
41
42
|
// Lets users configure the server when the host app strips the MCP env block.
|
|
42
43
|
loadFileConfig();
|
|
@@ -264,7 +265,13 @@ server.registerTool("search-messages", {
|
|
|
264
265
|
isFlagged: z.boolean().optional().describe("Filter by flagged status"),
|
|
265
266
|
dateFrom: DATE_FILTER_SCHEMA.describe("Start date filter (e.g., 'January 1, 2026')"),
|
|
266
267
|
dateTo: DATE_FILTER_SCHEMA.describe("End date filter (e.g., 'March 1, 2026')"),
|
|
267
|
-
limit: z
|
|
268
|
+
limit: z
|
|
269
|
+
.number()
|
|
270
|
+
.int()
|
|
271
|
+
.min(1)
|
|
272
|
+
.max(500)
|
|
273
|
+
.optional()
|
|
274
|
+
.describe("Maximum number of results (default: 50, max: 500)"),
|
|
268
275
|
},
|
|
269
276
|
outputSchema: LIST_OUTPUT_SCHEMA,
|
|
270
277
|
}, withErrorHandling(async ({ query, mailbox, account, limit = 50, dateFrom, dateTo, from, subject, isRead, isFlagged, }) => {
|
|
@@ -484,8 +491,19 @@ server.registerTool("list-messages", {
|
|
|
484
491
|
.optional()
|
|
485
492
|
.describe("Mailbox to list messages from. Omit to list from all mailboxes."),
|
|
486
493
|
account: z.string().optional().describe("Account to list messages from"),
|
|
487
|
-
limit: z
|
|
488
|
-
|
|
494
|
+
limit: z
|
|
495
|
+
.number()
|
|
496
|
+
.int()
|
|
497
|
+
.min(1)
|
|
498
|
+
.max(500)
|
|
499
|
+
.optional()
|
|
500
|
+
.describe("Maximum number of messages (default: 50, max: 500)"),
|
|
501
|
+
offset: z
|
|
502
|
+
.number()
|
|
503
|
+
.int()
|
|
504
|
+
.min(0)
|
|
505
|
+
.optional()
|
|
506
|
+
.describe("Number of messages to skip (for pagination)"),
|
|
489
507
|
from: z.string().optional().describe("Filter by sender email address or name"),
|
|
490
508
|
unreadOnly: z.boolean().optional().describe("Only show unread messages"),
|
|
491
509
|
},
|
|
@@ -1946,8 +1964,14 @@ const shutdown = () => {
|
|
|
1946
1964
|
if (_shuttingDown)
|
|
1947
1965
|
return;
|
|
1948
1966
|
_shuttingDown = true;
|
|
1967
|
+
// Stop the parent-death watchdog (defined just below) so it can't re-enter.
|
|
1968
|
+
clearInterval(orphanWatchdog);
|
|
1949
1969
|
const force = setTimeout(() => process.exit(0), 2000);
|
|
1950
1970
|
force.unref?.();
|
|
1971
|
+
// Closing the IDLE watcher logs out its dedicated per-account connections
|
|
1972
|
+
// (one persistent socket per account when APPLE_MAIL_MCP_IMAP_IDLE=1) and
|
|
1973
|
+
// dropAllPools() closes the request pool — together this releases EVERY IMAP
|
|
1974
|
+
// socket this instance holds, which is the whole point of the orphan check.
|
|
1951
1975
|
void Promise.allSettled([idleWatcher?.stop() ?? Promise.resolve(), dropAllPools()]).finally(() => process.exit(0));
|
|
1952
1976
|
};
|
|
1953
1977
|
for (const sig of ["SIGINT", "SIGTERM"]) {
|
|
@@ -1955,3 +1979,19 @@ for (const sig of ["SIGINT", "SIGTERM"]) {
|
|
|
1955
1979
|
}
|
|
1956
1980
|
process.stdin.on("end", shutdown);
|
|
1957
1981
|
process.stdin.on("close", shutdown);
|
|
1982
|
+
// Parent-death watchdog (connection-footprint hardening, v2.6.1). The exit
|
|
1983
|
+
// paths above all rely on a signal or stdin-EOF, but a host (claude-code) that
|
|
1984
|
+
// is force-quit or crashes delivers neither — leaving this process orphaned and
|
|
1985
|
+
// still holding its IMAP sockets (the IDLE watcher's per-account connections
|
|
1986
|
+
// and/or pooled request connections) against Gmail's ~15-per-account cap, which
|
|
1987
|
+
// can starve Apple Mail of connection slots. On macOS an orphan is reparented to
|
|
1988
|
+
// launchd (ppid 1), so poll for that and self-shutdown. At normal startup ppid
|
|
1989
|
+
// is the real parent, so this never misfires; it's unref'd (never keeps the
|
|
1990
|
+
// event loop alive) and is cleared in shutdown(). `shutdown` only reads this
|
|
1991
|
+
// binding at runtime (long after it's initialized), so the forward reference is
|
|
1992
|
+
// safe.
|
|
1993
|
+
const orphanWatchdog = setInterval(() => {
|
|
1994
|
+
if (isOrphaned())
|
|
1995
|
+
shutdown();
|
|
1996
|
+
}, 30_000);
|
|
1997
|
+
orphanWatchdog.unref?.();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"imapClient.d.ts","sourceRoot":"","sources":["../../src/services/imapClient.ts"],"names":[],"mappings":"AA4BA,eAAO,MAAM,QAAQ;;;;;;;;;CAWX,CAAC;AAEX,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,OAAO,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,MAA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AAM,EACV,IAAI,GAAE,QAAa,EACnB,KAAK,SAAK,GACT,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAmElC"}
|
|
@@ -469,7 +469,11 @@ function imapIdleMs() {
|
|
|
469
469
|
if (Number.isFinite(n) && n >= 0)
|
|
470
470
|
return n;
|
|
471
471
|
}
|
|
472
|
-
|
|
472
|
+
// Default 30s (v2.6.1): close the pooled connection sooner so this instance
|
|
473
|
+
// gives its IMAP slot back quickly — important when several instances coexist
|
|
474
|
+
// against Gmail's ~15-per-account cap and Apple Mail also needs slots. Tune
|
|
475
|
+
// with APPLE_MAIL_MCP_IMAP_IDLE_MS (0 = never close).
|
|
476
|
+
return 30_000;
|
|
473
477
|
}
|
|
474
478
|
async function dropPool(key) {
|
|
475
479
|
const e = pools.get(key);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mimeParse.d.ts","sourceRoot":"","sources":["../../src/utils/mimeParse.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,MAAM,WAAW,kBAAkB;IACjC,uEAAuE;IACvE,IAAI,EAAE,MAAM,CAAC;IACb,yCAAyC;IACzC,QAAQ,EAAE,MAAM,CAAC;IACjB,oFAAoF;IACpF,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,kBAAmB,SAAQ,kBAAkB;IAC5D,6BAA6B;IAC7B,IAAI,EAAE,MAAM,CAAC;CACd;
|
|
1
|
+
{"version":3,"file":"mimeParse.d.ts","sourceRoot":"","sources":["../../src/utils/mimeParse.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,MAAM,WAAW,kBAAkB;IACjC,uEAAuE;IACvE,IAAI,EAAE,MAAM,CAAC;IACb,yCAAyC;IACzC,QAAQ,EAAE,MAAM,CAAC;IACjB,oFAAoF;IACpF,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,kBAAmB,SAAQ,kBAAkB;IAC5D,6BAA6B;IAC7B,IAAI,EAAE,MAAM,CAAC;CACd;AAqMD;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,GAAG,kBAAkB,EAAE,CAyBzE;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAuB7D;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAuB7D;AAED;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,MAAM,EACd,cAAc,EAAE,MAAM,GACrB,kBAAkB,GAAG,IAAI,CAwB3B"}
|
package/build/utils/mimeParse.js
CHANGED
|
@@ -107,19 +107,30 @@ function splitMimeParts(source, boundary) {
|
|
|
107
107
|
}
|
|
108
108
|
return parts;
|
|
109
109
|
}
|
|
110
|
+
/**
|
|
111
|
+
* Maximum nesting depth for multipart MIME traversal. Bounds recursion so a
|
|
112
|
+
* pathologically (or maliciously) deeply nested multipart tree can't blow the
|
|
113
|
+
* stack — past this depth we stop descending and treat the container as a leaf.
|
|
114
|
+
* Real mail nests only a few levels (e.g. mixed → related → alternative).
|
|
115
|
+
*/
|
|
116
|
+
const MAX_MIME_DEPTH = 20;
|
|
110
117
|
/**
|
|
111
118
|
* Walk a multipart MIME block and return all non-multipart leaf parts,
|
|
112
119
|
* descending into nested multipart/* containers (alternative, related, mixed).
|
|
120
|
+
*
|
|
121
|
+
* Descent is bounded by MAX_MIME_DEPTH; once reached, deeper multipart
|
|
122
|
+
* containers are returned as-is (as leaf parts) rather than recursed into,
|
|
123
|
+
* yielding what's parsed so far instead of overflowing the stack.
|
|
113
124
|
*/
|
|
114
|
-
function walkLeafParts(source, boundary) {
|
|
125
|
+
function walkLeafParts(source, boundary, depth = 0) {
|
|
115
126
|
const result = [];
|
|
116
127
|
const parts = splitMimeParts(source, boundary);
|
|
117
128
|
for (const part of parts) {
|
|
118
129
|
const ct = getHeader(part.headers, "Content-Type");
|
|
119
|
-
if (ct && /^multipart\//i.test(ct)) {
|
|
130
|
+
if (ct && /^multipart\//i.test(ct) && depth < MAX_MIME_DEPTH) {
|
|
120
131
|
const nestedBoundary = extractBoundary(ct);
|
|
121
132
|
if (nestedBoundary) {
|
|
122
|
-
result.push(...walkLeafParts(part.body, nestedBoundary));
|
|
133
|
+
result.push(...walkLeafParts(part.body, nestedBoundary, depth + 1));
|
|
123
134
|
continue;
|
|
124
135
|
}
|
|
125
136
|
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Orphaned-process detection (connection-footprint hardening, v2.6.1).
|
|
3
|
+
*
|
|
4
|
+
* The MCP server tears down its pooled IMAP connections on the normal exit
|
|
5
|
+
* paths — SIGINT/SIGTERM and stdin EOF (parent/MCP-client went away). But a
|
|
6
|
+
* claude-code parent that is *force-quit* or crashes never delivers stdin-EOF,
|
|
7
|
+
* so the server would linger as an orphan holding IMAP sockets against Gmail's
|
|
8
|
+
* ~15-per-account connection cap (and starving Apple Mail of slots).
|
|
9
|
+
*
|
|
10
|
+
* On macOS a process whose parent has died is reparented to launchd (pid 1), so
|
|
11
|
+
* `process.ppid === 1` is a reliable "my parent is gone" signal for a server
|
|
12
|
+
* that was never itself launched directly by launchd (this one is always a child
|
|
13
|
+
* of the host app). index.ts polls this on an interval and self-exits when true.
|
|
14
|
+
*
|
|
15
|
+
* Pulled out as a tiny pure function so the decision is unit-testable without
|
|
16
|
+
* importing index.ts (which connects a transport at import time).
|
|
17
|
+
*
|
|
18
|
+
* @module utils/orphan
|
|
19
|
+
*/
|
|
20
|
+
/**
|
|
21
|
+
* True when this process appears orphaned (its parent has died and it was
|
|
22
|
+
* reparented to launchd/init). Defaults to the live `process.ppid`.
|
|
23
|
+
*/
|
|
24
|
+
export declare function isOrphaned(ppid?: number): boolean;
|
|
25
|
+
//# sourceMappingURL=orphan.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"orphan.d.ts","sourceRoot":"","sources":["../../src/utils/orphan.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH;;;GAGG;AACH,wBAAgB,UAAU,CAAC,IAAI,GAAE,MAAqB,GAAG,OAAO,CAE/D"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Orphaned-process detection (connection-footprint hardening, v2.6.1).
|
|
3
|
+
*
|
|
4
|
+
* The MCP server tears down its pooled IMAP connections on the normal exit
|
|
5
|
+
* paths — SIGINT/SIGTERM and stdin EOF (parent/MCP-client went away). But a
|
|
6
|
+
* claude-code parent that is *force-quit* or crashes never delivers stdin-EOF,
|
|
7
|
+
* so the server would linger as an orphan holding IMAP sockets against Gmail's
|
|
8
|
+
* ~15-per-account connection cap (and starving Apple Mail of slots).
|
|
9
|
+
*
|
|
10
|
+
* On macOS a process whose parent has died is reparented to launchd (pid 1), so
|
|
11
|
+
* `process.ppid === 1` is a reliable "my parent is gone" signal for a server
|
|
12
|
+
* that was never itself launched directly by launchd (this one is always a child
|
|
13
|
+
* of the host app). index.ts polls this on an interval and self-exits when true.
|
|
14
|
+
*
|
|
15
|
+
* Pulled out as a tiny pure function so the decision is unit-testable without
|
|
16
|
+
* importing index.ts (which connects a transport at import time).
|
|
17
|
+
*
|
|
18
|
+
* @module utils/orphan
|
|
19
|
+
*/
|
|
20
|
+
/**
|
|
21
|
+
* True when this process appears orphaned (its parent has died and it was
|
|
22
|
+
* reparented to launchd/init). Defaults to the live `process.ppid`.
|
|
23
|
+
*/
|
|
24
|
+
export function isOrphaned(ppid = process.ppid) {
|
|
25
|
+
return ppid === 1;
|
|
26
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "apple-mail-mcp",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.2",
|
|
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",
|
|
@@ -14,25 +14,6 @@
|
|
|
14
14
|
"README.md",
|
|
15
15
|
"LICENSE"
|
|
16
16
|
],
|
|
17
|
-
"scripts": {
|
|
18
|
-
"build": "tsc && tsc-alias",
|
|
19
|
-
"start": "node build/index.js",
|
|
20
|
-
"dev": "tsc --watch",
|
|
21
|
-
"test": "vitest run",
|
|
22
|
-
"test:integration": "vitest run --config vitest.integration.config.ts",
|
|
23
|
-
"test:imap": "vitest run --config vitest.imap.config.ts",
|
|
24
|
-
"test:all": "vitest run && vitest run --config vitest.integration.config.ts",
|
|
25
|
-
"test:watch": "vitest",
|
|
26
|
-
"test:coverage": "vitest run --coverage",
|
|
27
|
-
"lint": "eslint src",
|
|
28
|
-
"lint:fix": "eslint src --fix",
|
|
29
|
-
"format": "prettier --write src",
|
|
30
|
-
"format:check": "prettier --check src",
|
|
31
|
-
"typecheck": "tsc --noEmit",
|
|
32
|
-
"version": "node scripts/sync-plugin-version.mjs && git add .claude-plugin .agents/plugins codex .hermes-plugin .antigravity-plugin",
|
|
33
|
-
"prepublishOnly": "npm run lint && npm run test && npm run build",
|
|
34
|
-
"prepare": "husky; npm run build"
|
|
35
|
-
},
|
|
36
17
|
"keywords": [
|
|
37
18
|
"mcp",
|
|
38
19
|
"apple-mail",
|
|
@@ -67,6 +48,7 @@
|
|
|
67
48
|
"zod": "^3.22.4"
|
|
68
49
|
},
|
|
69
50
|
"devDependencies": {
|
|
51
|
+
"@eslint/js": "^9.0.0",
|
|
70
52
|
"@types/node": "^20.0.0",
|
|
71
53
|
"@types/nodemailer": "^8.0.1",
|
|
72
54
|
"@typescript-eslint/eslint-plugin": "^8.0.0",
|
|
@@ -95,5 +77,22 @@
|
|
|
95
77
|
"overrides": {
|
|
96
78
|
"js-yaml": "^4.2.0",
|
|
97
79
|
"postcss": "^8.5.15"
|
|
80
|
+
},
|
|
81
|
+
"scripts": {
|
|
82
|
+
"build": "tsc && tsc-alias",
|
|
83
|
+
"start": "node build/index.js",
|
|
84
|
+
"dev": "tsc --watch",
|
|
85
|
+
"test": "vitest run",
|
|
86
|
+
"test:integration": "vitest run --config vitest.integration.config.ts",
|
|
87
|
+
"test:imap": "vitest run --config vitest.imap.config.ts",
|
|
88
|
+
"test:all": "vitest run && vitest run --config vitest.integration.config.ts",
|
|
89
|
+
"test:watch": "vitest",
|
|
90
|
+
"test:coverage": "vitest run --coverage",
|
|
91
|
+
"lint": "eslint src",
|
|
92
|
+
"lint:fix": "eslint src --fix",
|
|
93
|
+
"format": "prettier --write src",
|
|
94
|
+
"format:check": "prettier --check src",
|
|
95
|
+
"typecheck": "tsc --noEmit",
|
|
96
|
+
"version": "node scripts/sync-plugin-version.mjs && git add .claude-plugin .agents/plugins codex .hermes-plugin .antigravity-plugin"
|
|
98
97
|
}
|
|
99
|
-
}
|
|
98
|
+
}
|