agentic-inbox README

The project's README from github.com/cloudflare/agentic-inbox. As one markdown file: README.md.

Agentic Inbox

A self-hosted email client with an AI agent, running entirely on Cloudflare Workers

Agentic Inbox lets you send, receive, and manage emails through a modern web interface -- all powered by your own Cloudflare account. Incoming emails arrive via Cloudflare Email Routing, each mailbox is isolated in its own Durable Object with a SQLite database, and attachments are stored in R2.

An AI-powered Email Agent can read your inbox, search conversations, and draft replies -- built with the Cloudflare Agents SDK and Workers AI.

Agentic Inbox screenshot

Read the blog post to learn more about Cloudflare Email Service and how to use it with the Agents SDK, MCP, and from the Wrangler CLI: Email for Agents.

How to setup

Important: Clicking the 'Deploy to Cloudflare' button is only one part of the setup. You must follow the After deploying steps as well. For a full step-by-step guide with screenshots, refer to this comment: https://github.com/cloudflare/agentic-inbox/issues/4#issuecomment-4269118513

To set up

  1. Deploy to Cloudflare. The deploy flow will automatically provision R2, Durable Objects, and Workers AI. You'll be prompted for DOMAINS, which is the domain (yourdomain.com) you want to receive emails for ([email protected]).

    Deploy to Cloudflare

  2. Configure Cloudflare Access -- Enable one-click Cloudflare Access on your Worker under Settings > Domains & Routes. The modal will show your POLICY_AUD and TEAM_DOMAIN values. TEAM_DOMAIN can be either your Access team URL or the full .../cdn-cgi/access/certs URL. You must set these as secrets for your Worker.

  3. Set up Email Routing -- In the Cloudflare dashboard, go to your domain > Email Routing and create a catch-all rule that forwards to this Worker

  4. Enable Email Service -- The worker needs the send_email binding to send outbound emails. See Email Service docs

  5. Create a mailbox -- Visit your deployed app and create a mailbox for any address on your domain (e.g. [email protected])

Troubleshooting Access

  1. If you see Invalid or expired Access token, that usually means POLICY_AUD or TEAM_DOMAIN secrets are incorrect.
  2. If you see Cloudflare Access must be configured in production, this application is intentionally enforcing Cloudflare Access so your inbox is not exposed to anyone on the internet.

Features

Stack

Getting Started

npm install
npm run dev

Configuration

  1. Set your domain in wrangler.jsonc
  2. Create an R2 bucket named agentic-inbox: wrangler r2 bucket create agentic-inbox

Deploy

npm run deploy

Prerequisites

Any user who passes the shared Cloudflare Access policy can access all mailboxes in this app by design. This includes the MCP server at /mcp -- external AI tools (Claude Code, Cursor, etc.) connected via MCP can operate on any mailbox by passing a mailboxId parameter. There is no per-mailbox authorization; the Cloudflare Access policy is the single trust boundary.

Architecture

┌──────────────┐     ┌──────────────────┐     ┌─────────────────┐
│   Browser    │────>│  Hono Worker     │────>│  MailboxDO      │
│  React SPA   │     │  (API + SSR)     │     │  (SQLite + R2)  │
│  Agent Panel │     │                  │     └─────────────────┘
└──────┬───────┘     │  /agents/* ──────┼────>┌─────────────────┐
       │             │                  │     │  EmailAgent DO  │
       │ WebSocket   │                  │     │  (AIChatAgent)  │
       └─────────────┤                  │     │  9 email tools  │
                     │                  │────>│  Workers AI     │
                     └──────────────────┘     └─────────────────┘

License

Apache 2.0 -- see LICENSE.

agentic-inbox (cloudflare/agentic-inbox)

Searching Database…

Что это такое?Agentic Inbox — это почтовый клиент, который вы размещаете у себя, со встроенным ИИ-агентом. Он работает полностью в вашем собственном аккаунте Cloudflare и использует Cloudflare Workers, Durable Objects, хранилище R2 и Workers AI.
Как это запустить?Нажмите кнопку 'Deploy to Cloudflare': она автоматически подключит R2, Durable Objects и Workers AI. Затем нужно вручную выполнить шаги после развёртывания: настроить Cloudflare Access, создать правило catch-all в Email Routing, включить Email Service и создать почтовый ящик.
Что нужно иметь до развёртывания?Аккаунт Cloudflare со своим доменом, включённый Email Routing для получения писем, включённый Email Service для отправки и включённый Workers AI, чтобы агент мог работать.
Полностью ли настраивает приложение нажатие 'Deploy to Cloudflare'?Нет — развёртывание только создаёт инфраструктуру. Шаги после развёртывания всё равно нужно выполнить. Кроме того, Cloudflare Access обязателен: если он не настроен, приложение откажется запускаться в продакшене.
Может ли любой, кто проходит мою политику Cloudflare Access, увидеть все почтовые ящики?Да — авторизации для каждого ящика отдельно нет, поэтому любой пользователь, прошедший общую политику Access (в том числе внешние ИИ-инструменты, подключённые через эндпоинт /mcp), может получить доступ ко всем ящикам в приложении.
Что на самом деле умеет встроенный ИИ-агент?У него есть 9 инструментов для работы с почтой: чтение, поиск, составление и отправка сообщений. Он также автоматически готовит черновик ответа на новые входящие письма, а перед фактической отправкой всегда требует явного подтверждения.
Можно ли подключить к моему почтовому ящику внешние ИИ-инструменты, например Claude Code или Cursor?Да — приложение запускает MCP-сервер по адресу /mcp, поэтому внешние ИИ-инструменты могут подключаться и работать с любым ящиком, передавая параметр mailboxId.
Зачем каждому ящику отдельный Durable Object?Для изоляции: каждый ящик работает в своём Durable Object со своей базой данных SQLite, а вложения хранятся отдельно в R2.
Какая ИИ-модель работает внутри агента?Агент построен на Cloudflare Agents SDK и использует модель Workers AI @cf/moonshotai/kimi-k2.5.
Creator
cloudflare
Size
3.4 MB
Stars
8.4K
Updated
CommitApr 17
Age
6mo
Commits · 90 Days