@assistantmail/assistantmail-mcp 1.2.1 → 1.3.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.
Files changed (3) hide show
  1. package/README.md +28 -1
  2. package/package.json +12 -3
  3. package/src/index.js +68 -0
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  MCP server for [AssistantMail](https://assistant-mail.ai) — lets AI agents send and receive email through a managed mailbox.
4
4
 
5
- [Website](https://assistant-mail.ai) · [Privacy Policy](https://assistant-mail.ai/privacy.html) · [Terms of Use](https://assistant-mail.ai/terms.html)
5
+ [Website](https://assistant-mail.ai) · [Privacy Policy](https://assistant-mail.ai/privacy.html) · [Terms of Use](https://assistant-mail.ai/terms.html) · [Contributing](./CONTRIBUTING.md)
6
6
 
7
7
  ## Installation
8
8
 
@@ -10,6 +10,21 @@ MCP server for [AssistantMail](https://assistant-mail.ai) — lets AI agents sen
10
10
  npx @assistantmail/assistantmail-mcp
11
11
  ```
12
12
 
13
+ Requires Node.js 24 or newer.
14
+
15
+ ## For npm users
16
+
17
+ If you are installing from npm and want the shortest setup path:
18
+
19
+ 1. Install/run with:
20
+
21
+ ```bash
22
+ npx -y @assistantmail/assistantmail-mcp
23
+ ```
24
+
25
+ 2. Set `ASSISTANT_MAIL_API_KEY` in your MCP client environment.
26
+ 3. Call `assistantmail_list_mailboxes` first to get your `mailboxId`.
27
+
13
28
  ### Claude Desktop
14
29
 
15
30
  ```json
@@ -88,6 +103,7 @@ Mail API routes use a `mailboxId` (UUID), not an email address. Use `assistantma
88
103
  | `assistantmail_list_messages` | List inbound and outbound messages for a mailbox. Supports `since` (ISO timestamp) and `limit` (max 100). |
89
104
  | `assistantmail_get_message` | Fetch a single message including `textBody` and `htmlBody`. Bodies are only returned within the plan's retention window; `bodyExpired: true` is set if the window has elapsed. |
90
105
  | `assistantmail_send_email` | Queue an outbound email. Requires `to`, `subject`, and at least one of `text` or `html`. |
106
+ | `assistantmail_reply_message` | Reply to an existing message. Requires `messageId` and at least one of `text` or `html`; recipients and subject are derived automatically. |
91
107
  | `assistantmail_delete_messages` | Delete messages by `messageIds` array, or pass `deleteAll: true` to clear the mailbox. |
92
108
  | `assistantmail_get_usage` | Get daily and monthly send quota usage for a mailbox. A `null` limit means unlimited. |
93
109
 
@@ -159,6 +175,17 @@ curl "$BASE/v1/mailboxes/<mailboxId>/messages" -H "x-api-key: $API_KEY"
159
175
  }
160
176
  ```
161
177
 
178
+ ```json
179
+ {
180
+ "tool": "assistantmail_reply_message",
181
+ "input": {
182
+ "mailboxId": "<uuid>",
183
+ "messageId": "<uuid>",
184
+ "text": "Thanks for the update."
185
+ }
186
+ }
187
+ ```
188
+
162
189
  If `ASSISTANT_MAIL_API_KEY` is set in the server environment, `apiKey` can be omitted from all tool inputs.
163
190
 
164
191
  ---
package/package.json CHANGED
@@ -1,7 +1,15 @@
1
1
  {
2
2
  "name": "@assistantmail/assistantmail-mcp",
3
- "version": "1.2.1",
3
+ "version": "1.3.0",
4
4
  "description": "AssistantMail MCP server",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "https://github.com/AssistantMail/assistantmail-mcp.git"
8
+ },
9
+ "homepage": "https://assistant-mail.ai",
10
+ "bug": {
11
+ "url": "https://github.com/AssistantMail/assistantmail-mcp/issues"
12
+ },
5
13
  "type": "module",
6
14
  "bin": {
7
15
  "assistantmail-mcp": "src/index.js"
@@ -13,6 +21,7 @@
13
21
  ],
14
22
  "scripts": {
15
23
  "build": "node --check src/index.js",
24
+ "lint": "node --check src/index.js",
16
25
  "start": "node src/index.js"
17
26
  },
18
27
  "keywords": [
@@ -22,13 +31,13 @@
22
31
  "openai",
23
32
  "OpenClaw"
24
33
  ],
25
- "author": "Crider Technologies",
34
+ "author": "AssistantMail",
26
35
  "license": "MIT",
27
36
  "publishConfig": {
28
37
  "access": "public"
29
38
  },
30
39
  "engines": {
31
- "node": ">=20"
40
+ "node": ">=24"
32
41
  },
33
42
  "dependencies": {
34
43
  "@modelcontextprotocol/sdk": "^1.29.0",
package/src/index.js CHANGED
@@ -504,6 +504,74 @@ server.tool(
504
504
  },
505
505
  );
506
506
 
507
+ server.tool(
508
+ 'assistantmail_reply_message',
509
+ 'Replies to an existing message in a mailbox thread.',
510
+ {
511
+ mailboxId: z.string().min(1),
512
+ messageId: z.string().min(1),
513
+ text: z.string().optional(),
514
+ html: z.string().optional(),
515
+ apiKey: z.string().startsWith('amk_').optional(),
516
+ },
517
+ async ({ mailboxId, messageId, text, html, apiKey }) => {
518
+ if (!text && !html) {
519
+ return {
520
+ content: [
521
+ {
522
+ type: 'text',
523
+ text: 'assistantmail_reply_message failed: Provide at least one of text or html.',
524
+ },
525
+ ],
526
+ isError: true,
527
+ };
528
+ }
529
+
530
+ try {
531
+ const result = await assistantMailPost(
532
+ `/v1/mailboxes/${mailboxId}/messages/${messageId}/reply`,
533
+ apiKey,
534
+ { text, html },
535
+ );
536
+ const reply = result.data;
537
+ if (
538
+ !reply
539
+ || typeof reply !== 'object'
540
+ || typeof reply.messageId !== 'string'
541
+ || typeof reply.status !== 'string'
542
+ || typeof reply.inReplyTo !== 'string'
543
+ || typeof reply.subject !== 'string'
544
+ ) {
545
+ throw new Error('AssistantMail API returned an unexpected reply payload.');
546
+ }
547
+ return {
548
+ content: [
549
+ {
550
+ type: 'text',
551
+ text: `Queued reply for message ${messageId} in mailbox ${mailboxId}.`,
552
+ },
553
+ ],
554
+ structuredContent: {
555
+ messageId: reply.messageId,
556
+ status: reply.status,
557
+ inReplyTo: reply.inReplyTo,
558
+ subject: reply.subject,
559
+ },
560
+ };
561
+ } catch (error) {
562
+ return {
563
+ content: [
564
+ {
565
+ type: 'text',
566
+ text: `assistantmail_reply_message failed: ${error instanceof Error ? error.message : String(error)}`,
567
+ },
568
+ ],
569
+ isError: true,
570
+ };
571
+ }
572
+ },
573
+ );
574
+
507
575
  server.tool(
508
576
  'assistantmail_delete_messages',
509
577
  'Deletes messages from a mailbox by IDs or deletes all messages.',