mails0email for agents

Your agent signs up for services, confirms verification codes, and replies from its own inbox. Free hosted mailbox, or self-host on Cloudflare. Open source.

@mails0.com
Mailbox
API Key
Paste this once in Claude Code — installs, configures, and teaches your agent
# Install mails0 email for your agent ([email protected]) npm install -g mails-agent mails config set api_key YOUR_KEY mails config set mailbox [email protected] mails doctor # Download full reference (agent reads this automatically) curl -sL https://mails0.com/agent.md > ~/.claude/skills/mails-email.md # Quick test mails send --to [email protected] --subject "Hello from [email protected]" --body "It works!" mails inbox
Paste this once in OpenClaw — installs, configures, and teaches your agent
# Install mails0 email for your agent ([email protected]) npm install -g mails-agent mails config set api_key YOUR_KEY mails config set mailbox [email protected] mails doctor # Download full reference (agent reads this automatically) curl -sL https://mails0.com/agent.md > ~/.claude/skills/mails-email.md # Quick test mails send --to [email protected] --subject "Hello from [email protected]" --body "It works!" mails inbox
Install and configure
npm install -g mails-agent mails config set api_key YOUR_KEY mails config set mailbox [email protected] mails doctor # Try it mails send --to [email protected] --subject "Hello" --body "World" mails inbox mails inbox --query "verification" mails code --to [email protected] --timeout 30
Full CLI + API reference →
Install and use
pip install mails-agent from mails_agent import MailsClient client = MailsClient( api_url="https://api.mails0.com", token="YOUR_KEY", mailbox="[email protected]", ) # Send client.send_email(to="[email protected]", subject="Hi", body="Hello") # Inbox emails = client.get_inbox() # Wait for verification code code = client.wait_for_code(timeout=30)
Full Python + HTTP reference →
Add to your MCP config (Claude Desktop / Cursor / Windsurf)
{ "mcpServers": { "mails": { "command": "npx", "args": ["mails-agent-mcp"], "env": { "MAILS_API_KEY": "YOUR_KEY", "MAILS_MAILBOX": "[email protected]" } } } }
Full reference →
Install npm install -g mails-agent

Four guarantees.

Contain the blast radius and preserve every message — even when the agent misbehaves.

01 / Isolation

Per-mailbox scoped keys

Every mailbox gets its own API key. A leaked or misused key can only touch the mailbox it was issued for — never your other mailboxes, your domain config, or your billing.

02 / Durability

Raw-first, zero loss

Every inbound email is persisted to R2 before any parsing or routing. If a parser, webhook, or agent ever crashes, the original message is still recoverable byte-for-byte.

03 / Guardrails

Rate limits & suppression

100 sends/day per mailbox (configurable when self-hosted) plus automatic bounce and complaint suppression. A runaway agent can't burn your domain reputation or drain your quota.

04 / Sovereignty

Your keys, your exit

Self-hosted on your own Cloudflare account. MIT licensed. Audit the code, rotate keys, pause a mailbox, or walk away anytime — no vendor lock-in.


Open source, on your infrastructure.

MIT licensed, self-hostable on Cloudflare, with agent-native tooling that hosted SaaS doesn't ship.

mails0.com
$0self-hosted
Cloudflare free tier covers: 100k Worker requests/day · 10 GB R2 · 5 GB D1 · unlimited inbound email
Open source (MIT)
Self-hosted, your data
CLI + SDK + Agent Skills + MCP
Custom domains with DNS verification
Hosted alternatives
Usage-based pricing
Pay per seat, per mailbox, or per message. Data lives on vendor servers.
Closed source
Vendor-hosted, their servers
Generic APIs, limited agent-native tooling
Custom domain tiers vary

Three commands to first email.

Claim a mailbox, send from it, wait for a verification code. Same surface in CLI, Python, or MCP.

Step 1

Claim

$ mails claim myagent Claiming [email protected]... Claimed: [email protected]
Step 2

Send

$ mails send \ --to [email protected] \ --subject "Hello" --body "World"
Step 3

Extract

$ mails code \ --to [email protected] Waiting for code... 847291

Everything an agent needs.

Send, receive, search, extract, observe. One API, six first-class primitives.

01

Send and receive

Full email with CC/BCC, In-Reply-To threading, and attachments. Receive via Cloudflare Email Routing with raw-first R2 persistence.

02

Search and extract

Full-text search (FTS5) across inbox. Automatic verification code extraction for EN, ZH, JA, and KO. Long-poll until code arrives.

03

Real-time events

Webhooks with HMAC-SHA256 signature verification. SSE streams for message.received. Auto-labeling: newsletter, notification, code, personal.

04

Structured extraction

Extract orders, shipping, calendar events, and receipts from emails. Deterministic parsers — no LLM cost, no hallucinations.

05

Visual dashboard

Inspect every mailbox, message, and webhook delivery in the built-in console. Debug deliverability or hand a mailbox to a non-developer — no DB client required.

06

Custom domains & deliverability

Bring any domain. mails0 guides you through SPF, DKIM, and MX verification so inbound routing and outbound deliverability just work — on your own Cloudflare account.


Install once, use everywhere.

One API key. Four ways to use it: CLI, Python SDK, MCP server, and agent-native skill packs.

$ npm install -g mails-agent
mails claim myagent mails send --to [email protected] --subject "Hello" --body "World" mails code --to [email protected]
$ pip install mails-agent
from mails_agent import MailsClient client = MailsClient(api_key="mk_...") code = client.wait_for_code("[email protected]", timeout=60)
$ npx mails-skills
# Or install via OpenClaw: clawhub install mails-for-agent # Or manually: curl -sL mails0.com/skill.md > ~/.claude/skills/email.md
$ npx mails-agent-mcp
# Works with Claude Desktop, Cursor, Windsurf # 10 tools included: send, inbox, code, search, # email, delete, threads, thread, extract, me

Questions.

What is mails0?

mails0 is open-source email infrastructure for AI agents. It lets agents send, receive, search emails, and extract verification codes programmatically. Deploy on your own domain with Cloudflare Workers (free tier).

What's the difference between mails0, mails-agent, and the mails CLI?

mails0 is the product. mails-agent is the npm and PyPI package that ships the SDK and CLI (npm install -g mails-agent or pip install mails-agent). mails is the CLI binary you run from your terminal. They all refer to the same thing.

How do I give my AI agent an email address?

Install with npm install -g mails-agent (or pip install mails-agent for Python), then visit mails0.com to claim a free mailbox. For Claude Code, run npx mails-skills. For MCP clients, use npx mails-agent-mcp.

Can AI agents extract verification codes from emails?

Yes. mails0 automatically extracts 4-8 character verification codes from email subject and body. It supports English, Chinese, Japanese, and Korean. Use mails code --to [email protected] to wait for a code.

What are the send limits?

100 sends/day per mailbox by default, reset at UTC midnight. Self-hosted deployments can raise the cap via the DAILY_SEND_LIMIT env var. Inbound email has no cap. See Limits & quotas.

How does outbound deliverability work?

Outbound uses Resend, which manages SMTP infrastructure and IP reputation. You bring and verify your sending domain with SPF and DKIM. Inbound goes directly through Cloudflare Email Routing — no third party.

Is mails0 free and open source?

Yes. mails0 is MIT licensed and fully open source on GitHub. The Cloudflare free tier covers Workers, D1 database, R2 storage, and Email Routing, so there is no cost to self-host.

How is mails0 different from AgentMail?

AgentMail is a hosted SaaS service with usage-based pricing. mails0 is open source (MIT), runs on your own Cloudflare account, and is free on the Cloudflare free tier. You own your data, can audit the code, and have no vendor lock-in. See full comparison.