mail-mcp
mail-mcp
基于 davidvornholt/standards 构建。
一款面向 Thunderbird 工作流的“仅草稿”IMAP 辅助工具。它建在一个共享的 Effect 核心之上,既可以作为 MCP 服务器 提供给 Codex、Claude 及其他兼容客户端使用,也可以作为 mail CLI 供你自己使用。通过 MCP 服务器,它可以搜索和读取邮件及收到的附件,并创建、更新或删除带 HTML 和附件的草稿;mail CLI 则涵盖登录、状态、文件夹/搜索/读取,以及纯文本草稿创建。它不能发送邮件:草稿会同步到 Thunderbird 中,供你审核后再发送。
目录结构
apps/mail the application (MCP server + CLI)
src/app entrypoints: server.ts (MCP, stdio), cli.ts (the `mail` bin)
src/features/mail schemas, tagged errors, and Effect services (config, secrets, status, IMAP, draft, login)
src/shared app-local infrastructure (arg parsing, hidden-input terminal prompt)
packages/* canonical shared config synced from the standards template工具列表、配置和密钥处理请参见 apps/mail/README.md。
Related MCP server: imap-mcp
设置
bun install
# put the `mail` command on your PATH (one-time; links the app's bin into
# ~/.bun/bin). After this, run `mail …` from anywhere.
bun link --cwd apps/mail
# configure your accounts (non-secret: addresses, IMAP hosts, and ports). The real
# file is git-ignored so your addresses never land in git.
cp apps/mail/accounts.example.toml apps/mail/accounts.toml
# …edit apps/mail/accounts.toml…
# verify every account's password against IMAP, then store each in the OS keyring
# (hidden prompts — nothing is echoed or written to disk). Run this yourself;
# the secrets never leave your machine.
mail login
# confirm each account authenticates cleanly (or shows what still needs a login)
mail status向 Codex 注册 MCP 服务器:
codex mcp add mail -- bun run <repo>/apps/mail/src/app/server.ts
codex mcp get mailCodex 会对 MCP 工具的引入进行推迟,直到它与任务相关时才实际加载,因此注册服务器并不会把每个邮件工具的 schema 都急切地塞进模型上下文。添加该服务器后,请重启 Codex,再通过 /mcp 查看已连接的服务器。
如果需要显式的写操作审批,并为 IMAP 操作留出更大的余量,请编辑 ~/.codex/config.toml 中生成的条目:
[mcp_servers.mail]
command = "bun"
args = ["run", "<repo>/apps/mail/src/app/server.ts"]
startup_timeout_sec = 15
tool_timeout_sec = 120
default_tools_approval_mode = "writes"
[mcp_servers.mail.tools.delete_draft]
approval_mode = "prompt"对于 Claude Code(用户作用域)环境,请使用:
claude mcp add --scope user mail -- bun run <repo>/apps/mail/src/app/server.ts存储好密码后,你可以让 MCP 客户端去搜索你的邮件或撰写草稿;也可以自己跑这套“审阅优先”的 CLI:
mail search invoice
mail search --account you@example.com invoice省略 --account 时,会搜索所有已配置的账户,对结果进行合并去重,并在全局应用限制。传入 --account <email> 则只搜索该账户。每条结果都会说明它所属的账户,单个账户的失败也会与部分结果一并报告。如果所有账户都失败了,该命令只会报出所有账户的错误。
文件夹搜索是分账户的:要用一个精确文件夹时,直接用 mail search --account you@example.com --scope folder --folder INBOX ...;要搜某个文件夹及其所有子文件夹,则用 --scope subtree --subFolder Folders。
如果还没立好全局命令,也可以像这样使用:bun run apps/mail/src/app/cli.ts <args>。
环境要求
Bun(参见
package.json中的packageManager)。一个正在运行并且锁定已解锁的 Secret Service 服务(如 gnome-keyring),用于系统钥匙串。
质量门槛
bun run check 会在每个 workspace 中依次运行标准漂移检查、lint、类型检查、测试、构建和可访问性(a11y)。工作完成前它必须通过,否则不算定稿完成。
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- FlicenseAqualityBmaintenanceA lightweight MCP server for interacting with IMAP email accounts to read messages, manage folders, and compose draft replies. It supports standard providers and local bridges, providing tools for searching, fetching attachments, and organizing mailboxes without the ability to send or delete emails.197
- FlicenseNot gradedqualityDmaintenanceAn IMAP client MCP server for reading mail from Dovecot or Synology MailPlus mailboxes, with optional webhook triggers for new messages. It provides tools for managing emails and automates workflows by firing webhooks when matching messages arrive.
- AlicenseBqualityCmaintenanceUniversal IMAP/SMTP MCP server that works with any email provider, providing tools to read, search, send, and manage emails.101361MIT
- AlicenseNot gradedqualityDmaintenanceA high-fidelity IMAP/SMTP MCP server that enables reading, searching, and sending emails from providers like iCloud and Gmail, handling real-world IMAP quirks automatically.MIT
Related MCP Connectors
Read, search, send, organize, draft and schedule email across your inboxes from any MCP client.
Manage Gmail end-to-end: search, read, send, draft, label, and organize threads. Automate workflow…
Manage Gmail messages, threads, labels, drafts, and settings from your workflows. Send and organiz…
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/davidvornholt/mail-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server