lessie-email
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseLessie Email — Multi-Provider Email Management
Lessie Email — 多提供商邮件管理
Setup
配置
Add the Lessie Email MCP server to your MCP config (Claude Code , Cursor , Codex , etc.):
~/.claude.json~/.cursor/mcp.json~/.codex/config.tomljson
{
"mcpServers": {
"lessie-email-mcp": {
"command": "npx",
"args": ["-y", "@lessie/mcp-server"],
"env": {
"LESSIE_REMOTE_MCP_URL": "https://app.lessie.ai/email-api/mcp-public/mcp"
}
}
}
}将 Lessie Email MCP server 添加到你的 MCP 配置中(Claude Code 、Cursor 、Codex 等):
~/.claude.json~/.cursor/mcp.json~/.codex/config.tomljson
{
"mcpServers": {
"lessie-email-mcp": {
"command": "npx",
"args": ["-y", "@lessie/mcp-server"],
"env": {
"LESSIE_REMOTE_MCP_URL": "https://app.lessie.ai/email-api/mcp-public/mcp"
}
}
}
}Uninstall
卸载
Remove the entry from your MCP config and run .
"lessie-email"rm -rf ~/.lessie/从 MCP 配置中移除 条目,并运行 。
"lessie-email"rm -rf ~/.lessie/Version check
版本检查
Run this check once at the start of each session. Non-blocking — if any command fails, skip silently.
- Read current local version from this file's metadata field above.
version - Fetch remote version:
bash
curl -sf --max-time 5 https://raw.githubusercontent.com/LessieAI/lessie-skill/main/lessie-email/SKILL.md | head -5 | grep 'version:' | head -1 | awk '{print $2}' - If the remote version is newer → tell the user:
⬆️ A newer version of lessie-email skill is available ({current} → {remote}). Run this command to update:
npx skills add LessieAI/lessie-skill -y -g - If versions match or check fails → skip, say nothing.
每个会话开始时运行一次此检查。此检查不会阻塞——如果任何命令失败,则静默跳过。
- 从此文件上方的元数据 字段读取当前本地版本。
version - 获取远程版本:
bash
curl -sf --max-time 5 https://raw.githubusercontent.com/LessieAI/lessie-skill/main/lessie-email/SKILL.md | head -5 | grep 'version:' | head -1 | awk '{print $2}' - 如果远程版本更新 → 告知用户:
⬆️ lessie-email skill 有可用更新({current} → {remote})。运行以下命令进行更新:
npx skills add LessieAI/lessie-skill -y -g - 如果版本一致或检查失败 → 跳过,不作说明。
Authorization
授权
- Directly call to perform the desired action — skip authorization if already connected.
use_lessie - If fails (e.g., returns "not authorized" or "remote MCP server not connected") → call
use_lessieto start the OAuth flow:authorize- returns an authorization URL. Tell the user you need to open a browser for Lessie login/registration, and open it using the appropriate system command:
authorize- macOS:
open "<url>" - Linux:
xdg-open "<url>" - Windows:
start "<url>"
- macOS:
- Tell the user the browser has been opened and they need to complete login/registration.
- After the user confirms, call again to verify the connection.
authorize - If authorization fails (timeout, denied, port conflict), follow the diagnostic hints returned by and retry.
authorize
- After authorization succeeds → retry the original call.
use_lessie
- 直接调用 执行所需操作——如果已经连接,则跳过授权。
use_lessie - 如果 调用失败(例如返回
use_lessie或not authorized)→ 调用remote MCP server not connected启动 OAuth 流程:authorize- 返回授权 URL。告知用户需要打开浏览器进行 Lessie 登录/注册,并使用相应的系统命令打开:
authorize- macOS:
open "<url>" - Linux:
xdg-open "<url>" - Windows:
start "<url>"
- macOS:
- 告知用户浏览器已打开,用户需要完成登录/注册。
- 用户确认后,再次调用 验证连接。
authorize - 如果授权失败(超时、拒绝或端口冲突),按照 返回的诊断提示进行排查并重试。
authorize
- 授权成功后 → 重试原始 调用。
use_lessie
Troubleshooting: Authorization repeatedly fails
故障排除:授权反复失败
Root cause: stale processes from old sessions occupy the callback port (19836), forcing port fallback and corrupting OAuth client state.
lessie-mcp-serverFix — kill stale processes and clear storage, then re-authorize:
bash
ps aux | grep 'lessie-mcp-server' | grep -v grep | awk '{print $2}' | xargs kill 2>/dev/null
rm -rf ~/.lessie/
lsof -i :19836 | grep LISTEN # should return nothingAlways inform the user before opening the browser — never silently redirect.
根本原因:旧会话遗留的 进程占用了回调端口(19836),导致端口回退并破坏 OAuth 客户端状态。
lessie-mcp-server修复方法——终止陈旧进程并清除存储,然后重新授权:
bash
ps aux | grep 'lessie-mcp-server' | grep -v grep | awk '{print $2}' | xargs kill 2>/dev/null
rm -rf ~/.lessie/
lsof -i :19836 | grep LISTEN # 应无任何输出打开浏览器前务必告知用户——绝不静默重定向。
Quick start
快速开始
After setup, try:
- "Show me my email accounts and unread counts"
- "Send an email from alice@company.com to bob@example.com about the Q2 report"
- "List my recent email threads"
- "Create a bulk email campaign to these 50 contacts"
- "Draft an email to the engineering team about the sprint review"
- "Mark all emails in this thread as read"
完成设置后,可以尝试:
- “显示我的邮箱账户和未读数量”
- “从 alice@company.com 发送一封关于 Q2 report 的邮件给 bob@example.com”
- “列出我最近的邮件会话”
- “为这 50 位联系人创建批量邮件活动”
- “起草一封关于 sprint review 的邮件发给工程团队”
- “将此会话中的所有邮件标记为已读”
Tools overview
工具概览
Email Accounts
邮箱账户
| Tool | When to use |
|---|---|
| View all linked email accounts with unread counts |
| 工具 | 使用场景 |
|---|---|
| 查看所有已关联的邮箱账户及未读数量 |
Email Operations
邮件操作
| Tool | When to use |
|---|---|
| Send an email (supports HTML, CC/BCC, attachments, replies) |
| View full email details (content, delivery status, read status) |
| Browse sent emails with cursor pagination |
| Check daily sending quota for a specific email address |
| Soft-delete an email |
| Mark an email as read or unread |
| 工具 | 使用场景 |
|---|---|
| 发送邮件(支持 HTML、CC/BCC、附件、回复) |
| 查看邮件完整详情(内容、投递状态、已读状态) |
| 使用 cursor 分页浏览已发送邮件 |
| 检查特定邮箱地址的每日发送配额 |
| 软删除邮件 |
| 将邮件标记为已读或未读 |
Thread Management
会话管理
| Tool | When to use |
|---|---|
| Browse email conversations (all/read/unread filtering) |
| View all messages in a conversation thread |
| Soft-delete an entire conversation thread |
| Mark all emails in a thread as read or unread |
| 工具 | 使用场景 |
|---|---|
| 浏览邮件会话(可筛选全部/已读/未读) |
| 查看某个会话线程中的所有邮件 |
| 软删除整个会话线程 |
| 将线程中的所有邮件标记为已读或未读 |
Drafts
草稿
| Tool | When to use |
|---|---|
| Create a new email draft |
| Update an existing draft (subject, content, recipients, etc.) |
| Delete a draft |
| Browse drafts with cursor pagination |
| 工具 | 使用场景 |
|---|---|
| 创建新邮件草稿 |
| 更新现有草稿(主题、内容、收件人等) |
| 删除草稿 |
| 使用 cursor 分页浏览草稿 |
Bulk Email Tasks
批量邮件任务
| Tool | When to use |
|---|---|
| Create a bulk email send task (auto-schedules per recipient) |
| Browse bulk tasks with progress info |
| View task details with delivery/open/fail stats per recipient |
| Delete a bulk email task |
| Pause a running bulk email task |
| Resume a paused bulk email task |
| 工具 | 使用场景 |
|---|---|
| 创建批量发送任务(按接收者自动调度发送) |
| 浏览批量任务及进度信息 |
| 查看任务详情,包括每位接收者的投递/打开/失败统计 |
| 删除批量邮件任务 |
| 暂停正在运行的批量邮件任务 |
| 恢复已暂停的批量邮件任务 |
Agent behavior rules
Agent 行为规则
Before sending emails
发送邮件前
- Always check accounts first: Call to get available sender addresses.
list_email_accounts_with_unread - No email accounts bound: If the account list is empty, tell the user they have no email accounts linked yet and guide them to visit https://app.lessie.ai/ to bind an email account. Open the URL using the appropriate system command:
- macOS:
open "https://app.lessie.ai/" - Linux:
xdg-open "https://app.lessie.ai/" - Windows: Then ask the user to return after binding and retry.
start "https://app.lessie.ai/"
- macOS:
- Always check quota: Call for the chosen sender to confirm quota is sufficient.
get_email_quota - Never guess email addresses: Only use addresses returned by the account list.
- 务必先检查账户:调用 获取可用的发件地址。
list_email_accounts_with_unread - 未绑定邮箱账户:如果账户列表为空,告诉用户尚未绑定任何邮箱账户,并引导其访问 https://app.lessie.ai/ 绑定邮箱账户。使用相应的系统命令打开该 URL:
- macOS:
open "https://app.lessie.ai/" - Linux:
xdg-open "https://app.lessie.ai/" - Windows: 然后请用户绑定完成后返回并重试。
start "https://app.lessie.ai/"
- macOS:
- 务必检查配额:为选定的发件人调用 ,确认配额充足。
get_email_quota - 绝不猜测邮箱地址:只能使用账户列表返回的地址。
Replying to emails
回复邮件时
- Get the thread context: call to see the conversation.
get_thread_messages - Use the and
thread_idfrom the last message.reply_to_message_id - Pass both when calling for a proper threaded reply.
send_email
- 获取线程上下文:调用 查看会话内容。
get_thread_messages - 使用最后一条邮件中的 和
thread_id。reply_to_message_id - 调用 时同时传入二者,以确保回复正确的会话线程。
send_email
Draft workflow
草稿流程
- Create a draft with — specify sender, recipients, subject, and content.
create_draft - Update the draft with if changes are needed.
update_draft - When ready, use with the finalized content (drafts are not sent directly).
send_email - Delete the draft with after sending or if no longer needed.
delete_draft
- 使用 创建草稿——指定发件人、收件人、主题和内容。
create_draft - 如需修改,使用 更新草稿。
update_draft - 准备就绪后,使用 发送最终内容(草稿不会直接发送)。
send_email - 发送后或不再需要时,使用 删除草稿。
delete_draft
Bulk task management
批量任务管理
- After creating a task with , monitor progress with
create_task.get_task_detail - Use to temporarily halt a running campaign (e.g., if issues are found).
pause_task - Use to continue a paused campaign.
resume_task - Use to permanently remove a task.
delete_task
- 使用 创建任务后,通过
create_task监控进度。get_task_detail - 使用 临时停止正在运行的活动(例如发现问题时)。
pause_task - 使用 继续已暂停的活动。
resume_task - 使用 永久移除任务。
delete_task
Gmail/Outlook specific
Gmail/Outlook 专属规则
- When calling ,
get_email_detail,delete_emailfor Gmail/Outlook accounts, always pass theget_thread_messagesparameter.email - The system auto-routes to the correct provider API based on the email address.
- 为 Gmail/Outlook 账户调用 、
get_email_detail、delete_email时,始终传入get_thread_messages参数。email - 系统会根据邮箱地址自动将请求路由到正确的提供商 API。
Key constraints
关键约束
- Cursor pagination: all list endpoints use +
cursor— passsizefrom previous response.next_cursor - Default page size: 20 (max 100).
- Email content: provide at least or
text_content— if only text is provided, HTML is auto-generated.html_content - Attachments require pre-uploaded S3 keys with ,
s3key,filename,mime_type.size - Bulk tasks auto-schedule sends across time to respect quotas and avoid spam.
- Cursor 分页:所有列表端点都使用 +
cursor——传入上一次响应中的size。next_cursor - 默认页面大小:20(最大 100)。
- 邮件内容:至少提供 或
text_content——如果只提供文本,系统会自动生成 HTML。html_content - 附件需要预先上传的 S3 key,并提供 、
s3key、filename、mime_type。size - 批量任务会跨时段自动调度发送,以遵守配额并避免垃圾邮件。