🔴 Advanced ⚙️ Type: Self-Hosted AI Email Client / Reference App 💸 Free & Open Source (Apache-2.0) ⭐ Trending on GitHub
What is Agentic Inbox?
Agentic Inbox is an open-source, self-hosted email client and AI agent harness created by Cloudflare. It is designed to run entirely on the Cloudflare Workers ecosystem without relying on traditional servers or third-party databases. Instead of just acting as a simple auto-responder, it gives an AI agent a durable, persistent memory of entire email threads, allowing it to carry on intelligent, long-term conversations.
It acts as a masterclass “reference application” showcasing Cloudflare’s newest serverless primitives. Incoming emails arrive via Cloudflare Email Routing. Each mailbox is highly isolated inside its own Durable Object (with its own SQLite database). Attachments are saved instantly to R2 storage, and outbound messages utilize the Cloudflare Email Service.
The frontend provides a modern web interface where you can read, search, and manually reply to emails. Alongside it runs a built-in AI assistant. When a new email arrives, the agent can autonomously read it, search past conversations for context, and generate a draft reply. Crucially, the system requires human confirmation before hitting “send,” keeping you in control of the agent’s actions.
Who is it for?
- Cloudflare Developers who want a practical, production-ready reference application showing how to stitch together Durable Objects, R2, SQLite, and the new Agents SDK into a cohesive product.
- Customer Support Teams looking to self-host a private, intelligent support inbox where an AI can ingest technical queries and draft responses securely based on past ticket histories.
- AI Automation Builders who need an email platform with a native Model Context Protocol (MCP) server built-in, allowing external coding assistants (like Cursor or Claude Code) to read and operate their mailboxes.
- Privacy-Conscious Homelabbers wanting full control over their email data and AI tools without paying monthly per-seat fees to SaaS helpdesk platforms.
What makes it special?
- Zero-Server Architecture — It requires absolutely zero traditional server provisioning. It scales automatically to zero when inactive and scales infinitely under load, powered entirely by Cloudflare’s edge network.
- Per-Mailbox Isolation — Because every single inbox is spun up as an independent Durable Object, state and memory never leak between different mailboxes.
- Built-in MCP Server — The app natively exposes an MCP endpoint (
/mcp). This means you can plug your external terminal tools into the inbox, allowing your local AI to execute tools like searching threads, reading drafts, and sending emails on your behalf. - Secure by Default — The entire web interface and API layer are intentionally locked behind Cloudflare Access (Zero Trust). There is no public login page; you authenticate securely through your designated identity provider.
Requirements before you start
Because this app integrates deeply with Cloudflare’s infrastructure, you must have an active Cloudflare account and a registered domain name:
- A Custom Domain — Managed within your Cloudflare account to handle the DNS records for Email Routing.
- Paid Workers Plan — While inbound routing is free, sending outbound emails via Cloudflare Email Service requires a paid Workers plan (minimum $5/month).
- Cloudflare Zero Trust (Access) — Required to secure the application in a production environment.
- Wrangler CLI — The Cloudflare command-line tool installed via Node.js to configure and deploy the project.
Step-by-step installation
Step 1 — Clone the Repository
Open your terminal and clone the official repository to your local machine:
git clone https://github.com/cloudflare/agentic-inbox.git
cd agentic-inbox
npm install
Step 2 — Provision R2 Storage
The application needs an R2 bucket to store email attachments (like PDFs and images). Create it using the Wrangler CLI:
wrangler r2 bucket create agentic-inbox
Next, open the wrangler.jsonc file in your code editor and update the domain variables to match your custom domain (e.g., yourdomain.com).
Step 3 — Deploy to Cloudflare
Push the code to your Cloudflare account. This command will automatically provision the necessary Durable Objects and Workers AI bindings:
npm run deploy
Step 4 — Configure Cloudflare Routing and Access
Once deployed, you must wire up the networking in your Cloudflare Dashboard:
- Email Routing: Go to your domain’s Email Routing settings. Create a “Catch-all” rule and set the action to “Send to a Worker,” selecting your newly deployed Agentic Inbox worker.
- Outbound Sending: Ensure the Email Service is enabled on your account so the
send_emailbinding functions correctly. - Cloudflare Access: Navigate to your Worker’s Settings > Domains & Routes, and enable “One-click Cloudflare Access.” This will generate a
POLICY_AUDandTEAM_DOMAIN. You must add these exact values as secrets to your Worker for the authentication gateway to function.
Finally, visit your deployed app URL, authenticate via Access, and create your first AI-managed mailbox!
Common errors and fixes
| Error | What it means | How to fix it |
|---|---|---|
Cloudflare Access must be configured in production | The application has an explicit security feature that refuses to load if you have not placed it behind a Cloudflare Access policy, preventing public exposure of your inbox. | Go to the Cloudflare Dashboard, enable Access for the Worker, copy the resulting POLICY_AUD and TEAM_DOMAIN values, and add them as encrypted secrets to your Worker via Wrangler. |
| Invalid or expired Access token | You are trying to log into the web interface, but the JWT token validation failed because your Worker secrets don’t match the current Access policy. | Turn Cloudflare Access off and back on for the Worker to force a regeneration of the credentials, then update the Worker secrets to match the newly generated values. |
| Agent drafts replies but outbound emails fail to send | The send_email binding is failing, likely because you are on the free tier of Cloudflare Workers. | Cloudflare Email Service for outbound sending requires a Paid Workers plan. Upgrade your account to enable the transactional sending API. |
Free vs Paid comparison
| Feature | Agentic Inbox (Self-Hosted on CF) | Commercial AI Helpdesks (e.g., Zendesk AI / AgentMail) |
|---|---|---|
| Cost | $5/mo (Cloudflare Workers minimum plan) | $50 to $200+ per user/month |
| Architecture | 🟢 Fully Serverless (Durable Objects) | Legacy Cloud Instances |
| MCP Integration | ✅ Native (Connect local AI tools directly) | ❌ Rarely supported out-of-the-box |
| Setup Required | ⚠️ High (Requires CLI deployment & routing setup) | 🟢 Instant turn-key onboarding |
Bottom line: Agentic Inbox is a brilliant showcase of Cloudflare’s serverless AI capabilities. If you are a developer looking to understand how to build resilient, stateful agents using Durable Objects and the Agents SDK, this repository is required reading. While it takes some technical effort to configure the DNS routing and Zero Trust policies, the end result is a highly secure, infinitely scalable AI email client running for pennies a month.
Alternatives — 3 similar tools
1. AgentMail.to
If you don’t want to build and manage the Cloudflare infrastructure yourself, AgentMail is a managed platform specifically designed to give AI agents persistent inboxes. It handles the threading, MIME parsing, and attachment storage out of the box, offering a clean REST API and webhooks for your external agents to interact with.
2. OmniDock
Another excellent open-source project built on the Cloudflare ecosystem. OmniDock focuses heavily on providing a multi-domain email dashboard for teams. It handles Email Routing, D1 databases, and R2 file management in a unified interface. It is less focused on autonomous AI agents and more focused on providing a human-usable private support inbox.
🔗 github.com/angelapro5786/omnidock
3. Mailtrap (with MCP)
If you simply need an API to allow your existing AI agent to send outbound emails (rather than hosting a full receiving inbox), Mailtrap offers an exceptional developer experience. They provide official MCP servers and Agent Skills right out of the box, allowing your AI to autonomously fetch sending logs, track bounces, and debug delivery issues.
🚀 Want more free AI tools like this?
We find, test, and write setup guides for the best free and open-source AI tools — so you don’t have to dig through GitHub yourself.Browse Free AI Tools at globalaiforce.com/shop →
📸 Follow us for daily AI tool tips and tutorials: instagram.com/globalaiforce