Email (IMAP/SMTP)

io.github.mindstone由 GitHub 帳號 mindstone 發布v0.3.2更新於 Oct 24, 2026

Email IMAP/SMTP MCP server: iCloud, Gmail, Yahoo, Outlook, and custom IMAP providers

已驗證STDIO僅桌面效率與工作流溝通與協作

概覽

AI 產生的概覽

本機 MCP 伺服器,讓助理透過 IMAP/SMTP 連接信箱,在 iCloud、Gmail、Yahoo、Outlook 或自訂服務商上讀取、搜尋、起草、寄送與管理郵件

可以做什麼
列出信箱資料夾、查看狀態,並建立、重新命名或刪除資料夾(INBOX 無法重新命名)。依寄件者、主旨、未讀狀態與日期搜尋郵件,讀取完整內容,並把附件下載到工作區沙箱。移動、刪除郵件以及設定或取消標記,有垃圾桶時優先移入垃圾桶。儲存、列出、更新與刪除草稿,支援附件。寄送新郵件或回覆,受收件人與頻率上限約束。
適用情境
適合讓助理整理收件匣、尋找並摘要郵件、取出附件,或透過現有信箱準備與寄送回覆,而不必另外串接郵件軟體。
執行需求
透過 npx 在本機執行,需要 Node.js 20+ 與 npm。需要 EMAIL_IMAP_EMAIL 以及放在 EMAIL_IMAP_PASSWORD 的應用程式專用密碼。服務商可由網域自動辨識,或以 EMAIL_IMAP_PROVIDER 指定;自訂服務商需設定 IMAP/SMTP 主機與連接埠變數。需要能連線到郵件伺服器的網路。
安裝前請注意
密碼是真實的信箱憑證,應使用應用程式專用密碼而非主帳號密碼。寄送、草稿、資料夾變更、移動、刪除與標記修改都會改動遠端帳號,部分刪除是永久的。郵件內容不可信,可能夾帶提示注入文字,因此每次寄送與破壞性操作都應由你確認;收件人與頻率上限只是防護措施,並非保證。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Email (IMAP/SMTP),將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

@mindstone/mcp-server-email-imap

[npm version] [License: FSL-1.1-MIT]

Email IMAP/SMTP MCP server for Model Context Protocol hosts. Read, search, send, and manage emails through IMAP and SMTP — supports iCloud Mail, Gmail, Yahoo Mail, Outlook / Microsoft 365, and custom IMAP providers.

Status

Requirements

  • Node.js 20+
  • npm

One-click install

[Add to Cursor] [Add to VS Code] [Add to VS Code Insiders]

After clicking the button, your host will prompt you to fill: EMAIL_IMAP_EMAIL, EMAIL_IMAP_PASSWORD, EMAIL_IMAP_IMAP_PORT, EMAIL_IMAP_SMTP_PORT, EMAIL_IMAP_MAX_RECIPIENTS, EMAIL_IMAP_RATE_LIMIT_PER_HOUR, EMAIL_IMAP_RATE_LIMIT_WINDOW_MS.

Manual config for Claude Desktop / Claude Code / Goose / Continue.dev (Email (IMAP/SMTP))
json
{  "mcpServers": {    "Email (IMAP/SMTP)": {      "command": "npx",      "args": [        "-y",        "@mindstone/mcp-server-email-imap"      ],      "env": {        "EMAIL_IMAP_EMAIL": "",        "EMAIL_IMAP_PASSWORD": "",        "EMAIL_IMAP_IMAP_PORT": "993",        "EMAIL_IMAP_SMTP_PORT": "587",        "EMAIL_IMAP_MAX_RECIPIENTS": "25",        "EMAIL_IMAP_RATE_LIMIT_PER_HOUR": "50",        "EMAIL_IMAP_RATE_LIMIT_WINDOW_MS": "3600000"      }    }  }}

Quick Start

Install & build

bash
cd <path-to-repo>/connectors/email-imapnpm installnpm run build

npx (once published)

bash
npx -y @mindstone/mcp-server-email-imap

Local

bash
node dist/index.js

Configuration

Environment variables

  • EMAIL_IMAP_EMAIL — email address
  • EMAIL_IMAP_PASSWORD — app-specific password
  • EMAIL_IMAP_PROVIDER — email provider (icloud, gmail, yahoo, outlook, or custom). When unset, the connector auto-detects the provider from the email's domain (e.g. @gmail.com → gmail, @icloud.com → icloud, @outlook.com → outlook, @yahoo.co.uk → yahoo). If the domain is not recognised, the connector refuses to start with a clear error — it will not silently fall back to a default provider.
  • EMAIL_IMAP_IMAP_HOST — custom IMAP host (optional, for custom providers)
  • EMAIL_IMAP_SMTP_HOST — custom SMTP host (optional, for custom providers)
  • EMAIL_IMAP_IMAP_PORT — custom IMAP port (default: 993). Cleartext ports (imap_port=143, smtp_port=25) are allowed when configured — your host owns the plaintext decision.
  • EMAIL_IMAP_SMTP_PORT — custom SMTP port (default: 587)
  • MCP_WORKSPACE_PATH — workspace directory used for attachment file I/O. email_get_attachment downloads into a fresh, private email-imap-attachment-* staging directory created directly under this path (the returned path points there), and outbound attachments on email_send / email_save_draft / email_update_draft may only be read from inside it (paths outside — including via symlinks — are refused). Successful downloads keep their staging directory (it is the container of the returned file); accumulated email-imap-attachment-* directories are safe to delete once the files are no longer needed. Defaults to the system temp directory when unset.
  • MCP_HOST_BRIDGE_STATE — optional path to a host bridge state file used for credential management
  • MINDSTONE_REBEL_BRIDGE_STATE — backwards-compatible alias for MCP_HOST_BRIDGE_STATE
Send-side caps (email_send)

These caps act as blast-radius circuit breakers against prompt-injection-driven mass sends. Defaults are baked into the source so a host that sets none of these still gets safe behaviour. Hosts can tighten them per deployment.

  • EMAIL_IMAP_MAX_RECIPIENTS — maximum combined To+CC+BCC recipients per email_send call (default: 25). Exceeding this returns a structured error with code: "RECIPIENT_LIMIT_EXCEEDED".
  • EMAIL_IMAP_RATE_LIMIT_PER_HOUR — maximum number of email_send calls per rolling window (default: 50). Exceeding this returns a structured error with code: "RATE_LIMIT_EXCEEDED", plus resetAt (ISO-8601) and retryAfterMs so the host/LLM can back off.
  • EMAIL_IMAP_RATE_LIMIT_WINDOW_MS — sliding-window length, in milliseconds, for the rate limit (default: 3600000 — one hour).

Host configuration examples

Claude Desktop / Cursor

json
{  "mcpServers": {    "Email": {      "command": "npx",      "args": ["-y", "@mindstone/mcp-server-email-imap"],      "env": {        "EMAIL_IMAP_EMAIL": "[email protected]",        "EMAIL_IMAP_PASSWORD": "your-app-specific-password",        "EMAIL_IMAP_PROVIDER": "icloud"      }    }  }}

Local development (no npm publish needed)

json
{  "mcpServers": {    "Email": {      "command": "node",      "args": ["<path-to-repo>/connectors/email-imap/dist/index.js"],      "env": {        "EMAIL_IMAP_EMAIL": "[email protected]",        "EMAIL_IMAP_PASSWORD": "your-app-specific-password",        "EMAIL_IMAP_PROVIDER": "icloud"      }    }  }}

Security: host confirmation required for email_send

email_send is a destructive, open-world action: it dispatches mail to arbitrary external recipients on the user's behalf. The tool is annotated with destructiveHint: true and openWorldHint: true accordingly.

Hosts MUST require explicit user confirmation before each email_send invocation. A user-confirmation gate is the only reliable defence against prompt-injection content (e.g., text inside an email_get_message body) coercing the LLM into sending mail without the user's intent. Do not auto-approve email_send based on tool annotations alone — surface the full recipient list, subject, and body to the user and require an affirmative click/keystroke before forwarding the call to the connector.

The connector additionally enforces:

  • A combined To+CC+BCC recipient cap (EMAIL_IMAP_MAX_RECIPIENTS, default 25).
  • A per-process rolling rate limit (EMAIL_IMAP_RATE_LIMIT_PER_HOUR / EMAIL_IMAP_RATE_LIMIT_WINDOW_MS, defaults 50 / 3600000ms).

When either cap is exceeded the tool returns a structured error JSON ({ ok: false, code: "RECIPIENT_LIMIT_EXCEEDED" | "RATE_LIMIT_EXCEEDED", … }) without contacting the SMTP transport. Caps are env-tunable but defaults are baked into the source — hosts do not need to set any env var to get safe behaviour.

Security: untrusted-content envelopes and destructive tools

Every attacker-controlled text field the connector returns — message bodies, subjects, from/to display names, Message-IDs, attachment filenames, MIME content types and part identifiers, mailbox names and special-use values, message flag keywords (writable via email_set_flags, where keywords must match a conservative charset allowlist — letters, digits, _, $, ., - with an optional leading \ — so atom-specials like spaces, parens, quotes or CR/LF can never reach the IMAP command), draft summaries, and error text originating from the IMAP/SMTP server or vendor SDKs — is wrapped in an <untrusted-content …>…</untrusted-content> envelope (with close-tag breakout escaping) so the host LLM treats it as data, not instructions. Tools that consume a previously returned value (mailbox, part, mailbox names, flag keywords) accept the enveloped form as-is and strip one envelope layer on input.

Beyond email_send, the tools annotated destructiveHint: true are email_save_draft, email_update_draft (replaces and expunges the old draft), email_create_mailbox, email_rename_mailbox, email_delete (permanent when no Trash mailbox exists; aborts with a TRASH_MOVE_FAILED error — leaving the messages in place — when the move to Trash fails, rather than silently escalating to a permanent expunge), email_move_messages (its fallback permanently expunges the source messages, and only after the copy to the destination is verified complete for every UID — otherwise it aborts with a MOVE_COPY_UNVERIFIED error), email_set_flags (\Deleted marks messages for permanent expunge on mailbox close), email_delete_draft (always permanent), and email_delete_mailbox (removes the folder and all messages inside it). Hosts should gate these behind the same explicit user confirmation as email_send.

Tools (17)

Configuration

  • configure_email_imap — Configure email account credentials and provider

Mailbox

  • email_list_mailboxes — List all email folders/mailboxes with message counts
  • email_get_mailbox_status — Get mailbox status with unread count and latest subjects
  • email_create_mailbox — Create a new mailbox/folder (destructive)
  • email_rename_mailbox — Rename a mailbox/folder (INBOX cannot be renamed; destructive)
  • email_delete_mailbox — Permanently delete a mailbox/folder and its contents (destructive)

Messages

  • email_search_messages — Search emails with sender/subject/unread filters, since/before date filters, and before_uid cursor pagination (returns at most 50 messages when limit is omitted; hasMore: true signals more results)
  • email_get_message — Get full email content by UID (bodies, subjects, addresses, Message-ID, and attachment filenames/MIME metadata are returned inside <untrusted-content> envelopes)
  • email_get_attachment — Download an attachment into the workspace sandbox (see MCP_WORKSPACE_PATH); writes are exclusive-create, so existing files are never overwritten
  • email_move_messages — Move emails between folders (fallback expunge of the source is gated on a verified-complete copy; destructive)
  • email_delete — Delete emails (moves to Trash when one exists, otherwise expunges permanently; aborts with an error if the Trash move fails; destructive)
  • email_set_flags — Set or remove flags (read, starred) on messages (flag keywords are returned enveloped and must match a charset allowlist on input; destructive)

Drafts

  • email_save_draft — Save a draft email (supports attachments; mutates the remote account — destructive)
  • email_list_drafts — List drafts in the Drafts mailbox (at most 50 per call; hasMore: true signals more drafts)
  • email_update_draft — Replace a draft's content (the new version is saved before the old one is removed; destructive)
  • email_delete_draft — Permanently delete a draft (destructive)

Send

  • email_send — Send an email or reply (supports attachments)

Licence

FSL-1.1-MIT — Functional Source License, Version 1.1, with MIT future licence. The software converts to MIT licence on 2030-04-08.

來源:connectors/email-imap/README.md,提交 22c4611

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v0.3.2最新Sep 16, 2026

評分

已滿足適用檢查項的 40%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分

    請在儲存庫或註冊中心條目中宣告授權條款。