AI/TLDR

Agentic Inbox

Self-hosted email client with a built-in AI agent, running entirely on Cloudflare Workers

Assistants & ChatbotsOpen source
Updated
16 Apr 2026
Language
TypeScript
License
Apache-2.0
$npm install

What's new

16 Apr 2026

Cloudflare opened Email for Agents in public beta — Workers-based agents can send and receive mail natively with an SDK onEmail hook, HMAC-signed reply routing and Durable Objects state. Agentic Inbox is the reference application published alongside it.

Overview

Agentic Inbox is an open-source email client that runs on your own Cloudflare account. Incoming mail arrives through Cloudflare Email Routing, each mailbox lives in its own Durable Object with a SQLite database, attachments go to R2, and the whole thing — API, server-side rendering and UI — is served by a single Hono Worker. The result is a full webmail app with a rich-text composer, reply and forward threading, folders, search and attachments, without a mail server to operate.

What makes it more than a webmail client is the agent panel beside the message list. Built on the Cloudflare Agents SDK (`AIChatAgent`) and Workers AI, the agent has nine email tools for reading, searching, drafting and sending. It can auto-draft a reply the moment a message lands, keep a persistent chat history per mailbox, take a custom system prompt, and stream markdown responses with its tool calls visible. Sending always requires explicit confirmation.

The project accompanies Cloudflare's Email for Agents launch and doubles as the reference application for it: it exercises Email Routing for inbound, Email Service for outbound, Durable Objects for per-mailbox state, and an MCP server at `/mcp` so external tools such as Claude Code or Cursor can operate on a mailbox. Cloudflare Access is the trust boundary — the app refuses to run in production without it, and any user who passes the Access policy can reach every mailbox in the deployment.

What it does

  • Full email client on Cloudflare Workers: send and receive via Email Routing with threading, folders, search and attachments
  • Per-mailbox isolation — every mailbox is its own Durable Object with SQLite storage, with attachments in R2
  • Built-in AI agent side panel with nine email tools for reading, searching, drafting and sending
  • Auto-draft on new mail: the agent reads inbound messages and prepares a reply, always requiring explicit confirmation before sending
  • Per-mailbox custom system prompts, persistent chat history, streaming markdown and visible tool calls
  • MCP server at /mcp so external AI tools can operate on mailboxes
  • Cloudflare Access JWT validation enforced outside local development

Getting started

Agentic Inbox deploys to your own Cloudflare account. You need a Cloudflare account with a domain, Email Routing enabled for receiving, Email Service enabled for sending, Workers AI enabled for the agent, and Cloudflare Access configured for any deployed environment. The Deploy button is only the first half of setup — the post-deploy steps are required.

Run it locally first

Install dependencies and start the dev server to see the app before you deploy.

bashbash
npm install
npm run dev

Configure your domain and storage

Set your domain in wrangler.jsonc, then create the R2 bucket the app expects for attachments.

bashbash
wrangler r2 bucket create agentic-inbox

Deploy to Cloudflare

Deploying provisions R2, Durable Objects and Workers AI. You can also use the Deploy to Cloudflare button in the README, which prompts for the DOMAINS value — the domain you want to receive mail for.

bashbash
npm run deploy

Turn on Cloudflare Access

Enable one-click Cloudflare Access on the Worker under Settings > Domains & Routes. The modal shows POLICY_AUD and TEAM_DOMAIN — set both as Worker secrets. The app intentionally refuses to serve production traffic without Access, so your inbox is never exposed to the internet.

Wire up mail routing and create a mailbox

In the Cloudflare dashboard, open your domain's Email Routing and create a catch-all rule forwarding to this Worker. Enable Email Service so the Worker gets the send_email binding for outbound mail. Then visit the deployed app and create a mailbox for any address on your domain.

Commands and code are distilled from the project's own documentation — always check the official repo for the latest.

When to use it

  • Run a private, self-hosted inbox on your own domain with no mail server and no third-party mail provider reading your messages
  • Give an agent a real mailbox so it can triage inbound mail and prepare drafts you approve before anything is sent
  • Use it as a working reference for Cloudflare's Agents SDK, Email Routing and Durable Objects when building your own email-driven agent
  • Expose a mailbox over MCP so a coding agent or desktop assistant can search and draft mail as part of a larger workflow

How Agentic Inbox compares

Agentic Inbox alongside other open-source assistants & chatbots tools AI/TLDR tracks, ranked by GitHub stars.

ToolStarsWhat it does
OpenClaw★ 390kOpenClaw is a self-hosted personal AI assistant that answers you on WhatsApp, Telegram, Slack, Discord, and many other channels, with voice and a live visual canvas.
Hermes Agent★ 246kA self-improving personal AI agent from Nous Research that builds skills from experience, remembers across sessions, and reaches you on Telegram, Discord, Slack, and more.
Odysseus★ 87.3kA self-hosted AI workspace that puts chat, agents, deep research, documents, email, notes, tasks and calendar behind one Docker Compose stack, over local or API models.
CowAgent★ 47kA self-hosted assistant that plans and executes tasks with built-in file, terminal, browser and search tools, and answers across a web console plus a dozen messaging platforms.
AstrBot★ 40.6kAn all-in-one agent chatbot platform that puts LLM conversations, tools, knowledge bases and a plugin marketplace inside messaging apps like Telegram, Slack, Discord, QQ and Feishu.
OpenHuman★ 39.8kA local-first desktop personal AI for macOS, Windows and Linux that keeps a compressed memory tree on your machine and orchestrates checkpointed research and automation workflows.
MindsHub★ 39.7kAn agent workspace for knowledge work and software development that runs swappable open-source agent harnesses against your choice of frontier or open models.
Agentic Inbox★ 7.7kSelf-hosted email client with a built-in AI agent, running entirely on Cloudflare Workers