Provides AI agents with real email accounts (@theagentmail.net) via AgentMail REST API for registration, verification codes, and transactional communication. Manages account creation, sending/receiving emails, webhook registration, and karma balance monitoring.
Ships in 10-platform. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
@theagentmail.net),用于第三方服务注册、接收验证码/确认链接、或事务性邮件往来。不该用:
am_... 格式的 API Key,所有请求都带 Authorization: Bearer am_...。Base URL:https://api.theagentmail.net。GET /v1/karma 确认 balance 充足(余额为 0 时发信/建号返回 HTTP 402)。POST /v1/accounts,记录返回的 accountId。DELETE /v1/accounts/:id,可退回 10 karma。核心 REST 端点(与 karma 影响):
| 方法 | 路径 | 说明 | Karma |
|---|---|---|---|
| POST | /v1/accounts | 创建邮箱账号 | -10 |
| GET | /v1/accounts | 列出所有账号 | |
| GET | /v1/accounts/:id | 账号详情 | |
| DELETE | /v1/accounts/:id | 删除账号 | +10 |
| POST | /v1/accounts/:id/messages | 发送邮件 | -1 |
| GET | /v1/accounts/:id/messages | 列出邮件 | |
| GET | /v1/accounts/:id/messages/:msgId | 读取整封邮件(含正文/附件) | |
| GET | /v1/accounts/:id/messages/:msgId/attachments/:attId | 取附件下载 URL | |
| POST | /v1/accounts/:id/webhooks | 注册 Webhook | |
| GET | /v1/accounts/:id/webhooks | 列出 Webhook | |
| DELETE | /v1/accounts/:id/webhooks/:whId | 删除 Webhook | |
| GET | /v1/karma | 查余额 + 事件流 |
发信可选字段:cc、bcc(字符串数组);inReplyTo、references(用于会话串联);attachments({filename, contentType, content},content 为 base64)。
karma 规则(关键约束):
email_received +2);未知/一次性域名不计。money_paid +100,account_deleted +10(退还建号成本),email_sent -1,account_created -10。创建账号:
curl -X POST https://api.theagentmail.net/v1/accounts \
-H "Authorization: Bearer am_..." \
-H "Content-Type: application/json" \
-d '{"address": "[email protected]"}'
# => {"data": {"id": "...", "address": "[email protected]", "displayName": null, "createdAt": 123}}
发信:
curl -X POST https://api.theagentmail.net/v1/accounts/{accountId}/messages \
-H "Authorization: Bearer am_..." \
-H "Content-Type: application/json" \
-d '{
"to": ["[email protected]"],
"subject": "Hello from my agent",
"text": "Plain text body",
"html": "<p>Optional HTML body</p>"
}'
读取收件箱与整封邮件:
curl https://api.theagentmail.net/v1/accounts/{accountId}/messages \
-H "Authorization: Bearer am_..."
curl https://api.theagentmail.net/v1/accounts/{accountId}/messages/{messageId} \
-H "Authorization: Bearer am_..."
注册 Webhook(实时入站):
curl -X POST https://api.theagentmail.net/v1/accounts/{accountId}/webhooks \
-H "Authorization: Bearer am_..." \
-H "Content-Type: application/json" \
-d '{"url": "https://my-agent.example.com/inbox"}'
Webhook 回调签名校验(HMAC-SHA256,拒收 5 分钟前的时间戳防重放):
import { createHmac } from "crypto";
const verifyWebhook = (body: string, signature: string, timestamp: string, secret: string) => {
if (Date.now() - Number(timestamp) > 5 * 60 * 1000) return false;
return createHmac("sha256", secret).update(body).digest("hex") === signature;
};
TypeScript SDK(@agentmail/sdk)典型流程:
import { createClient, AgentMailError } from "@agentmail/sdk";
const mail = createClient({ apiKey: "am_..." });
const account = await mail.accounts.create({ address: "[email protected]" });
await mail.messages.send(account.id, { to: ["[email protected]"], subject: "Hello", text: "Sent by an AI agent." });
const messages = await mail.messages.list(account.id);
const detail = await mail.messages.get(account.id, messages[0].id);
const att = await mail.attachments.getUrl(account.id, messageId, attachmentId); // att.url 为带签名下载链接
const karma = await mail.karma.getBalance(); // karma.balance
常见模式 —— 注册后轮询验证码邮件:
for (let i = 0; i < 30; i++) {
const messages = await mail.messages.list(account.id);
const verification = messages.find(m =>
m.subject.toLowerCase().includes("verify") ||
m.subject.toLowerCase().includes("confirm"));
if (verification) {
const detail = await mail.messages.get(account.id, verification.id);
// 从 detail.bodyText / detail.bodyHtml 解析验证链接或验证码
break;
}
await new Promise(r => setTimeout(r, 2000));
}
发信后等待回复(按 direction === "inbound" 且时间戳晚于发信判定):
const sent = await mail.messages.send(account.id, { to: ["[email protected]"], subject: "Question about order #12345", text: "Can you check the status?" });
for (let i = 0; i < 60; i++) {
const messages = await mail.messages.list(account.id);
const reply = messages.find(m => m.direction === "inbound" && m.timestamp > sent.timestamp);
if (reply) { const detail = await mail.messages.get(account.id, reply.id); break; }
await new Promise(r => setTimeout(r, 5000));
}
/v1/karma。错误码示例:INSUFFICIENT_KARMA、NOT_FOUND;HTTP 状态含 401/402/404 等,SDK 抛 AgentMailError(含 .status/.code/.message)。X-AgentMail-Signature(请求体的 HMAC-SHA256 hex)与 X-AgentMail-Timestamp(毫秒时间戳),拒收超过 5 分钟的投递以防重放。GET .../attachments/:attId 返回 {"data": {"url": "..."}},是带签名的临时下载 URL,不直接返回二进制;发信附件 content 需 base64 编码。Message 含 direction: "inbound" | "outbound" 与 timestamp;MessageDetail 额外有 bodyText/bodyHtml/cc/bcc/inReplyTo/references/attachments。lark-mail:飞书托管邮箱的起草/收发/规则管理,企业内网场景的对照方案。采编自 sickn33/antigravity-awesome-skills(MIT)。
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
/10-platform:agentmail-email-infrafrom 10-platform
npx claudepluginhub findscripter/everything-skills --plugin 10-platform66 skills in this plugin
/agentphone-voice-sms-agents当需要给 AI 代理配备电话号码、发起/接听语音通话、收发短信、查看通话转写或配置 Webhook 时使用;调用 AgentPhone REST API(base=https://api.agentphone.to/v1)完成代理/号码/通话/短信/Webhook/用量的全生命周期管理,产出可直接执行的 curl 与 Webhook 处理代码;不适用于自建 Twilio/SIP/STUN 等底层电信栈或非 AgentPhone 平台。触发词:电话代理、语音通话、短信、号码、Webhook、转写。/ai-native-cli-design当设计/改造供 AI 智能体调用的命令行工具时使用;按 core/recommended/ecosystem 三层产出 JSON 优先、可校验的 CLI 契约(默认 JSON、结构化错误、退出码、护栏、agent/ 目录与自描述);不适用于纯人类交互 CLI、GUI 或库 API 设计;触发词:agent CLI、AI 友好命令行、CLI JSON 输出、退出码规范、agent/ 目录/amazon-alexa-skill-builder当需要用 ASK CLI + AWS Lambda 开发 Amazon Alexa 语音技能、并以 Claude 作为对话大脑(含 DynamoDB 记忆、Polly 语音、APL 屏显、Smart Home 控制)时使用;做交互模型/Lambda 处理器/部署脚本的搭建与产出;不适用于纯网页/移动 App 或非 Alexa 平台语音助手;触发词:Alexa、ASK CLI、语音技能、Smart HomeOther plugins' skills for the same job