# Agentic Inbox

> A self-hosted, open-source email client with a built-in AI agent that runs entirely on Cloudflare Workers, using Durable Objects, R2, and Workers AI.

Agentic Inbox is an open-source, self-hosted email client built and published by Cloudflare under the Apache 2.0 license. It runs entirely on Cloudflare Workers infrastructure and pairs a full-featured web email interface with an AI agent capable of reading, searching, and drafting replies. The project was created to demonstrate Cloudflare's Email Service, Agents SDK, and MCP capabilities working together.

## What It Is

Agentic Inbox is a self-deployable email application that handles both inbound and outbound email through Cloudflare Email Routing. Each mailbox is isolated in its own Durable Object backed by a SQLite database, with attachments stored in R2. An AI-powered Email Agent — built with the Cloudflare Agents SDK and Workers AI — runs as a side panel inside the interface, offering nine email tools for reading, searching, drafting, and sending messages. The project is explicitly positioned as a reference implementation and demo app for Cloudflare's "Email for Agents" blog post and ecosystem.

## Architecture and Stack

The application follows a clean separation between frontend, backend, and AI agent layers:

- **Frontend:** React 19, React Router v7, Tailwind CSS, Zustand state management, TipTap rich-text editor, and `@cloudflare/kumo`
- **Backend:** Hono framework on Cloudflare Workers, Durable Objects (SQLite) for per-mailbox storage, R2 for attachments, and Cloudflare Email Routing for inbound delivery
- **AI Agent:** Cloudflare Agents SDK (`AIChatAgent`), AI SDK v6, Workers AI using the `@cf/moonshotai/kimi-k2.5` model, with streaming markdown responses and tool call visibility
- **Auth:** Cloudflare Access JWT validation, required in all non-local environments

The architecture diagram in the README shows the browser React SPA communicating with a Hono Worker via WebSocket for the agent panel, which in turn routes to both a `MailboxDO` (SQLite + R2) and an `EmailAgent` Durable Object running Workers AI.

## Key Features

- Full email client with rich-text composer, reply/forward threading, folder organization, search, and attachment support
- Per-mailbox isolation via Durable Objects with SQLite storage
- Built-in AI agent side panel with nine email tools
- Auto-draft on new email: the agent reads inbound messages and generates draft replies, always requiring explicit user confirmation before sending
- Custom system prompts per mailbox, persistent chat history, and streaming markdown responses
- MCP server exposed at `/mcp`, allowing external AI tools such as Claude Code and Cursor to operate on mailboxes via a `mailboxId` parameter

## Setup Path

Deployment is handled via a "Deploy to Cloudflare" button that automatically provisions R2, Durable Objects, and Workers AI. After deploying, users must:

1. Configure Cloudflare Access (one-click Access for Workers) and set `POLICY_AUD` and `TEAM_DOMAIN` secrets
2. Set up Email Routing with a catch-all rule forwarding to the Worker
3. Enable the `send_email` binding for outbound email
4. Create at least one mailbox for an address on their domain

The README notes that Cloudflare Access is the single trust boundary — any user who passes the shared Access policy can access all mailboxes, including the MCP server endpoint.

## Why It Matters

Agentic Inbox demonstrates a practical pattern for building AI-native email workflows entirely on serverless edge infrastructure, without any third-party email SaaS. It also serves as a concrete reference for integrating Cloudflare's Agents SDK, MCP, and Workers AI into a real application. The repository accumulated over 6,600 GitHub stars and 841 forks shortly after its April 2026 creation, reflecting significant community interest in the self-hosted AI email pattern.

## Features
- Full email client with send/receive via Cloudflare Email Routing
- Rich text composer with reply/forward threading
- Folder organization, search, and attachment support
- Per-mailbox isolation using Durable Objects with SQLite
- AI agent side panel with 9 email tools
- Auto-draft replies on inbound email with explicit confirmation required
- Custom system prompts per mailbox
- Persistent chat history with streaming markdown responses
- Tool call visibility in agent panel
- MCP server at /mcp for external AI tool integration
- Cloudflare Access JWT authentication
- One-click Deploy to Cloudflare button

## Integrations
Cloudflare Workers, Cloudflare Email Routing, Cloudflare Durable Objects, Cloudflare R2, Cloudflare Workers AI, Cloudflare Agents SDK, Cloudflare Access, Hono, React 19, React Router v7, Tailwind CSS, Zustand, TipTap, AI SDK v6, MCP (Model Context Protocol), Claude Code, Cursor, Wrangler CLI

## Platforms
WEB, CLI, API

## Pricing
Open Source

## Version
main

## Links
- Website: https://github.com/cloudflare/agentic-inbox
- Documentation: https://developers.cloudflare.com/agents/
- Repository: https://github.com/cloudflare/agentic-inbox
- EveryDev.ai: https://www.everydev.ai/tools/agentic-inbox
