read-email-mcp 1.0.0 → 2.0.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/LICENSE +21 -21
- package/README.md +153 -34
- package/dist/accounts-cli.d.ts +1 -0
- package/dist/accounts-cli.js +518 -0
- package/dist/accounts-cli.js.map +1 -0
- package/dist/config.d.ts +30 -2
- package/dist/config.js +219 -15
- package/dist/config.js.map +1 -1
- package/dist/imap-discovery.d.ts +52 -0
- package/dist/imap-discovery.js +207 -0
- package/dist/imap-discovery.js.map +1 -0
- package/dist/imap.d.ts +41 -5
- package/dist/imap.js +332 -64
- package/dist/imap.js.map +1 -1
- package/dist/index.js +28 -8
- package/dist/index.js.map +1 -1
- package/dist/providers.d.ts +12 -0
- package/dist/providers.js +122 -0
- package/dist/providers.js.map +1 -0
- package/dist/server.d.ts +3 -6
- package/dist/server.js +10 -8
- package/dist/server.js.map +1 -1
- package/dist/store.d.ts +31 -2
- package/dist/store.js +300 -153
- package/dist/store.js.map +1 -1
- package/dist/tools.d.ts +189 -174
- package/dist/tools.js +714 -60
- package/dist/tools.js.map +1 -1
- package/dist/types.d.ts +44 -1
- package/docs/production-readiness.md +84 -70
- package/package.json +10 -9
- package/scripts/smoke-mcp.mjs +8 -1
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
export const PROVIDER_PRESETS = [
|
|
2
|
+
{
|
|
3
|
+
id: "gmail",
|
|
4
|
+
label: "Gmail / Google Workspace",
|
|
5
|
+
imapHost: "imap.gmail.com",
|
|
6
|
+
imapPort: 993,
|
|
7
|
+
imapSecure: true,
|
|
8
|
+
domains: ["gmail.com", "googlemail.com"],
|
|
9
|
+
hints: [
|
|
10
|
+
"Gmail requires an app password when 2FA is on: https://myaccount.google.com/apppasswords",
|
|
11
|
+
"Enable IMAP in Gmail settings: Settings > See all settings > Forwarding and POP/IMAP"
|
|
12
|
+
]
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
id: "outlook",
|
|
16
|
+
label: "Outlook.com / Microsoft 365",
|
|
17
|
+
imapHost: "outlook.office365.com",
|
|
18
|
+
imapPort: 993,
|
|
19
|
+
imapSecure: true,
|
|
20
|
+
domains: ["outlook.com", "hotmail.com", "hotmail.co.uk", "live.com", "msn.com"],
|
|
21
|
+
hints: [
|
|
22
|
+
"Microsoft may require an app password or OAuth2 for accounts with MFA",
|
|
23
|
+
"Some Microsoft 365 tenants disable basic-auth IMAP; ask your admin if login fails"
|
|
24
|
+
]
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
id: "yahoo",
|
|
28
|
+
label: "Yahoo Mail",
|
|
29
|
+
imapHost: "imap.mail.yahoo.com",
|
|
30
|
+
imapPort: 993,
|
|
31
|
+
imapSecure: true,
|
|
32
|
+
domains: ["yahoo.com", "ymail.com", "rocketmail.com", "yahoo.co.uk", "yahoo.ca", "yahoo.co.in"],
|
|
33
|
+
hints: ["Yahoo requires an app password: https://login.yahoo.com/account/security"]
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
id: "icloud",
|
|
37
|
+
label: "iCloud Mail",
|
|
38
|
+
imapHost: "imap.mail.me.com",
|
|
39
|
+
imapPort: 993,
|
|
40
|
+
imapSecure: true,
|
|
41
|
+
domains: ["icloud.com", "me.com", "mac.com"],
|
|
42
|
+
hints: ["iCloud requires an app-specific password: https://appleid.apple.com > Sign-In and Security > App-Specific Passwords"]
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
id: "fastmail",
|
|
46
|
+
label: "Fastmail",
|
|
47
|
+
imapHost: "imap.fastmail.com",
|
|
48
|
+
imapPort: 993,
|
|
49
|
+
imapSecure: true,
|
|
50
|
+
domains: ["fastmail.com", "fastmail.fm", "sent.as"],
|
|
51
|
+
hints: ["Fastmail requires an app password: Settings > Privacy & Security > Integrations > App passwords"]
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
id: "zoho",
|
|
55
|
+
label: "Zoho Mail",
|
|
56
|
+
imapHost: "imap.zoho.com",
|
|
57
|
+
imapPort: 993,
|
|
58
|
+
imapSecure: true,
|
|
59
|
+
domains: ["zoho.com", "zohomail.com"],
|
|
60
|
+
hints: ["Enable IMAP access in Zoho Mail settings first (Mail settings > IMAP access)"]
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
id: "aol",
|
|
64
|
+
label: "AOL Mail",
|
|
65
|
+
imapHost: "imap.aol.com",
|
|
66
|
+
imapPort: 993,
|
|
67
|
+
imapSecure: true,
|
|
68
|
+
domains: ["aol.com", "aim.com"],
|
|
69
|
+
hints: ["AOL requires an app password: https://login.aol.com/account/security"]
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
id: "gmx",
|
|
73
|
+
label: "GMX",
|
|
74
|
+
imapHost: "imap.gmx.com",
|
|
75
|
+
imapPort: 993,
|
|
76
|
+
imapSecure: true,
|
|
77
|
+
domains: ["gmx.com", "gmx.net", "gmx.de", "gmx.at", "gmx.ch"],
|
|
78
|
+
hints: []
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
id: "proton",
|
|
82
|
+
label: "Proton Mail (via Bridge)",
|
|
83
|
+
imapHost: "127.0.0.1",
|
|
84
|
+
imapPort: 1143,
|
|
85
|
+
imapSecure: false,
|
|
86
|
+
domains: ["proton.me", "protonmail.com", "pm.me"],
|
|
87
|
+
hints: [
|
|
88
|
+
"Proton Mail needs Proton Mail Bridge running locally (https://proton.me/mail/bridge)",
|
|
89
|
+
"Use the Bridge-generated mailbox password, not your Proton account password"
|
|
90
|
+
]
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
id: "yandex",
|
|
94
|
+
label: "Yandex Mail",
|
|
95
|
+
imapHost: "imap.yandex.com",
|
|
96
|
+
imapPort: 993,
|
|
97
|
+
imapSecure: true,
|
|
98
|
+
domains: ["yandex.com", "yandex.ru", "ya.ru"],
|
|
99
|
+
hints: ["Enable IMAP in Yandex Mail settings; app password required with 2FA"]
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
id: "mailcom",
|
|
103
|
+
label: "mail.com",
|
|
104
|
+
imapHost: "imap.mail.com",
|
|
105
|
+
imapPort: 993,
|
|
106
|
+
imapSecure: true,
|
|
107
|
+
domains: ["mail.com", "email.com", "usa.com", "post.com"],
|
|
108
|
+
hints: []
|
|
109
|
+
}
|
|
110
|
+
];
|
|
111
|
+
export function findProvider(id) {
|
|
112
|
+
const needle = id.trim().toLowerCase();
|
|
113
|
+
return PROVIDER_PRESETS.find((preset) => preset.id === needle) ?? null;
|
|
114
|
+
}
|
|
115
|
+
export function detectProvider(email) {
|
|
116
|
+
const domain = email.split("@")[1]?.trim().toLowerCase();
|
|
117
|
+
if (!domain) {
|
|
118
|
+
return null;
|
|
119
|
+
}
|
|
120
|
+
return PROVIDER_PRESETS.find((preset) => preset.domains.includes(domain)) ?? null;
|
|
121
|
+
}
|
|
122
|
+
//# sourceMappingURL=providers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"providers.js","sourceRoot":"","sources":["../src/providers.ts"],"names":[],"mappings":"AAUA,MAAM,CAAC,MAAM,gBAAgB,GAAqB;IAChD;QACE,EAAE,EAAE,OAAO;QACX,KAAK,EAAE,0BAA0B;QACjC,QAAQ,EAAE,gBAAgB;QAC1B,QAAQ,EAAE,GAAG;QACb,UAAU,EAAE,IAAI;QAChB,OAAO,EAAE,CAAC,WAAW,EAAE,gBAAgB,CAAC;QACxC,KAAK,EAAE;YACL,0FAA0F;YAC1F,sFAAsF;SACvF;KACF;IACD;QACE,EAAE,EAAE,SAAS;QACb,KAAK,EAAE,6BAA6B;QACpC,QAAQ,EAAE,uBAAuB;QACjC,QAAQ,EAAE,GAAG;QACb,UAAU,EAAE,IAAI;QAChB,OAAO,EAAE,CAAC,aAAa,EAAE,aAAa,EAAE,eAAe,EAAE,UAAU,EAAE,SAAS,CAAC;QAC/E,KAAK,EAAE;YACL,uEAAuE;YACvE,mFAAmF;SACpF;KACF;IACD;QACE,EAA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AC,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IACzD,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,gBAAgB,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,IAAI,IAAI,CAAC;AACpF,CAAC"}
|
package/dist/server.d.ts
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
2
|
import type { z } from "zod";
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
import { EmailStore } from "./store.js";
|
|
6
|
-
import { createToolHandlers, type ToolResult } from "./tools.js";
|
|
7
|
-
export declare const REQUIRED_TOOL_NAMES: readonly ["sync_email", "get_sync_status", "list_mailboxes", "get_recent_emails", "browse_email_dates", "search_emails", "list_emails", "get_email", "get_thread", "get_raw_email", "get_storage_stats", "optimize_email_store"];
|
|
3
|
+
import { createToolHandlers, type AccountRuntime, type ToolResult } from "./tools.js";
|
|
4
|
+
export declare const REQUIRED_TOOL_NAMES: readonly ["sync_email", "list_accounts", "get_sync_status", "list_mailboxes", "get_recent_emails", "browse_email_dates", "search_emails", "list_emails", "get_email", "get_emails", "get_thread", "list_attachments", "get_attachment", "get_inbox_summary", "list_senders", "check_accounts", "get_raw_email", "get_storage_stats", "optimize_email_store"];
|
|
8
5
|
type EmailToolHandlers = ReturnType<typeof createToolHandlers>;
|
|
9
6
|
export interface ToolRegistrar {
|
|
10
7
|
registerTool(name: string, config: {
|
|
@@ -13,5 +10,5 @@ export interface ToolRegistrar {
|
|
|
13
10
|
}, handler: (args: unknown) => Promise<ToolResult>): unknown;
|
|
14
11
|
}
|
|
15
12
|
export declare function registerEmailTools(registrar: ToolRegistrar, handlers: EmailToolHandlers): void;
|
|
16
|
-
export declare function createEmailMcpServer(
|
|
13
|
+
export declare function createEmailMcpServer(accounts: AccountRuntime[]): McpServer;
|
|
17
14
|
export {};
|
package/dist/server.js
CHANGED
|
@@ -2,6 +2,7 @@ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
|
2
2
|
import { createToolHandlers, toolDescriptions, toolSchemas } from "./tools.js";
|
|
3
3
|
export const REQUIRED_TOOL_NAMES = [
|
|
4
4
|
"sync_email",
|
|
5
|
+
"list_accounts",
|
|
5
6
|
"get_sync_status",
|
|
6
7
|
"list_mailboxes",
|
|
7
8
|
"get_recent_emails",
|
|
@@ -9,7 +10,13 @@ export const REQUIRED_TOOL_NAMES = [
|
|
|
9
10
|
"search_emails",
|
|
10
11
|
"list_emails",
|
|
11
12
|
"get_email",
|
|
13
|
+
"get_emails",
|
|
12
14
|
"get_thread",
|
|
15
|
+
"list_attachments",
|
|
16
|
+
"get_attachment",
|
|
17
|
+
"get_inbox_summary",
|
|
18
|
+
"list_senders",
|
|
19
|
+
"check_accounts",
|
|
13
20
|
"get_raw_email",
|
|
14
21
|
"get_storage_stats",
|
|
15
22
|
"optimize_email_store"
|
|
@@ -22,17 +29,12 @@ export function registerEmailTools(registrar, handlers) {
|
|
|
22
29
|
}, async (args) => handlers[name](args));
|
|
23
30
|
}
|
|
24
31
|
}
|
|
25
|
-
export function createEmailMcpServer(
|
|
32
|
+
export function createEmailMcpServer(accounts) {
|
|
26
33
|
const server = new McpServer({
|
|
27
34
|
name: "read-email-mcp",
|
|
28
|
-
version: "
|
|
29
|
-
});
|
|
30
|
-
const handlers = createToolHandlers({
|
|
31
|
-
accountEmail: config.account.email,
|
|
32
|
-
storagePath: config.storage.accountDir,
|
|
33
|
-
store,
|
|
34
|
-
sync
|
|
35
|
+
version: "2.0.0"
|
|
35
36
|
});
|
|
37
|
+
const handlers = createToolHandlers({ accounts });
|
|
36
38
|
registerEmailTools(server, handlers);
|
|
37
39
|
return server;
|
|
38
40
|
}
|
package/dist/server.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEpE,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,WAAW,EAAwC,MAAM,YAAY,CAAC;AAErH,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,YAAY;IACZ,eAAe;IACf,iBAAiB;IACjB,gBAAgB;IAChB,mBAAmB;IACnB,oBAAoB;IACpB,eAAe;IACf,aAAa;IACb,WAAW;IACX,YAAY;IACZ,YAAY;IACZ,kBAAkB;IAClB,gBAAgB;IAChB,mBAAmB;IACnB,cAAc;IACd,gBAAgB;IAChB,eAAe;IACf,mBAAmB;IACnB,sBAAsB;CACd,CAAC;AAaX,MAAM,UAAU,kBAAkB,CAAC,SAAwB,EAAE,QAA2B;IACtF,KAAK,MAAM,IAAI,IAAI,mBAAmB,EAAE,CAAC;QACvC,SAAS,CAAC,YAAY,CACpB,IAAI,EACJ;YACE,WAAW,EAAE,gBAAgB,CAAC,IAAI,CAAC;YACnC,WAAW,EAAE,WAAW,CAAC,IAAI,CAAC;SAC/B,EACD,KAAK,EAAE,IAAa,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAgB,CAAC,CAAC,IAAa,CAAC,CACnE,CAAC;IACJ,CAAC;AACH,CAAC;AAED,MAAM,UAAU,oBAAoB,CAAC,QAA0B;IAC7D,MAAM,MAAM,GAAG,IAAI,SAAS,CAAC;QAC3B,IAAI,EAAE,gBAAgB;QACtB,OAAO,EAAE,OAAO;KACjB,CAAC,CAAC;IACH,MAAM,QAAQ,GAAG,kBAAkB,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC;IAClD,kBAAkB,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IACrC,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
package/dist/store.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { DateBucket, DateBucketOptions, MailboxRecord, MessageFilters, MessageInput, PaginatedMessages, StoredMessage, SyncResultRecord, SyncStatus } from "./types.js";
|
|
1
|
+
import type { DateBucket, DateBucketOptions, MailboxRecord, MessageFilters, MessageInput, MessageSummary, PaginatedMessages, SenderStat, StoredMessage, SyncResultRecord, SyncStatus } from "./types.js";
|
|
2
2
|
export declare class EmailStore {
|
|
3
3
|
private readonly databasePath;
|
|
4
4
|
private db;
|
|
@@ -8,16 +8,36 @@ export declare class EmailStore {
|
|
|
8
8
|
upsertMailbox(mailbox: MailboxRecord): void;
|
|
9
9
|
listMailboxes(): MailboxRecord[];
|
|
10
10
|
getMailbox(mailboxPath: string): MailboxRecord | null;
|
|
11
|
-
deleteMailboxMessages(mailboxPath: string):
|
|
11
|
+
deleteMailboxMessages(mailboxPath: string): string[];
|
|
12
|
+
updateMessageFlags(mailbox: string, uid: number, flags: string[]): boolean;
|
|
13
|
+
pruneMailboxMessagesExcept(mailboxPath: string, keepUids: ReadonlySet<number>, maxUid: number): string[];
|
|
12
14
|
upsertMessage(message: MessageInput): number;
|
|
13
15
|
searchMessages(filters?: MessageFilters): PaginatedMessages;
|
|
14
16
|
listMessages(filters?: MessageFilters): PaginatedMessages;
|
|
15
17
|
getMessageById(id: number): StoredMessage | null;
|
|
16
18
|
getMessageByMailboxUid(mailbox: string, uid: number): StoredMessage | null;
|
|
17
19
|
getMessageByMessageId(messageId: string): StoredMessage | null;
|
|
20
|
+
getMessagesByIds(ids: number[]): StoredMessage[];
|
|
18
21
|
getThread(messageIdOrInternalId: number | string): StoredMessage[];
|
|
22
|
+
private findMessagesReferencing;
|
|
19
23
|
getDateBuckets(options: DateBucketOptions): DateBucket[];
|
|
20
24
|
recordSyncResult(result: SyncResultRecord): void;
|
|
25
|
+
getMessageCounts(): {
|
|
26
|
+
total: number;
|
|
27
|
+
unread: number;
|
|
28
|
+
flagged: number;
|
|
29
|
+
};
|
|
30
|
+
getTopSenders(options?: {
|
|
31
|
+
limit?: number;
|
|
32
|
+
unreadOnly?: boolean;
|
|
33
|
+
}): SenderStat[];
|
|
34
|
+
searchRanked(filters: MessageFilters, paging: {
|
|
35
|
+
limit: number;
|
|
36
|
+
offset: number;
|
|
37
|
+
}): {
|
|
38
|
+
items: MessageSummary[];
|
|
39
|
+
hasMore: boolean;
|
|
40
|
+
};
|
|
21
41
|
getSyncStatus(): SyncStatus;
|
|
22
42
|
getStorageStats(): {
|
|
23
43
|
databasePath: string;
|
|
@@ -36,3 +56,12 @@ export declare class EmailStore {
|
|
|
36
56
|
private refreshFts;
|
|
37
57
|
private get connection();
|
|
38
58
|
}
|
|
59
|
+
export declare function encodeCursor(message: {
|
|
60
|
+
date: string;
|
|
61
|
+
id: number;
|
|
62
|
+
}, sort: NonNullable<MessageFilters["sort"]>): string;
|
|
63
|
+
export declare function decodeCursor(cursor?: string): {
|
|
64
|
+
date: string;
|
|
65
|
+
id: number;
|
|
66
|
+
sort: NonNullable<MessageFilters["sort"]>;
|
|
67
|
+
} | null;
|