{"_id":"@bencibro/tempmail-mcp","_rev":"2-03d61ed63539a49f854d6a84ac84775d","name":"@bencibro/tempmail-mcp","dist-tags":{"latest":"0.0.2"},"versions":{"0.0.1":{"name":"@bencibro/tempmail-mcp","version":"0.0.1","keywords":["mcp","temp-mail","temporary-email","disposable-email","verification","model-context-protocol","claude","ai"],"author":"","license":"MIT","_id":"@bencibro/tempmail-mcp@0.0.1","maintainers":[{"name":"bencibro","email":"benci@oksu.club"}],"homepage":"https://github.com/Bencibr/tempmailmcp","bugs":{"url":"https://github.com/Bencibr/tempmailmcp/issues"},"bin":{"tempmail-mcp":"dist/index.js"},"dist":{"shasum":"9a5ff883735510df0b3ca4d91f9c2c47c78d2d48","tarball":"https://registry.npmjs.org/@bencibro/tempmail-mcp/-/tempmail-mcp-0.0.1.tgz","fileCount":54,"integrity":"sha512-2/CHBoaNgajKqkFMGVtH1G5qQms4F4dnxgwDQnPPqI3U/J0WTFJs/5GxGtfgtkpykZ3LFDoXw9cZGQ/8JWGK+A==","signatures":[{"sig":"MEUCIQCGN//rZxWpEPWQCI04USV/sohp+O6s9meR1642ErQsAwIgSjqcHmtYx+Wdu/FQMr9lxJZPEu8bM1nTOBI26Fhaqm8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":181955},"main":"dist/index.js","type":"module","types":"./dist/index.d.ts","gitHead":"aed4f4e39ea795640c66be8eae612035cd294d5e","scripts":{"dev":"tsc --watch","test":"node test-e2e.mjs","build":"tsc","start":"node dist/index.js","prepare":"npm run build"},"_npmUser":{"name":"bencibro","email":"benci@oksu.club"},"repository":{"url":"git+https://github.com/Bencibr/tempmailmcp.git","type":"git"},"_npmVersion":"11.16.0","description":"A MCP server that provides temporary email services for registration verification, aggregating multiple temp mail providers.","directories":{},"_nodeVersion":"24.18.1","dependencies":{"zod":"^3.25.76","@modelcontextprotocol/sdk":"^1.30.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.7.3","@types/node":"^22.15.21"},"_npmOperationalInternal":{"tmp":"tmp/tempmail-mcp_0.0.1_1788326341539_0.07900605466233612","host":"s3://npm-registry-packages-npm-production"}},"0.0.2":{"name":"@bencibro/tempmail-mcp","version":"0.0.2","description":"A MCP server that provides temporary email services for registration verification, aggregating multiple temp mail providers.","license":"MIT","author":"","homepage":"https://github.com/Bencibr/tempmailmcp","repository":{"type":"git","url":"git+https://github.com/Bencibr/tempmailmcp.git"},"bugs":{"url":"https://github.com/Bencibr/tempmailmcp/issues"},"keywords":["mcp","temp-mail","temporary-email","disposable-email","verification","model-context-protocol","claude","ai"],"type":"module","main":"dist/index.js","bin":{"tempmail-mcp":"dist/index.js"},"publishConfig":{"access":"public"},"scripts":{"build":"tsc","dev":"tsc --watch","start":"node dist/index.js","test":"node test-e2e.mjs","prepare":"npm run build"},"dependencies":{"@modelcontextprotocol/sdk":"^1.30.0","libsodium-wrappers":"^0.8.4","tweetnacl":"^1.0.3","zod":"^3.25.76"},"devDependencies":{"@types/node":"^22.15.21","typescript":"^5.7.3"},"gitHead":"72ef91177f4224b5fddd206d8eb6fbd714d2888a","types":"./dist/index.d.ts","_id":"@bencibro/tempmail-mcp@0.0.2","_nodeVersion":"24.18.1","_npmVersion":"11.16.0","dist":{"integrity":"sha512-OthHo8a6yn8jt+UiF4iDq4E/TDdzxFJn6ZAGzAL2E/HyONdq4HX53lgfGSzHpgUpvTVhFDB2sAEJvc1v1DCwDw==","shasum":"9d358d014c18f6747058d9581efcdf1a9e5c9c5c","tarball":"https://registry.npmjs.org/@bencibro/tempmail-mcp/-/tempmail-mcp-0.0.2.tgz","fileCount":54,"unpackedSize":193710,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIDTwd0h2cA41q2jLzMKGhhAGUoBkauhX0SZe9ZcJjmU0AiA7D7g3xgzI57yJhZjOU3Gr6ndZIOpH8hsh6YQrFy6YjQ=="}]},"_npmUser":{"name":"bencibro","email":"benci@oksu.club"},"directories":{},"maintainers":[{"name":"bencibro","email":"benci@oksu.club"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/tempmail-mcp_0.0.2_1788356016857_0.9056030495899803"},"_hasShrinkwrap":false}},"time":{"created":"2026-09-02T05:19:01.427Z","modified":"2026-09-02T13:33:37.205Z","0.0.1":"2026-09-02T05:19:01.684Z","0.0.2":"2026-09-02T13:33:37.014Z"},"bugs":{"url":"https://github.com/Bencibr/tempmailmcp/issues"},"license":"MIT","homepage":"https://github.com/Bencibr/tempmailmcp","keywords":["mcp","temp-mail","temporary-email","disposable-email","verification","model-context-protocol","claude","ai"],"repository":{"type":"git","url":"git+https://github.com/Bencibr/tempmailmcp.git"},"description":"A MCP server that provides temporary email services for registration verification, aggregating multiple temp mail providers.","maintainers":[{"name":"bencibro","email":"benci@oksu.club"}],"readme":"# TempMail MCP\n\n[English](./README.md) | **[中文](./README.zh-CN.md)**\n\n一个 [Model Context Protocol](https://modelcontextprotocol.io) 服务器，为 AI 代理提供**临时邮箱**服务，实现邮件注册验证的闭环。\n\n> **AI 代理指南：** 阅读 [中文指南](./GUIDE.zh-CN.md) 获取工具使用说明、决策树和工作流模式。  \n> **For AI agents:** Read the [AI Guide](./GUIDE.md) for tool-by-tool instructions, decision trees, and workflow patterns.\n\n## 特性\n\n- **多服务商聚合** — 6 个临时邮箱服务商统一接口\n- **4 个免费服务商无需 API Key**（Mail.tm、Guerrilla Mail、1secmail、Catchmail）\n- **自动注册** — 通过纯 HTTP API 调用自动获取 MailDrop 和 mail.cx 的 API Key（无需浏览器）\n- **验证码提取** — 自动从收到的邮件中提取 OTP/验证码，支持 **6 种语言**（中文、英文、日文、俄文、法文、德文）\n- **等待邮件** — 阻塞/长轮询直到收到匹配的邮件\n- **会话管理** — 在内存中跟踪当前会话创建的邮箱\n- **零重型依赖** — 无 Puppeteer、无 Playwright，仅使用 Node.js 内置模块\n\n## 支持的服务商\n\n| 服务商 | 需要 API Key | 免费额度 | 特性 |\n|----------|---------|-----------|-------------------|\n| **Mail.tm** | 否 | 8 QPS | 完整 REST API，基于账号 |\n| **Guerrilla Mail** | 否 | 无限制 | 基于会话，60 分钟过期，自定义用户名 |\n| **1secmail** | 否 | 无限制 | 最简 API，隐式邮箱 |\n| **Catchmail** | 否 | 1 req/s | 通过 MX 记录自定义域名 |\n| **MailDrop** | 是（可自动获取） | 300 次/天 | 认领式邮箱，RSA 公钥认证 |\n| **Mail.cx** | 是（可自动获取） | 500 次/天 | 长轮询，SSE 推送，magic-link 认证 |\n\n> **提示：** 使用 `auto_register` 工具自动获取 MailDrop 和 mail.cx 的 API Key — 无需手动注册。\n\n## 安装\n\n### 从 npm 安装\n\n```bash\nnpm install -g @bencibro/tempmail-mcp\n```\n\n或直接使用 `npx` 运行（无需安装）：\n\n```bash\nnpx @bencibro/tempmail-mcp\n```\n\n### 从源码安装\n\n```bash\ngit clone https://github.com/Bencibr/tempmailmcp.git\ncd tempmailmcp\nnpm install\nnpm run build\n```\n\n## 配置\n\n### 环境变量\n\n| 变量 | 是否必需 | 说明 |\n|----------|----------|-------------|\n| `MAILDROP_API_KEY` | 否 | MailDrop 的 API Key。可通过 `auto_register` 工具自动获取。 |\n| `MAILCX_API_TOKEN` | 否 | Mail.cx 的 API Token。可通过 `auto_register` 工具自动获取。 |\n\n### Claude Desktop / Cursor / MCP 客户端配置\n\n#### 方式 A：使用 `npx`（推荐，无需安装）\n\n将以下内容添加到你的 MCP 客户端配置中（如 `claude_desktop_config.json`）：\n\n```json\n{\n  \"mcpServers\": {\n    \"tempmail\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@bencibro/tempmail-mcp\"],\n      \"env\": {\n        \"MAILDROP_API_KEY\": \"你的-maildrop-api-key\",\n        \"MAILCX_API_TOKEN\": \"你的-mailcx-api-token\"\n      }\n    }\n  }\n}\n```\n\n如果只需要免费服务商（无需 API Key），直接省略 `env` 块：\n\n```json\n{\n  \"mcpServers\": {\n    \"tempmail\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@bencibro/tempmail-mcp\"]\n    }\n  }\n}\n```\n\n#### 方式 B：全局安装\n\n```bash\nnpm install -g @bencibro/tempmail-mcp\n```\n\n然后使用 `tempmail-mcp` 作为命令：\n\n```json\n{\n  \"mcpServers\": {\n    \"tempmail\": {\n      \"command\": \"tempmail-mcp\",\n      \"env\": {\n        \"MAILDROP_API_KEY\": \"你的-maildrop-api-key\",\n        \"MAILCX_API_TOKEN\": \"你的-mailcx-api-token\"\n      }\n    }\n  }\n}\n```\n\n**没有 API Key？** 使用 `auto_register` 工具自动获取免费的 MailDrop 或 mail.cx API Key — **无需浏览器**，纯 HTTP API 调用。参见下方的[自动注册](#auto_register)。\n\n## 可用工具\n\n### `list_providers`\n\n列出所有可用的临时邮箱服务商及其能力。\n\n### `get_domains`\n\n获取指定服务商的可用邮箱域名列表。\n\n- **provider**（可选，默认 `\"mail.tm\"`）：服务商名称。\n\n### `create_mailbox`\n\n创建一个新的临时邮箱。\n\n- **provider**（可选，默认 `\"mail.tm\"`）：服务商名称。\n- **username**（可选）：首选用户名（邮箱本地部分）。\n- **domain**（可选）：首选域名。\n\n### `get_messages`\n\n获取邮箱收到的邮件列表。\n\n- **address**：临时邮箱地址。\n\n### `get_message`\n\n获取特定邮件的完整内容。\n\n- **address**：临时邮箱地址。\n- **messageId**：邮件 ID（来自 `get_messages`）。\n\n### `wait_for_email`\n\n阻塞直到收到匹配的邮件。返回第一条匹配的邮件。\n\n- **address**：临时邮箱地址。\n- **subjectContains**（可选）：按邮件主题子串过滤。\n- **fromContains**（可选）：按发件人子串过滤。\n- **timeoutMs**（可选，默认 `60000`）：超时时间（毫秒）。\n- **pollIntervalMs**（可选，默认 `3000`）：轮询间隔（毫秒）。\n\n### `get_verification_code`\n\n等待验证邮件并自动提取验证码。支持 **6 种语言**的验证邮件：中文（简体/繁体）、英文、日文、俄文、法文、德文。\n\n采用多策略提取算法：\n1. **上下文匹配** — 查找各语言关键词（如 `验证码`、`code`、`認証`、`код`、`vérification`、`Bestätigung`）附近的验证码\n2. **独立数字验证码** — 回退到纯数字验证码（优先 6 位），自动过滤年份等误匹配\n3. **字母数字验证码** — 最后手段回退到大写字母数字组合，过滤纯字母单词\n\n- **address**：临时邮箱地址。\n- **subjectContains**（可选）：过滤器（如 `\"verification\"`、`\"验证\"`、`\"code\"`、`\"Код\"`）。\n- **fromContains**（可选）：按发件人过滤。\n- **timeoutMs**（可选，默认 `60000`）：超时时间（毫秒）。\n\n### `list_mailboxes`\n\n列出当前会话中创建的所有临时邮箱。\n\n### `delete_mailbox`\n\n删除临时邮箱及其所有邮件。\n\n- **address**：临时邮箱地址。\n\n### `auto_register`\n\n自动注册账号并获取服务商的 API Key/Token。**纯 HTTP API — 无浏览器、无 Puppeteer。**\n\n#### `maildrop`\n\n使用 RSA 密钥生成 + HTTP API：\n\n1. 生成 RSA 2048 密钥对（Node.js `crypto` 模块）\n2. `POST /api/register.php` 提交公钥注册账号\n3. 签名 `timestamp-username` 生成 passcode\n4. `POST /api/login.php` 登录认证\n5. `POST /api/account/keys.php` 创建 API Key（`md_...`）\n\n#### `mail.cx`\n\n使用 magic-link 登录流程：\n\n1. 通过 mail.tm 创建临时邮箱（无需 API Key）\n2. `POST /v1/auth/magic-link/request` 发送 magic link 到临时邮箱\n3. 轮询 mail.tm 等待 magic link 邮件\n4. `POST /v1/auth/magic-link/verify` 提交 token — **直接返回 API Token**（`tm_live_...`）\n\n**参数：**\n\n- **provider**（必填）：`\"maildrop\"` 或 `\"mail.cx\"`\n- **tokenName**（可选，默认 `\"tempmail-mcp\"`）：Token 名称（仅 mail.cx）。\n- **username**（可选）：账号用户名（仅 maildrop）。\n- **timeoutMs**（可选，默认 `120000`）：总超时时间（毫秒）。\n\n返回 API Key/Token 并在当前会话中自动注册该服务商。要永久生效，请设置对应的环境变量（`MAILDROP_API_KEY` 或 `MAILCX_API_TOKEN`）。\n\n## 使用示例\n\n### 自动注册获取免费 API Key\n\n**MailDrop**（快速，约 2 秒）：\n\n```\n1. auto_register (provider: \"maildrop\")\n   → { apiKey: \"md_...\", email: \"tmp_xxx@maildrop.cc\", ... }\n\n2. [在 MCP 配置中设置 MAILDROP_API_KEY=md_...]\n\n3. list_providers\n   → 服务商列表中现在包含 \"maildrop\"！\n```\n\n**mail.cx**（约 15-30 秒，需要等待邮件）：\n\n```\n1. auto_register (provider: \"mail.cx\")\n   → { apiKey: \"tm_live_...\", email: \"abc@emalupe.com\", ... }\n\n2. [在 MCP 配置中设置 MAILCX_API_TOKEN=tm_live_...]\n\n3. list_providers\n   → 服务商列表中现在包含 \"mail.cx\"！\n```\n\n注册后两个服务商在当前会话中立即可用 — 无需重启。\n\n### 典型注册验证流程\n\n```\n1. create_mailbox (provider: \"mail.tm\")\n   → { address: \"abc123@somedomain.com\", ... }\n\n2. [在目标网站上使用临时邮箱地址注册]\n\n3. get_verification_code (address: \"abc123@somedomain.com\", subjectContains: \"verification\")\n   → { code: \"829451\", from: \"noreply@example.com\", subject: \"Your verification code\", ... }\n\n4. [在目标网站上输入验证码完成注册]\n\n5. delete_mailbox (address: \"abc123@somedomain.com\")\n```\n\n### 手动查看邮件\n\n```\n1. create_mailbox (provider: \"guerrillamail\", username: \"mytest\")\n   → { address: \"mytest@guerrillamailblock.com\", ... }\n\n2. get_messages (address: \"mytest@guerrillamailblock.com\")\n   → { count: 2, messages: [{ id: \"1\", from: \"...\", subject: \"...\" }, ...] }\n\n3. get_message (address: \"mytest@guerrillamailblock.com\", messageId: \"1\")\n   → { id: \"1\", from: \"...\", subject: \"...\", bodyText: \"...\", bodyHtml: \"...\" }\n```\n\n## 开发\n\n```bash\n# 安装依赖\nnpm install\n\n# 编译\nnpm run build\n\n# 本地运行\nnode dist/index.js\n\n# 监听模式\nnpm run dev\n\n# 测试自动注册\nnode test-auto-register-api.mjs maildrop   # 仅测试 MailDrop\nnode test-auto-register-api.mjs mailcx     # 仅测试 mail.cx\nnode test-auto-register-api.mjs all        # 测试全部\n```\n\n## 架构\n\n```\n┌──────────────────────────────────────────────────────┐\n│                  MCP 客户端 (Claude)                   │\n│                      │                                │\n│             stdio / Streamable HTTP                    │\n│                      ▼                                │\n│          ┌──────────────────────┐                      │\n│          │  TempMail MCP 服务器  │                      │\n│          │                      │                      │\n│          │  ┌─── 工具 ────────┐ │                      │\n│          │  │ create_mailbox   │ │                      │\n│          │  │ get_messages     │ │                      │\n│          │  │ wait_for_email   │ │                      │\n│          │  │ get_verification  │ │                      │\n│          │  │ auto_register    │ │                      │\n│          │  │ ...              │ │                      │\n│          │  └──────────────────┘ │                      │\n│          └──────────┬───────────┘                      │\n│                     │                                  │\n│          ┌──────────▼───────────┐                      │\n│          │  服务商管理器          │                      │\n│          │  (适配器模式)          │                      │\n│          └──────────┬───────────┘                      │\n│                     │                                  │\n│   ┌────────┬────────┼────────┬──────────┐              │\n│   ▼        ▼        ▼        ▼          ▼              │\n│ Mail.tm  Guerrilla 1secmail  Catchmail  MailDrop        │\n│          Mail                            Mail.cx        │\n└──────────────────────────────────────────────────────┘\n\n自动注册流程（纯 HTTP，无浏览器）：\n  ┌───────────────┐                    ┌───────────────┐\n  │  MailDrop     │                    │  mail.cx       │\n  │               │                    │                │\n  │  RSA 密钥生成  │                    │  mail.tm 临时   │\n  │  ↓            │                    │  邮箱           │\n  │  POST 注册    │                    │  ↓             │\n  │  ↓            │                    │  POST magic    │\n  │  RSA 签名     │                    │  link 请求     │\n  │  ↓            │                    │  ↓             │\n  │  POST 登录    │                    │  轮询等待邮件   │\n  │  ↓            │                    │  ↓             │\n  │  POST 创建    │                    │  POST verify   │\n  │  API Key      │                    │  → API Token  │\n  │  → md_...     │                    │  → tm_live_... │\n  └───────────────┘                    └───────────────┘\n```\n\n## 许可证\n\nMIT\n","readmeFilename":"README.zh-CN.md"}