Agent-first email

Every agent gets its own mailbox. You keep the send button.

cloudmail is built for people and AI agents working side by side. Give an agent its own address, or connect Claude, Cursor, Codex or your own code over MCP, the Agent Skill, the CLI, the SDKs or REST. Agents work with exactly the permissions you give them, and anything they send waits for a person unless you decide otherwise.

Agent inboxes

A mailbox for every agent, separate from yours

An agent shouldn't borrow a person's login. One command creates a real address for one agent, with a token confined to that mailbox, its own send mode, an optional webhook for new mail and an expiry. When it expires, the token is revoked and the mail is archived to your R2 bucket.

  • Its own address: agent-…@yourdomain.com, or a local part you choose.
  • Its own rules: allowed_recipients binds every send from that mailbox, whatever the mode.
  • Its own lifetime: up to 90 days, or end it now from Settings → Agent inboxes.

What an agent inbox comes with, and agent inboxes in the reference.

CLI
# A separate mailbox for one agent, with its own token
cloudmail agent-inbox create --domain yourdomain.com \
  --purpose 'Invoice triage' --send-mode approve \
  --allow @partner.com --ttl-hours 24

cloudmail agent-inbox list       # addresses, send modes, time left

Approvals

Approval is the default

Anyone can email your mailbox, and an AI that reads that email can be steered by it. So the server, not the client, decides whether a send from an agent goes out. The rule covers every route an agent credential can send through: MCP tools, the REST API, scheduled sends, templates and sequence enrolment.

  • No agent approves its own send. There is no MCP tool to approve, and a token can't decide a send it, its parent or its child asked for.
  • What you approve is what is sent. The held message is fully composed, and an edit replaces it.
  • Suspicious reads hold sends. If what an agent just read looks like a prompt injection, its sends are held for 30 minutes whatever the mode.
  • Exactly once. An approved send is claimed before the provider is called, so a retry can't send it twice.
Agent send modes, set per mailbox by a signed-in person
Mode, per mailboxSettingWhat an agent send does
Drafts onlydraft_onlyAgents can read and write drafts. Any send from an agent is refused.
Approve every send (default)approveAgent sends wait in Pending approval. The API answers 202 pending_approval with a link for the reviewer.
Send automaticallyautoOnly for a credential you trusted with it: a token with mail:send:auto, or an app marked Send without approval.

Only a signed-in person can change the mode. A per-mailbox recipient allowlist lets sends to known addresses skip the queue. How send approval works.

MCP server

73 tools at /mcp over Streamable HTTP. Clients sign in through your browser with OAuth 2.1, so there's no token to paste, and you can disconnect each app from your account settings.

  • Read and searchlist_emails, get_thread, search_emails, semantic_search, ask_inbox, get_daily_brief, list_people
  • Organiseapply_label, move_email, archive_email, snooze_email, bulk_update, create_rule, screen_sender
  • Draft and senddraft_reply, create_draft, send_reply, send_email, forward_email, schedule_send, send_template
  • Held sendslist_pending_sends, get_pending_send, revise_pending_send
  • Adminlist_domains, get_domain_status, create_agent_inbox, list_webhooks, get_usage, get_analytics

Every tool carries read-only and destructive hints. No tool deletes mail permanently. Message bodies come back marked as untrusted content. What an MCP client can do, and the full tool list and client setup.

Claude Code
# Signs in through your browser with OAuth
claude mcp add --transport http cloudmail \
  https://mail.yourdomain.com/mcp

# Headless agents use an API token instead
claude mcp add --transport http cloudmail \
  https://mail.yourdomain.com/mcp \
  --header "Authorization: Bearer ttk_..."
Claude Desktop and Cursor connect with the same URL.

CLI

One tool for a person at a terminal and a script in a pipe: aligned tables when you're looking, JSON when you're not, exit codes that say what failed, and --dry-run on everything that changes state.

Prebuilt for macOS, Linux and Windows on GitHub releases, or build it from cli/ in the repo.

Terminal
cloudmail config set base-url https://mail.yourdomain.com
cloudmail auth login            # paste a ttk_ token; input is hidden

cloudmail mail list --folder inbox --unread --limit 10
cloudmail mail send --to priya@example.org \
  --subject 'Pilot start' --text 'Monday works.' --dry-run
cloudmail approval list          # sends held for a person
cloudmail events tail --mailbox support@yourdomain.com

Agent Skill

One install teaches Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot and other coding agents to work with your deployment: read, search and summarise mail, draft replies for you to review, send when you ask, and run an agent inbox of their own. It treats every email as data, never as instructions, and reports a held send to you instead of retrying it.

Works through the CLI or your MCP server. cloudmail-hq/skills on GitHub.

Install
# Claude Code
/plugin marketplace add cloudmail-hq/skills
/plugin install cloudmail@cloudmail

# Codex, Cursor, Gemini CLI, Copilot and others
npx skills add cloudmail-hq/skills

TypeScript and Python SDKs

Both cover every REST operation a token can use, send an idempotency key with every send, and never retry a send on a server error. A held send comes back as a typed result your agent can revise or wait on. Both include webhook verification and a reconnecting event stream.

Install from sdk/ in the repo.

TypeScript
import { Cloudmail, isPendingApproval } from "@cloudmail/sdk";

const mail = new Cloudmail({
  baseUrl: "https://mail.yourdomain.com",
  token: process.env.CLOUDMAIL_TOKEN!,
});

const result = await mail.mail.send("support@yourdomain.com", {
  to: "priya@example.org",
  subject: "Pilot start date",
  text: "Monday works.",
});

if (isPendingApproval(result)) {
  // Nothing was sent. A person approves it in the app.
  console.log("held:", result.approval_url);
}

Webhooks and live events

Signed JSON events, retried six times over about nine hours. The payload is a summary, never the message itself. The same events stream over WebSocket or Server-Sent Events, and replay from where a client left off.

Verify a webhook (Node)
import crypto from "node:crypto";

// X-Tapetide-Signature: v1=<hex>, HMAC-SHA256 of `${timestamp}.${rawBody}`
const expected = "v1=" + crypto
  .createHmac("sha256", secret)
  .update(`${ts}.${rawBody}`)
  .digest("hex");
const ok = crypto.timingSafeEqual(Buffer.from(signature), Buffer.from(expected));
Webhook events
EventSent when
message.receivedMail was stored in a mailbox
message.sentThe sending provider accepted a message
message.delivery_failedA send failed or the recipient was suppressed
message.bouncedA permanent bounce came back
message.opened / message.clickedTracking pixel loaded, or a tracked link followed
deliverability.warningA domain's complaint rate crossed 0.1%, or bulk sending paused at 0.3%
usage.budget_exceededProjected AI or sending cost passed your budget

REST API

  • OpenAPI 3.1Served by every deployment at /api/v1/openapi.json, with a readable reference at /api/docs.
  • Scoped tokensLimit a token to scopes such as mail:read or mail:send, and to particular mailboxes.
  • Idempotency keysEvery send and create accepts one. A repeat returns the first response for 24 hours instead of sending again.
  • Rate limits per caller600 API requests and 120 MCP requests a minute, plus each mailbox's send caps.
  • MoreThe email API, CLI and SDKs in one page.

One-time licence

Your agents get a mailbox. You keep the last word.