一步連接
MoeMail 透過 Streamable HTTP 在 https://moemail.app/mcp 提供 MCP 工具。把這個網址交給你的 AI 應用程式;它第一次呼叫工具時會開啟瀏覽器,你登入 MoeMail 並確認授權即可。不用安裝,也不用貼上 API Key。
https://moemail.app/mcpclaude.ai, Claude Desktop and mobile
在 Claude 中開啟 Customize → Connectors,點選 + Add,再選 Add custom connector。名稱填 MoeMail,貼上網址,登入設定維持預設。點選 Connect 並確認授權。Team 與 Enterprise 方案需由擁有者先在組織設定中加入該連接器,成員再去連接。
該應用程式的官方指南claude mcp add --transport http moemail https://moemail.app/mcp
# then, inside Claude Code: /mcp → moemail → AuthenticateChatGPT
ChatGPT 在 Business、Enterprise 與 Edu 方案支援自訂 MCP 伺服器(Pro 僅限讀取類工具)。管理員、擁有者或獲授權的成員前往 Plugins,選擇 Add custom MCP server,填入網址、驗證方式選 OAuth,然後建立外掛。
該應用程式的官方指南{
"mcpServers": {
"moemail": { "url": "https://moemail.app/mcp" }
}
}claude.ai 與 ChatGPT 從它們自己的雲端連到伺服器。自架的 MoeMail 一樣可用,網址為 https://<你的網域>/mcp,只要它是公開可連的 HTTPS 網址。
由你決定 Agent 能做什麼
應用程式連接時,MoeMail 會顯示授權頁面,而不是直接交出 Key:
- 確認應用程式。 頁面會顯示它的名稱,以及資訊是否經過驗證。只有連接是你自己發起的才繼續。
- 選擇動作。 讀取郵件與建立信箱預設勾選;寄信與刪除需要你另外勾選。
- 限定範圍。 勾選 只能存取它自己建立的信箱,Agent 就看不到你原有的信箱。
- 隨時撤銷。 應用程式透過個人資料裡一把以它命名的 API Key 運作。停用這把 Key 即暫停該應用程式,刪除它就中斷連接。
其他接入方式
Agent skill
moemail skill install 把一份 SKILL.md 裝進 Claude Code 或 Codex,Agent 在被要求之前就已經知道「建立 → 等待 → 讀取 → 刪除」這套流程。
工具列表
名稱與 server 實際註冊的完全一致。讓 Agent 真正能用起來的是 wait_for_email:它最多阻塞 90 秒,逾時回傳 status: "timeout" 而不是報錯,Agent 只需再呼叫一次。
- create_email
- 建立信箱,回傳
id和address。有效期1h、24h、3d或permanent。 - wait_for_email
- 輪詢直到有新郵件到達(單次 ≤ 90 秒),逾時則平穩回傳。
- list_messages
- 信箱收到的郵件列表,最新的在前。
- read_message
- 單封郵件的完整內文與 HTML。
- list_emails
- 這個 API Key 名下的所有信箱。
- send_email
- 用臨時地址回信(需要寄信額度)。
- delete_message
- 刪除一封郵件。
- delete_email
- 刪除信箱及其中全部內容。
一次會話是什麼樣
取驗證碼的完整循環,按 Agent 實際發出的工具呼叫呈現:四次呼叫,加上郵件到達前的若干次輪詢。
用一個一次性地址在 example.com 註冊 beta,然後告訴我驗證碼。
Agent 建立一個信箱,把地址填進註冊表單。
→ create_email { "expiry": "1h" }
← { "id": "k3f…", "address": "x7q2m9@moemail.app", "expiresAt": "…T15:04:05.000Z" }然後等待。每次輪詢算一次 API 呼叫;這裡郵件在 12 秒後到達。
→ wait_for_email { "emailId": "k3f…", "timeoutSec": 90 }
← { "status": "received", "elapsedSec": 12,
"message": { "messageId": "m81…", "from": "no-reply@example.com",
"subject": "Your code is 482913", "receivedAt": "…" } }它讀取郵件,從內文裡取出驗證碼。
→ read_message { "emailId": "k3f…", "messageId": "m81…" }
← { "id": "m81…", "from": "no-reply@example.com", "subject": "Your code is 482913",
"content": "Enter 482913 to finish signing up. …", "html": "…", … }最後刪除信箱,不留任何東西。
→ delete_email { "emailId": "k3f…" }
← { "success": true, "deleted": "k3f…" }完成——驗證碼是 482913。信箱已刪除。
在本機執行伺服器
使用本機 stdio 伺服器時,把你的 API Key 填到圓點處。mcpServers 設定區塊在 Claude Desktop、Cursor 與 Windsurf 中完全相同;Claude Code 與 Codex 以各自格式寫同一條指令。
{
"mcpServers": {
"moemail": {
"command": "npx",
"args": ["-y", "@moemail/mcp"],
"env": {
"MOEMAIL_API_KEY": "mk_••••••••••••"
}
}
}
}{
"mcpServers": {
"moemail": {
"command": "npx",
"args": ["-y", "@moemail/mcp"],
"env": {
"MOEMAIL_API_KEY": "mk_••••••••••••"
}
}
}
}claude mcp add moemail -e MOEMAIL_API_KEY=mk_•••••••••••• -- npx -y @moemail/mcp[mcp_servers.moemail]
command = "npx"
args = ["-y", "@moemail/mcp"]
env = { MOEMAIL_API_KEY = "mk_••••••••••••" }自架的 MoeMail?加一個指向你實例的 MOEMAIL_API_URL——兩個套件預設都指向 moemail.app。
或者在 shell 裡直接用
同一套 API,不需要 Agent 執行環境。每條命令都接受 --json;結束碼 1 是執行期錯誤,2 是設定或驗證錯誤,腳本因此能區分「郵件還沒到」和「Key 不對」。
npm i -g @moemail/cli
moemail config set api-key mk_••••••••••••
# 1. a mailbox that lives for an hour
moemail create --expiry 1h --json
# {"id":"k3f…","address":"x7q2m9@moemail.app","expiresAt":"2026-09-02T15:04:05.000Z"}
# 2. block until the verification mail lands (exit 1 on timeout)
moemail wait --email-id k3f… --timeout 120 --json
# {"messageId":"m81…","from":"no-reply@example.com","subject":"Your code is 482913","receivedAt":"…"}
# 3. read it, then clean up
moemail read --email-id k3f… --message-id m81… --json
moemail delete --email-id k3f…只教一次
CLI 自帶一份 skill 檔案。裝好之後,Claude Code 或 Codex 遇到需要一次性收件匣的任務時會自己去用 moemail,不必每次都由你解釋流程。
moemail skill install # auto-detects Claude Code and Codex
moemail skill install --platform claude # ~/.claude/skills/moemail/SKILL.md
moemail skill install --platform codex # ~/.codex/skills/moemail/SKILL.mdKey、額度與價格
遠端伺服器、本機套件與 REST API 都在你的帳號下呼叫同一套 API,因此共用一份每月 API 額度。連接的應用程式使用它自己的受限 Key;本機套件使用你在個人資料裡建立的 Key。
API 存取是付費加購項目:預設方案不含免費呼叫次數。在商店用 MoeCoin 購買 API 呼叫包或升級為 Duke。網頁收件匣本身始終免費,你可以先看看信箱的實際效果,再為 API 付費。
請為輪詢預留額度:wait_for_email 的每次輪詢、CLI wait 的每次探測都算一次呼叫。一次典型的驗證流程——建立、等待、讀取、刪除——是四次呼叫加上輪詢次數。