lessie-email

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Lessie Email — Multi-Provider Email Management

Lessie Email — 多提供商邮件管理

Setup

配置

Add the Lessie Email MCP server to your MCP config (Claude Code
~/.claude.json
, Cursor
~/.cursor/mcp.json
, Codex
~/.codex/config.toml
, etc.):
json
{
  "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
~/.claude.json
、Cursor
~/.cursor/mcp.json
、Codex
~/.codex/config.toml
等):
json
{
  "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
"lessie-email"
entry from your MCP config and run
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.
  1. Read current local version from this file's metadata
    version
    field above.
  2. 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}'
  3. 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
  4. If versions match or check fails → skip, say nothing.
每个会话开始时运行一次此检查。此检查不会阻塞——如果任何命令失败,则静默跳过。
  1. 从此文件上方的元数据
    version
    字段读取当前本地版本。
  2. 获取远程版本:
    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}'
  3. 如果远程版本更新 → 告知用户:
    ⬆️ lessie-email skill 有可用更新({current} → {remote})。运行以下命令进行更新:
    npx skills add LessieAI/lessie-skill -y -g
  4. 如果版本一致或检查失败 → 跳过,不作说明。

Authorization

授权

  1. Directly call
    use_lessie
    to perform the desired action — skip authorization if already connected.
  2. If
    use_lessie
    fails
    (e.g., returns "not authorized" or "remote MCP server not connected") → call
    authorize
    to 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:
      • macOS:
        open "<url>"
      • Linux:
        xdg-open "<url>"
      • Windows:
        start "<url>"
    • Tell the user the browser has been opened and they need to complete login/registration.
    • After the user confirms, call
      authorize
      again to verify the connection.
    • If authorization fails (timeout, denied, port conflict), follow the diagnostic hints returned by
      authorize
      and retry.
  3. After authorization succeeds → retry the original
    use_lessie
    call.
  1. 直接调用
    use_lessie
    执行所需操作——如果已经连接,则跳过授权。
  2. 如果
    use_lessie
    调用失败
    (例如返回
    not authorized
    或
    remote MCP server not connected
    )→ 调用
    authorize
    启动 OAuth 流程:
    • authorize
      返回授权 URL。告知用户需要打开浏览器进行 Lessie 登录/注册,并使用相应的系统命令打开:
      • macOS:
        open "<url>"
      • Linux:
        xdg-open "<url>"
      • Windows:
        start "<url>"
    • 告知用户浏览器已打开,用户需要完成登录/注册。
    • 用户确认后,再次调用
      authorize
      验证连接。
    • 如果授权失败(超时、拒绝或端口冲突),按照
      authorize
      返回的诊断提示进行排查并重试。
  3. 授权成功后 → 重试原始
    use_lessie
    调用。

Troubleshooting: Authorization repeatedly fails

故障排除:授权反复失败

Root cause: stale
lessie-mcp-server
processes from old sessions occupy the callback port (19836), forcing port fallback and corrupting OAuth client state.
Fix — 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 nothing
Always inform the user before opening the browser — never silently redirect.
根本原因:旧会话遗留的
lessie-mcp-server
进程占用了回调端口(19836),导致端口回退并破坏 OAuth 客户端状态。
修复方法——终止陈旧进程并清除存储,然后重新授权:
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

邮箱账户

ToolWhen to use
list_email_accounts_with_unread
View all linked email accounts with unread counts
工具使用场景
list_email_accounts_with_unread
查看所有已关联的邮箱账户及未读数量

Email Operations

邮件操作

ToolWhen to use
send_email
Send an email (supports HTML, CC/BCC, attachments, replies)
get_email_detail
View full email details (content, delivery status, read status)
list_sent_emails
Browse sent emails with cursor pagination
get_email_quota
Check daily sending quota for a specific email address
delete_email
Soft-delete an email
set_email_read_status
Mark an email as read or unread
工具使用场景
send_email
发送邮件(支持 HTML、CC/BCC、附件、回复)
get_email_detail
查看邮件完整详情(内容、投递状态、已读状态)
list_sent_emails
使用 cursor 分页浏览已发送邮件
get_email_quota
检查特定邮箱地址的每日发送配额
delete_email
软删除邮件
set_email_read_status
将邮件标记为已读或未读

Thread Management

会话管理

ToolWhen to use
list_threads
Browse email conversations (all/read/unread filtering)
get_thread_messages
View all messages in a conversation thread
delete_thread
Soft-delete an entire conversation thread
set_thread_read_status
Mark all emails in a thread as read or unread
工具使用场景
list_threads
浏览邮件会话(可筛选全部/已读/未读)
get_thread_messages
查看某个会话线程中的所有邮件
delete_thread
软删除整个会话线程
set_thread_read_status
将线程中的所有邮件标记为已读或未读

Drafts

草稿

ToolWhen to use
create_draft
Create a new email draft
update_draft
Update an existing draft (subject, content, recipients, etc.)
delete_draft
Delete a draft
list_drafts
Browse drafts with cursor pagination
工具使用场景
create_draft
创建新邮件草稿
update_draft
更新现有草稿(主题、内容、收件人等)
delete_draft
删除草稿
list_drafts
使用 cursor 分页浏览草稿

Bulk Email Tasks

批量邮件任务

ToolWhen to use
create_task
Create a bulk email send task (auto-schedules per recipient)
list_tasks
Browse bulk tasks with progress info
get_task_detail
View task details with delivery/open/fail stats per recipient
delete_task
Delete a bulk email task
pause_task
Pause a running bulk email task
resume_task
Resume a paused bulk email task
工具使用场景
create_task
创建批量发送任务(按接收者自动调度发送)
list_tasks
浏览批量任务及进度信息
get_task_detail
查看任务详情,包括每位接收者的投递/打开/失败统计
delete_task
删除批量邮件任务
pause_task
暂停正在运行的批量邮件任务
resume_task
恢复已暂停的批量邮件任务

Agent behavior rules

Agent 行为规则

Before sending emails

发送邮件前

  1. Always check accounts first: Call
    list_email_accounts_with_unread
    to get available sender addresses.
  2. 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:
      start "https://app.lessie.ai/"
      Then ask the user to return after binding and retry.
  3. Always check quota: Call
    get_email_quota
    for the chosen sender to confirm quota is sufficient.
  4. Never guess email addresses: Only use addresses returned by the account list.
  1. 务必先检查账户:调用
    list_email_accounts_with_unread
    获取可用的发件地址。
  2. 未绑定邮箱账户:如果账户列表为空,告诉用户尚未绑定任何邮箱账户,并引导其访问 https://app.lessie.ai/ 绑定邮箱账户。使用相应的系统命令打开该 URL:
    • macOS:
      open "https://app.lessie.ai/"
    • Linux:
      xdg-open "https://app.lessie.ai/"
    • Windows:
      start "https://app.lessie.ai/"
      然后请用户绑定完成后返回并重试。
  3. 务必检查配额:为选定的发件人调用
    get_email_quota
    ,确认配额充足。
  4. 绝不猜测邮箱地址:只能使用账户列表返回的地址。

Replying to emails

回复邮件时

  1. Get the thread context: call
    get_thread_messages
    to see the conversation.
  2. Use the
    thread_id
    and
    reply_to_message_id
    from the last message.
  3. Pass both when calling
    send_email
    for a proper threaded reply.
  1. 获取线程上下文:调用
    get_thread_messages
    查看会话内容。
  2. 使用最后一条邮件中的
    thread_id
    和
    reply_to_message_id
    。
  3. 调用
    send_email
    时同时传入二者,以确保回复正确的会话线程。

Draft workflow

草稿流程

  1. Create a draft with
    create_draft
    — specify sender, recipients, subject, and content.
  2. Update the draft with
    update_draft
    if changes are needed.
  3. When ready, use
    send_email
    with the finalized content (drafts are not sent directly).
  4. Delete the draft with
    delete_draft
    after sending or if no longer needed.
  1. 使用
    create_draft
    创建草稿——指定发件人、收件人、主题和内容。
  2. 如需修改,使用
    update_draft
    更新草稿。
  3. 准备就绪后,使用
    send_email
    发送最终内容(草稿不会直接发送)。
  4. 发送后或不再需要时,使用
    delete_draft
    删除草稿。

Bulk task management

批量任务管理

  • After creating a task with
    create_task
    , monitor progress with
    get_task_detail
    .
  • Use
    pause_task
    to temporarily halt a running campaign (e.g., if issues are found).
  • Use
    resume_task
    to continue a paused campaign.
  • Use
    delete_task
    to permanently remove a task.
  • 使用
    create_task
    创建任务后,通过
    get_task_detail
    监控进度。
  • 使用
    pause_task
    临时停止正在运行的活动(例如发现问题时)。
  • 使用
    resume_task
    继续已暂停的活动。
  • 使用
    delete_task
    永久移除任务。

Gmail/Outlook specific

Gmail/Outlook 专属规则

  • When calling
    get_email_detail
    ,
    delete_email
    ,
    get_thread_messages
    for Gmail/Outlook accounts, always pass the
    email
    parameter.
  • 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
    +
    size
    — pass
    next_cursor
    from previous response.
  • Default page size: 20 (max 100).
  • Email content: provide at least
    text_content
    or
    html_content
    — if only text is provided, HTML is auto-generated.
  • 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_content
    ——如果只提供文本,系统会自动生成 HTML。
  • 附件需要预先上传的 S3 key,并提供
    s3key
    、
    filename
    、
    mime_type
    、
    size
    。
  • 批量任务会跨时段自动调度发送,以遵守配额并避免垃圾邮件。