You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
2. Send your reply using `in_reply_to` and `references`:
206
+
207
+
```python
208
+
await send_email(
209
+
account_name="work",
210
+
recipients=[original.sender],
211
+
subject=f"Re: {original.subject}",
212
+
body="Thank you for your email...",
213
+
in_reply_to=original.message_id,
214
+
references=original.message_id,
215
+
)
216
+
```
217
+
218
+
The `in_reply_to` parameter sets the `In-Reply-To` header, and `references` sets the `References` header. Both are used by email clients to thread conversations properly.
219
+
192
220
## Development
193
221
194
222
This project is managed using [uv](https://github.com/ai-zerolab/uv).
Copy file name to clipboardExpand all lines: mcp_email_server/app.py
+26-2Lines changed: 26 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -103,7 +103,7 @@ async def get_emails_content(
103
103
104
104
105
105
@mcp.tool(
106
-
description="Send an email using the specified account. Recipient should be a list of email addresses. Optionally attach files by providing their absolute paths.",
106
+
description="Send an email using the specified account. Supports replying to emails with proper threading when in_reply_to is provided.",
107
107
)
108
108
asyncdefsend_email(
109
109
account_name: Annotated[str, Field(description="The name of the email account to send from.")],
@@ -129,9 +129,33 @@ async def send_email(
129
129
description="A list of absolute file paths to attach to the email. Supports common file types (documents, images, archives, etc.).",
130
130
),
131
131
] =None,
132
+
in_reply_to: Annotated[
133
+
str|None,
134
+
Field(
135
+
default=None,
136
+
description="Message-ID of the email being replied to. Enables proper threading in email clients.",
137
+
),
138
+
] =None,
139
+
references: Annotated[
140
+
str|None,
141
+
Field(
142
+
default=None,
143
+
description="Space-separated Message-IDs for the thread chain. Usually includes in_reply_to plus ancestors.",
0 commit comments