Skip to content
Open Source·8 min read·

Agentic Inbox by Cloudflare: Self-Host an AI Email Assistant for $5/Month (2026 Guide)

Agentic Inbox is Cloudflare's open source, self-hosted AI email client. It runs serverless on Workers with Durable Objects, R2, and a built-in MCP server for AI agents. No per-seat fees.

By Abdul Rauf Azhar

Agentic Inbox by Cloudflare: Self-Host an AI Email Assistant for $5/Month (2026 Guide)

AI email assistants exist, but they come with problems. Commercial helpdesk platforms like Zendesk AI charge $50 to $200+ per user per month. They lock your email data on their servers, limit how much control your AI agent has, and rarely support direct integration with local coding tools. For small teams and solo builders, the cost is hard to justify.

Agentic Inbox, created by Cloudflare, is an open source, self-hosted email client and AI agent harness that runs entirely on the Cloudflare Workers ecosystem. It costs as little as $5/month (the minimum Workers plan), scales to zero when inactive, and includes a built-in MCP server so your local AI coding agents can read and operate your mailbox directly.

In this guide, you'll learn what Agentic Inbox is, who it's for, and how to deploy it on your own Cloudflare account.

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 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 Agentic Inbox different from commercial AI helpdesks?

  • 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. You pay nothing when nobody is emailing you.
  • Per-mailbox isolation: Because every single inbox is spun up as an independent Durable Object, state and memory never leak between different mailboxes. Each mailbox has its own SQLite database.
  • Built-in MCP server: The app natively exposes an MCP endpoint at /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.
  • Costs pennies: The only required cost is the $5/month Cloudflare Workers paid plan (needed for outbound email sending). Compare that to $50 to $200+ per user per month for commercial AI helpdesk platforms.

What you need 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 (for example, 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:

  1. 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.
  2. Outbound sending: Ensure the Email Service is enabled on your account so the send_email binding functions correctly.
  3. Cloudflare Access: Navigate to your Worker's Settings > Domains and Routes, and enable "One-click Cloudflare Access." This will generate a POLICY_AUD and TEAM_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 how to fix them

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.

Agentic Inbox vs commercial AI helpdesks

Feature Agentic Inbox (self-hosted on Cloudflare) Commercial AI helpdesks (Zendesk AI, AgentMail)
Cost $5/month (Cloudflare Workers minimum) $50 to $200+ per user per month
Architecture Fully serverless (Durable Objects) Legacy cloud instances
MCP integration Native (connect local AI tools directly) Rarely supported out of the box
Data ownership You own everything (self-hosted) Stored on vendor's servers
Setup required High (requires CLI deployment and routing setup) Instant turnkey onboarding
Best for Developers and technical teams who want full control Non-technical teams who want zero setup

Bottom line: If you're paying for a commercial AI helpdesk and want to cut costs to $5/month while gaining full control over your email data, Agentic Inbox is the strongest open source option available. The MCP server integration means your local AI coding agents can directly read and operate your mailbox, which no commercial helpdesk offers out of the box. The setup requires some technical knowledge (CLI deployment, DNS routing, Zero Trust configuration), but the end result is a highly secure, infinitely scalable AI email client that costs pennies to run.

3 alternatives worth checking out

  • AgentMail (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.
  • OmniDock (github.com/angelapro5786/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.
  • Mailtrap (mailtrap.io): 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.

Found this guide useful? Check out more open source projects and free tools for developers on Sudo Scout.

Share:

Related posts