aliasflare
This MCP server lets an AI agent manage disposable email aliases and verification codes on the user's self-hosted aliasflare domain.
Create forwarding aliases, optionally with a readable note or exact local part/domain.
List and search aliases with enabled status and forwarded/blocked counts.
Enable or disable an alias to stop spam.
Retrieve the latest verification/OTP code received by an alias or across all aliases.
View recent mail activity metadata (sender, subject, code, direction) without message bodies.
Send real plain-text email from an alias, if outbound email is configured (Resend, Brevo, or Cloudflare Email Sending).
Optional outbound email provider used by the aliasflare MCP server to send replies and new messages from aliases; configured with a Resend API key.
aliasflare
Don't want to hand your real email to every website, and don't want to pay for an alias service? aliasflare is a self-hosted alias mailbox that runs on your own Cloudflare account's free tier.
Unlike SimpleLogin or addy.io, aliases are unlimited, you keep your own domain for free, and nothing lives on someone else's server. A different address for every website, all landing in your real inbox. Turn any of them off in one click when the spam starts. Reply as the alias, so your real address never leaks. Verification codes are pulled into the subject line, tracking pixels are stripped, and AI agents can create aliases and read codes through MCP.

Real output of aliasflare v0.2.0 run locally with demo data (example.com).
Why
SimpleLogin free | addy.io free | aliasflare | |
Aliases | 10 | unlimited on username, 10 shared | unlimited |
Your own domain | paid | paid | yes |
Bandwidth | unlimited | 10 MB / month | unlimited inbound |
Reply from alias | yes | paid | yes (optional: free Resend account, or Workers Paid) |
Your data | their servers | their servers | your Cloudflare account |
Cost | $0, then $36/yr | $0, then $12–36/yr | $0 |
Related MCP server: gmail-mcp
Features
Unlimited aliases on one or more of your domains. Create them in the dashboard, or just make one up when signing up —
anything@yourdomain.comis created on first mail (turn off withAUTO_CREATE=false).One-click disable. A disabled alias rejects mail as if it never existed.
Sender hidden, reply as alias. Each message arrives
From: "Shop (news at shop.com)" <shop.k3f9@yourdomain.com>with a privateReply-To. Hit reply in Gmail and the answer goes out from the alias; your real address is scrubbed from the body too.Send new mail from any alias (dashboard, API or MCP).
Verification codes detected in Chinese, English, Japanese, Korean and more, and put into the subject:
[482913] Your login code.Tracking pixels removed (1×1 images, hidden images, known trackers).
MCP server at
/mcp:create_alias,get_latest_code,list_aliases,set_alias_enabled,recent_messages,send_from_alias. Let your agent sign up for things without your inbox.Never loses mail. If rewriting fails for any reason the original is forwarded as-is.
Small and auditable. ~1,000 lines of plain JavaScript, one dependency (
postal-mime), D1 stores only metadata (no message bodies).
Deploy (about 5 minutes)
You need a domain on Cloudflare.
Email Routing on. Cloudflare Dashboard → your domain → Email → Email Routing → enable it (Cloudflare adds the MX records). Under Destination addresses, add your real inbox and click the verification link.
Click the button above. Cloudflare copies this repo to your GitHub, creates the D1 database and asks for:
DOMAIN— e.g.example.com(comma-separate several)DESTINATION— your verified real inboxADMIN_TOKEN— a long random password (openssl rand -hex 24)RESEND_API_KEY— optional, see below;noneto skip
Route mail to the Worker. Email Routing → Routing rules → Catch-all address → action Send to a Worker →
aliasflare→ enable.
Open your Worker's URL, log in with ADMIN_TOKEN, and create your first alias.
Replying for free
Receiving and forwarding to your own verified inbox is free on every Cloudflare plan. Sending to other people (replies, new mail) needs one of:
Resend (recommended, free 3,000 emails/month, 100/day): sign up at resend.com, add and verify your domain, create an API key, set it as
RESEND_API_KEY.Brevo (free, 300 emails/day): sign up at brevo.com, verify your sending domain (add the DNS records it gives you), create an API key, set it as
BREVO_API_KEY(optional, no need to fillnone). Used whenRESEND_API_KEYisn't set. Deliverability depends on your domain's reputation: a brand-new Brevo free account sending from a free subdomain (e.g.*.dpdns.org) may land in Outlook's junk folder or be rejected by Gmail. A domain you own and real, low-volume replies help.Cloudflare Email Sending on Workers Paid ($5/month, 3,000 emails included): onboard your domain under Email Sending and leave
RESEND_API_KEY=none.
Without either, everything except replying and sending works.
Manual deploy
git clone https://github.com/charleswei118/aliasflare && cd aliasflare
npm install
npx wrangler d1 create aliasflare # wrangler can also create it on first deploy
for s in DOMAIN DESTINATION ADMIN_TOKEN RESEND_API_KEY; do npx wrangler secret put $s; done
npm run deploy # applies migrations, then deploysThen do step 3 above.
Settings
Secrets: DOMAIN, DESTINATION, ADMIN_TOKEN, RESEND_API_KEY.
Variables in wrangler.toml:
Variable | Default | What it does |
|
| Create aliases on first incoming mail |
|
|
|
|
| Strip tracking pixels |
|
| Prefix the subject with a detected code |
|
| One-line header showing alias and real sender |
Use with AI agents (MCP)
{
"mcpServers": {
"aliasflare": {
"url": "https://aliasflare.<you>.workers.dev/mcp",
"headers": { "Authorization": "Bearer <ADMIN_TOKEN>" }
}
}
}Then: "Sign me up for the Notion newsletter with a new alias and confirm it." The agent calls create_alias(note="notion"), uses the address, then get_latest_code.
Local stdio MCP (Claude Desktop, Cursor, …)
If your client only speaks stdio, run the bundled bridge. It answers tools/list locally and forwards tool calls to your own Worker:
{
"mcpServers": {
"aliasflare": {
"command": "npx",
"args": ["-y", "github:charleswei118/aliasflare"],
"env": { "ALIASFLARE_URL": "https://aliasflare.<you>.workers.dev", "ALIASFLARE_TOKEN": "<ADMIN_TOKEN>" }
}
}
}A Dockerfile for the same bridge is included.
REST API
All endpoints need Authorization: Bearer <ADMIN_TOKEN>.
Method | Path | Body / query |
GET |
| |
GET |
|
|
POST |
|
|
PATCH |
|
|
DELETE |
| |
GET |
|
|
GET |
|
|
POST |
|
|
How it works
stranger ──▶ shop.k3f9@you.com ──▶ Worker ──▶ you@gmail.com
From: "Shop (news at shop.com)" <shop.k3f9@you.com>
Reply-To: reply+<token>@you.com
you@gmail.com ──▶ reply+<token>@you.com ──▶ Worker ──▶ stranger
From: shop.k3f9@you.comOnly mail from your DESTINATION (and not failing SPF/DMARC) may use a reply+ address.
Limits
Cloudflare Email Routing: 25 MiB per message. The catch-all rule means the 200-rule limit does not apply.
Free Workers plan: 100,000 requests/day and 10 ms CPU per invocation; very large messages with many attachments may exceed CPU on the free plan and fall back to plain forwarding.
Cloudflare Email Sending is in beta.
Development
npm test # node:test, uses node:sqlite as a D1 stand-in
npm run devTroubleshooting
Mail isn't arriving. Check Email Routing → Routing rules: the catch-all must be set to Send to a Worker →
aliasflareand enabled.Nothing is forwarded.
DESTINATIONmust be a verified address under Email Routing → Destination addresses.Replies fail or land in spam. Check
/api/config:outboundshould beresend,brevoorcloudflare. A brand-new sending domain has little reputation; use a domain you own and keep volume low.Alias rejected. It may be disabled, or
AUTO_CREATE=falseand the alias doesn't exist yet.Still stuck? Open an issue with what
/healthand/api/configreturn (never paste yourADMIN_TOKEN).
Hardening
Incoming mail never touches HTTP: Email Routing hands each message straight to the Worker's email() handler. The HTTP side only serves the admin UI, REST API and MCP, so you can lock it down without breaking mail:
Set
workers_dev = falseinwrangler.tomland serve the admin side only on a Custom Domain of yours (redeploy after the change). Preview/version URLs are a separate setting.Put that hostname behind Cloudflare Access (Zero Trust free tier), or add a WAF rate limiting rule on it. Both act before the Worker runs; requests blocked by WAF, DDoS protection or other security features don't count as Worker requests.
Worst case on the free plan: past 100,000 requests/day the Worker returns error 1027 until the counter resets at 00:00 UTC. It stops, it doesn't bill you.
License
MIT
Looking for an MCP gateway for Chinese public data? See web2mcp.
Available Tools
6 toolscreate_aliasCreate email aliasA
Create a new forwarding email alias on the user's own domain, e.g. for signing up to a website without revealing the real address. Mail sent to the alias is forwarded to the user's inbox. Returns the new address. Pass note (the site or purpose, e.g. "github") to get a readable address like github.k3f9@domain; omit it for a random one.
Inputs: note, local, domain.
get_latest_codeGet latest verification codeARead-only
Return the most recent one-time verification code (OTP) received by an alias within the last since_minutes minutes, extracted from the email subject/body. Use right after triggering a sign-up or login email. Returns null code if none arrived yet; wait and call again.
Inputs: alias, since_minutes.
list_aliasesList aliasesARead-only
List the user's aliases, newest first, with note, enabled state and forwarded/blocked counts. Optional query filters by address or note.
Inputs: limit, query.
recent_messagesRecent mail logARead-only
Show recent mail activity (sender, subject, code, direction) — metadata only, no bodies. Optional alias filter.
Inputs: alias, limit.
send_from_aliasSend email from aliasA
Send a plain-text email to someone FROM one of the user's aliases, so the real address stays hidden. Requires RESEND_API_KEY, BREVO_API_KEY or Cloudflare Email Sending. This sends real mail: only call it when the user asked to send this exact message.
Inputs: to (required), text (required), alias (required), subject (required).
set_alias_enabledEnable or disable aliasAIdempotent
Turn an alias off (mail to it is rejected as if it never existed — use this to stop spam) or back on.
Inputs: alias (required), enabled (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 6 tools
Each tool targets a distinct resource+action: creating vs. sending vs. reading aliases, reading OTP codes vs. reading message metadata. The descriptions explicitly separate the two read tools (list_aliases returns aliases, recent_messages returns mail activity), so an agent can select the right one unambiguously.
Five of six tools follow a verb_noun convention (send_from_alias, create_alias, get_latest_code, list_aliases, set_alias_enabled). 'recent_messages' is a bare noun phrase rather than a verb-led name, a minor deviation in an otherwise consistent set.
Six tools map cleanly onto the alias-management domain (create, list, toggle, send, receive-code, activity), with no redundant or filler operations. The scope is tight and every tool earns its place.
The lifecycle is mostly covered (create, list, enable/disable, send, OTP retrieval, activity), but there is no delete/remove alias operation and no way to read a full message body — recent_messages is metadata-only, which can be a dead end when a code isn't extracted correctly. These are notable gaps for an alias/mail management surface.
Maintenance
Related MCP Connectors
Free email inboxes for AI agents: self sign-up, receive email and verification codes.
Email inboxes for AI agents: wait for mail, pull out verification codes and links, reply. Free.
Email for agents: domains, aliases, IMAP mailboxes, DNS, sending and webhooks via one API key.
Free disposable email inboxes for AI agents. Get verification codes and links. No API key needed.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceDeploys a self-hosted Cloudflare email service providing short-lived mailboxes with a JSON API and MCP endpoint for automated testing and AI agent signup, verification, and magic-link flows.1MIT
- AlicenseNot gradedqualityNot gradedmaintenanceEnables AI assistants to manage Gmail accounts, including searching, reading, sending, replying, forwarding, attachments, labels, and drafts across multiple mailboxes on a self-hosted Cloudflare Worker.MIT
- AlicenseNot gradedqualityNot gradedmaintenanceEnables AI assistants to search, read, send, reply, forward, and organize Gmail messages and threads across multiple Google accounts via a self-hosted Cloudflare Worker.MIT
- AlicenseNot gradedqualityBmaintenanceAgent-operated email in one Cloudflare Worker.MIT