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.
npm install -g mails-agent
Four guarantees.
Contain the blast radius and preserve every message — even when the agent misbehaves.
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.
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.
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.
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.
Three commands to first email.
Claim a mailbox, send from it, wait for a verification code. Same surface in CLI, Python, or MCP.
Everything an agent needs.
Send, receive, search, extract, observe. One API, six first-class primitives.
Send and receive
Full email with CC/BCC, In-Reply-To threading, and attachments. Receive via Cloudflare Email Routing with raw-first R2 persistence.
Search and extract
Full-text search (FTS5) across inbox. Automatic verification code extraction for EN, ZH, JA, and KO. Long-poll until code arrives.
Real-time events
Webhooks with HMAC-SHA256 signature verification. SSE streams for message.received. Auto-labeling: newsletter, notification, code, personal.
Structured extraction
Extract orders, shipping, calendar events, and receipts from emails. Deterministic parsers — no LLM cost, no hallucinations.
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.
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-agentpip install mails-agentnpx mails-skillsnpx mails-agent-mcpQuestions.
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.