mcp-mail-server 1.1.14 → 1.1.15
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 +55 -133
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Mail
|
|
1
|
+
# Mcp Mail Server
|
|
2
2
|
|
|
3
3
|
<!-- mcp-name: mcp-mail-server -->
|
|
4
4
|
|
|
@@ -9,9 +9,6 @@
|
|
|
9
9
|
|
|
10
10
|
A Model Context Protocol (MCP) server that provides email capabilities through IMAP and SMTP protocols. This server enables LLMs to search, read, manage, and send emails on behalf of users.
|
|
11
11
|
|
|
12
|
-
> [!NOTE]
|
|
13
|
-
> This server requires access to your email account credentials. Use **app-specific passwords** whenever possible, and never hardcode credentials. Exercise caution to ensure your email data is handled securely.
|
|
14
|
-
|
|
15
12
|
### Features
|
|
16
13
|
|
|
17
14
|
- Read/search/delete emails via IMAP
|
|
@@ -21,135 +18,6 @@ A Model Context Protocol (MCP) server that provides email capabilities through I
|
|
|
21
18
|
- Automatic IMAP/SMTP connection management
|
|
22
19
|
- Secure TLS/SSL connections
|
|
23
20
|
|
|
24
|
-
### Tools
|
|
25
|
-
|
|
26
|
-
- **connect_all**
|
|
27
|
-
- Connect to both IMAP and SMTP servers
|
|
28
|
-
- No parameters required
|
|
29
|
-
|
|
30
|
-
- **get_connection_status**
|
|
31
|
-
- Check current connection status and server info
|
|
32
|
-
- No parameters required
|
|
33
|
-
|
|
34
|
-
- **disconnect_all**
|
|
35
|
-
- Disconnect from all email servers
|
|
36
|
-
- No parameters required
|
|
37
|
-
|
|
38
|
-
- **open_mailbox**
|
|
39
|
-
- Open a specific mailbox/folder
|
|
40
|
-
- Inputs:
|
|
41
|
-
- `mailboxName` (string, optional): Folder name (default: "INBOX")
|
|
42
|
-
- `readOnly` (boolean, optional): Open in read-only mode
|
|
43
|
-
|
|
44
|
-
- **list_mailboxes**
|
|
45
|
-
- List all available mail folders
|
|
46
|
-
- No parameters required
|
|
47
|
-
|
|
48
|
-
- **search_messages**
|
|
49
|
-
- Search emails using IMAP search criteria
|
|
50
|
-
- Inputs:
|
|
51
|
-
- `criteria` (array): IMAP search criteria
|
|
52
|
-
|
|
53
|
-
- **search_by_sender**
|
|
54
|
-
- Find emails from a specific sender
|
|
55
|
-
- Inputs:
|
|
56
|
-
- `sender` (string): Email address of sender
|
|
57
|
-
|
|
58
|
-
- **search_by_subject**
|
|
59
|
-
- Search emails by subject keywords
|
|
60
|
-
- Inputs:
|
|
61
|
-
- `subject` (string): Subject keywords
|
|
62
|
-
|
|
63
|
-
- **search_by_body**
|
|
64
|
-
- Search within email message content
|
|
65
|
-
- Inputs:
|
|
66
|
-
- `text` (string): Search text
|
|
67
|
-
|
|
68
|
-
- **search_since_date**
|
|
69
|
-
- Find emails since a specific date
|
|
70
|
-
- Inputs:
|
|
71
|
-
- `date` (string): Date string
|
|
72
|
-
|
|
73
|
-
- **search_unreplied_from_sender**
|
|
74
|
-
- Find unreplied emails from a specific sender
|
|
75
|
-
- Inputs:
|
|
76
|
-
- `sender` (string): Email address
|
|
77
|
-
- `startDate` (string, optional): Start date filter
|
|
78
|
-
- `endDate` (string, optional): End date filter
|
|
79
|
-
|
|
80
|
-
- **search_larger_than**
|
|
81
|
-
- Find emails larger than a specific size
|
|
82
|
-
- Inputs:
|
|
83
|
-
- `size` (number): Size threshold in bytes
|
|
84
|
-
|
|
85
|
-
- **get_message**
|
|
86
|
-
- Retrieve a single email by UID
|
|
87
|
-
- Inputs:
|
|
88
|
-
- `uid` (number): Email UID
|
|
89
|
-
- `markSeen` (boolean, optional): Mark as read
|
|
90
|
-
- `includeAttachmentContent` (boolean, optional): Include attachment data (default: true)
|
|
91
|
-
- `attachmentMaxBytes` (number, optional): Max attachment size to include
|
|
92
|
-
|
|
93
|
-
- **get_messages**
|
|
94
|
-
- Retrieve multiple emails by UIDs
|
|
95
|
-
- Inputs:
|
|
96
|
-
- `uids` (number[]): Array of email UIDs
|
|
97
|
-
- `markSeen` (boolean, optional): Mark as read
|
|
98
|
-
- `includeAttachmentContent` (boolean, optional): Include attachment data (default: false)
|
|
99
|
-
- `attachmentMaxBytes` (number, optional): Max attachment size to include
|
|
100
|
-
|
|
101
|
-
Attachment fields returned in message objects:
|
|
102
|
-
- `attachments[].filename`
|
|
103
|
-
- `attachments[].contentType`
|
|
104
|
-
- `attachments[].size`
|
|
105
|
-
- `attachments[].contentBase64` (only when `includeAttachmentContent=true` and within size limit)
|
|
106
|
-
- `attachments[].contentTruncated` (true when attachment exceeds `attachmentMaxBytes`)
|
|
107
|
-
|
|
108
|
-
- **export_attachment**
|
|
109
|
-
- Export an email attachment to a local file
|
|
110
|
-
- Inputs:
|
|
111
|
-
- `uid` (number): Email UID
|
|
112
|
-
- `filePath` (string): Destination file path
|
|
113
|
-
- `attachmentIndex` (number, optional): Attachment index (default: 0)
|
|
114
|
-
- `filename` (string, optional): Match attachment by filename
|
|
115
|
-
|
|
116
|
-
- **delete_message**
|
|
117
|
-
- Delete an email by UID
|
|
118
|
-
- Inputs:
|
|
119
|
-
- `uid` (number): Email UID
|
|
120
|
-
|
|
121
|
-
- **get_unseen_messages**
|
|
122
|
-
- Get all unread emails
|
|
123
|
-
- No parameters required
|
|
124
|
-
|
|
125
|
-
- **get_recent_messages**
|
|
126
|
-
- Get recently received emails
|
|
127
|
-
- No parameters required
|
|
128
|
-
|
|
129
|
-
- **send_email**
|
|
130
|
-
- Send an email via SMTP
|
|
131
|
-
- Inputs:
|
|
132
|
-
- `to` (string, required): Recipient email address
|
|
133
|
-
- `subject` (string, required): Email subject
|
|
134
|
-
- `text` (string, optional): Plain text body
|
|
135
|
-
- `html` (string, optional): HTML body
|
|
136
|
-
- `cc` (string, optional): CC recipients
|
|
137
|
-
- `bcc` (string, optional): BCC recipients
|
|
138
|
-
- `attachments` (array, optional): File attachments
|
|
139
|
-
- `filename` (string, required): Attachment filename
|
|
140
|
-
- `content` (string, required): File content
|
|
141
|
-
- `contentType` (string, optional): MIME type
|
|
142
|
-
- `encoding` ("utf8" | "base64", optional): Content encoding (default: "utf8")
|
|
143
|
-
|
|
144
|
-
- **reply_to_email**
|
|
145
|
-
- Reply to a specific email
|
|
146
|
-
- Inputs:
|
|
147
|
-
- `originalUid` (number, required): UID of the email to reply to
|
|
148
|
-
- `text` (string, required): Reply text body
|
|
149
|
-
- `html` (string, optional): Reply HTML body
|
|
150
|
-
- `replyToAll` (boolean, optional): Reply to all recipients
|
|
151
|
-
- `includeOriginal` (boolean, optional): Include original message
|
|
152
|
-
|
|
153
21
|
## Installation
|
|
154
22
|
|
|
155
23
|
<details>
|
|
@@ -374,6 +242,60 @@ npm install -g mcp-mail-server
|
|
|
374
242
|
|
|
375
243
|
</details>
|
|
376
244
|
|
|
245
|
+
### Tools
|
|
246
|
+
|
|
247
|
+
#### Connection Management
|
|
248
|
+
|
|
249
|
+
| Tool | Description |
|
|
250
|
+
| ----------------------- | ----------------------------------------------- |
|
|
251
|
+
| `connect_all` | Connect to both IMAP and SMTP servers |
|
|
252
|
+
| `get_connection_status` | Check current connection status and server info |
|
|
253
|
+
| `disconnect_all` | Disconnect from all email servers |
|
|
254
|
+
|
|
255
|
+
#### Mailbox Management
|
|
256
|
+
|
|
257
|
+
| Tool | Description | Parameters |
|
|
258
|
+
| ---------------- | ------------------------------- | ---------------------------------------------------------------- |
|
|
259
|
+
| `open_mailbox` | Open a specific mailbox/folder | `mailboxName` (optional, default "INBOX"), `readOnly` (optional) |
|
|
260
|
+
| `list_mailboxes` | List all available mail folders | — |
|
|
261
|
+
|
|
262
|
+
#### Email Search
|
|
263
|
+
|
|
264
|
+
| Tool | Description | Parameters |
|
|
265
|
+
| ------------------------------ | -------------------------------------------- | ------------------------------------------------------ |
|
|
266
|
+
| `search_messages` | Search emails using IMAP search criteria | `criteria` (array) |
|
|
267
|
+
| `search_by_sender` | Find emails from a specific sender | `sender` |
|
|
268
|
+
| `search_by_subject` | Search emails by subject keywords | `subject` |
|
|
269
|
+
| `search_by_body` | Search within email message content | `text` |
|
|
270
|
+
| `search_since_date` | Find emails since a specific date | `date` |
|
|
271
|
+
| `search_unreplied_from_sender` | Find unreplied emails from a specific sender | `sender`, `startDate` (optional), `endDate` (optional) |
|
|
272
|
+
| `search_larger_than` | Find emails larger than a specific size | `size` (bytes) |
|
|
273
|
+
|
|
274
|
+
#### Email Reading
|
|
275
|
+
|
|
276
|
+
| Tool | Description | Parameters |
|
|
277
|
+
| --------------------- | -------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ |
|
|
278
|
+
| `get_message` | Retrieve a single email by UID | `uid`, `markSeen` (optional), `includeAttachmentContent` (optional, default `true`), `attachmentMaxBytes` (optional) |
|
|
279
|
+
| `get_messages` | Retrieve multiple emails by UIDs | `uids` (array), `markSeen` (optional), `includeAttachmentContent` (optional, default `false`), `attachmentMaxBytes` (optional) |
|
|
280
|
+
| `get_unseen_messages` | Get all unread emails | — |
|
|
281
|
+
| `get_recent_messages` | Get recently received emails | — |
|
|
282
|
+
|
|
283
|
+
> Attachment fields in message objects: `filename`, `contentType`, `size`, `contentBase64` (only when `includeAttachmentContent=true` and within size limit), `contentTruncated` (true when exceeds `attachmentMaxBytes`)
|
|
284
|
+
|
|
285
|
+
#### Attachment & Message Management
|
|
286
|
+
|
|
287
|
+
| Tool | Description | Parameters |
|
|
288
|
+
| ------------------- | ------------------------------------------ | ----------------------------------------------------------------------------------- |
|
|
289
|
+
| `export_attachment` | Export an email attachment to a local file | `uid`, `filePath`, `attachmentIndex` (optional, default `0`), `filename` (optional) |
|
|
290
|
+
| `delete_message` | Delete an email by UID | `uid` |
|
|
291
|
+
|
|
292
|
+
#### Sending & Replying
|
|
293
|
+
|
|
294
|
+
| Tool | Description | Parameters |
|
|
295
|
+
| ---------------- | ------------------------- | ------------------------------------------------------------------------------------------------------------------ |
|
|
296
|
+
| `send_email` | Send an email via SMTP | `to`, `subject`, `text` (optional), `html` (optional), `cc` (optional), `bcc` (optional), `attachments` (optional) |
|
|
297
|
+
| `reply_to_email` | Reply to a specific email | `originalUid`, `text`, `html` (optional), `replyToAll` (optional), `includeOriginal` (optional) |
|
|
298
|
+
|
|
377
299
|
## Usage Examples
|
|
378
300
|
|
|
379
301
|
Use natural language commands with your AI assistant:
|