spacemail-mcp
spacemail-mcp
这是一个 MCP 服务器,让 Claude 可以访问一个或多个 Spacemail(Spaceship 企业邮箱)邮箱。
为什么这样设计
Spaceship 在 docs.spaceship.dev 提供公共 API,涵盖域名(domains)、DNS 和 SellerHub。它没有邮箱端点,所以没有可封装进邮件的功能。Spacemail 本身提供标准的 IMAP 和 SMTP,并且默认为启用状态,因此本服务器直接使用这些协议:
协议 | 主机 | 端口 | 加密 |
IMAP | mail.spacemail.com | 993 | SSL |
SMTP | mail.spacemail.com | 465 | SSL |
用户名是完整的 Spacemail 地址,密码就是该邮箱自身的密码。
Related MCP server: IMAP MCP Server
工具
工具 | 说明 |
| 列出已配置的邮箱,以及哪个是默认邮箱。 |
| 校验凭据。可测试单个邮箱,或者一次测试全部。 |
| 列出所有文件夹,并显示邮件数量和未读数量。 |
| 按收件人、发件人、主题、正文、日期、已读/未读筛选,最新在前。 |
| 读取单封邮件:邮件头、纯文本正文、附件列表。 |
| 将邮件标记为已读或未读。 |
| 在文件夹之间移动邮件,包括移至 Trash。 |
| 构思并保存到草稿箱(Drafts),但不发送。 |
| 通过 SMTP 发送邮件。默认关闭,除非按账户显式开启。 |
每个工具都接受一个可选的 account 参数。如果只配置一个邮箱,该参数会被忽略;如果配置多个邮箱,省略该参数则使用默认邮箱。search_messages 还支持 account: "*",可以在一次调用中搜索全部邮箱。
这里有刻意的两个省略:
没有永久删除。 任何工具最多只能把邮件移到 Trash,而你可以通过把它移回来撤销。
发送是每个账号选择启用(opt-in)的。 除非
allowSend在该特定邮箱上为 true,否则send_message会拒绝发送。请保持allowSend关闭,并使用save_draft,这样发送这个动作由人工完成。
设置
1. 安装
需要 Node.js 18 或更高版本。
cd path/to/spacemail-mcp
npm install2. 创建 accounts.json
将 accounts.example.json 复制为 accounts.json 并填写。该文件已被 gitignore 忽略。
{
"accounts": [
{
"label": "personal",
"user": "you@example.com",
"password": "the-mailbox-password",
"default": true,
"fromName": "Your Name"
},
{
"label": "work",
"user": "hello@example.org",
"password": "the-other-password"
}
]
}每个账号的字段: label(在对话中你怎么称呼它), user, password,以及可选参数 default、fromName、allowSend、imapHost、imapPort、smtpHost、smtpPort。
label 必须唯一。如果省略 label,它会根据地址自动生成,因此对于不同域名中相同的本地部分(比如 info@a.com 和 info@b.com),两者都会变成 info,服务器将拒绝启动。请为它们设置明确的 label。
密码来自 Spacemail Manager:找到订阅,点击邮箱旁边的三个点,然后选择 IMAP/POP3/SMTP。如果你不再有密码,可以在那里重新设置。
3. 在 Claude 桌面应用程序中注册
转到设置,然后“开发者”,然后“编辑配置”,它会打开 %APPDATA%\Claude\claude_desktop_config.json:
{
"mcpServers": {
"spacemail": {
"command": "node",
"args": ["C:\\path\\to\\spacemail-mcp\\index.js"],
"env": {
"SPACEMAIL_CONFIG": "C:\\path\\to\\spacemail-mcp\\accounts.json"
}
}
}
}在 JSON 中,反斜杠需要写成两个(双写)。之后请从系统托盘彻底退出并重新启动应用。
或者使用 Claude Code CLI:
claude mcp add --transport stdio spacemail ^
--env SPACEMAIL_CONFIG="C:\path\to\spacemail-mcp\accounts.json" ^
-- node "C:\path\to\spacemail-mcp\index.js"4. 验证
让 Claude 调用 test_connection,不指定任何账户。它会测试每个邮箱,并独立报告每个是成功(ok)还是失败(failed),所以某个邮箱的密码错误不会掩盖其他邮箱的情况。
提供凭据的其他方式
按以下顺序检查,先找到的优先。
1. 配置文件(推荐用于配置两个或更多邮箱)
让 SPACEMAIL_CONFIG 指向上面的 JSON 文件。
2. 编号的环境变量
SPACEMAIL_1_USER、SPACEMAIL_1_PASSWORD、SPACEMAIL_1_LABEL、SPACEMAIL_1_DEFAULT、
SPACEMAIL_1_ALLOW_SEND、SPACEMAIL_1_FROM_NAME,然后 SPACEMAIL_2_* 依此类推,最多 20 个。
3. 单一账户
SPACEMAIL_USER 和 SPACEMAIL_PASSWORD 和 password,以及可选的 SPACEMAIL_IMAP_HOST、
SPACEMAIL_IMAP_PORT、SPACEMAIL_SMTP_HOST、SPACEMAIL_SMTP_PORT、SPACEMAIL_ALLOW_SEND、
SPACEMAIL_FROM_NAME★.
故障排查
服务器无法启动。 它退出时会在 stdout 上输出一条明确的错误消息:配置文件不可读、缺少密码、label重复,或者完全没有配置任何邮箱。直接在文件夹中运行 node index.js 即可看到该消息。
某个邮箱失败,其他邮箱正常。 不带任何参数运行 test_connection。每个账户会分别报告。常见原因是用户名不是完整的邮箱地址,或者 Spacemail Manager 中该邮箱的 IMAP 已关闭。
服务器在 Claude 中显示为已断开。 MCP 子进程启动时的环境与本机终端不同,因此 node 可能不在 PATH 中。请使用绝对路径指向 node.exe,可通过 where node 获取。
search_messages 搜索不到任何内容。 文件夹路径是区分大小写且可能各不相同。请先运行 list_folders,使用它返回的准确的 path 值。
发送被拒绝。 allowSend 必须在该特定账户中为 true。此外,Spacemail 也会按套餐限制出站邮件的数量。
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
- AlicenseAqualityAmaintenanceEnables Claude to interact with email accounts via IMAP and SMTP, providing tools for searching, reading, sending, and managing emails across multiple providers.4041776MIT
- FlicenseNot gradedqualityDmaintenanceEnables Claude to read, search, send, and manage emails across multiple IMAP/SMTP accounts via a single deployment.
- FlicenseNot gradedqualityBmaintenanceEnables Claude to read, search, draft, send, flag, and move email across multiple IMAP/SMTP mailboxes while keeping credentials local.
- FlicenseNot gradedqualityCmaintenanceEnables Claude to read and manage your Gmail account, including listing, searching, sending, drafting, replying to, archiving, labeling, and trashing emails via the Gmail API.
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…
Give an AI agent its own email address: send, reply, read, and wait for mail.
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/Manjit73/spacemail-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server