MCP Inbox for Cloudflare
Provides an agent-centric email inbox running on Cloudflare, using Cloudflare Email Routing, R2, D1, and Queues to receive, store, normalize, and expose messages via MCP tools for listing, reading, claiming, completing, and replying.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MCP Inbox for Cloudflarelist my unread messages"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MCP Inbox for Cloudflare
A small, agent-centric email inbox that runs entirely on Cloudflare. Incoming mail is stored and normalized, then exposed to authenticated agents through a stateless MCP endpoint.
No local daemon or always-on computer is required. Local files are only source code, tests, and deployment tooling.
What it does
Receives one exact address through Cloudflare Email Routing.
Stores the original RFC 822 message privately in R2.
Parses useful metadata, plain text, links, and threading headers into D1.
Uses a Queue to keep parsing outside the inbound email request.
Lets Codex and Hermes independently list, read, claim, and complete messages over MCP.
Builds correctly threaded replies while leaving outbound delivery disabled by default.
This is deliberately not a webmail application. Cloudflare's dashboards expose infrastructure and logs, but there is no human inbox UI in this project.
Related MCP server: NornWeave
Data flow
Internet email
-> Cloudflare Email Routing (one exact address)
-> Worker email handler
-> private raw message in R2
-> Cloudflare Queue
-> Worker queue handler
-> normalized message in D1
-> authenticated /mcp endpoint
-> agentMCP tools
Tool | Result |
| Lists recent normalized messages, optionally by status. |
| Reads one message by its internal UUID. |
| Atomically leases the oldest available message to the authenticated agent. |
| Completes a message leased by that same agent. |
| Builds RFC threading headers; sending remains off unless explicitly wired and enabled. |
Email is untrusted external input. MCP results repeat that warning so agents do not treat email text or links as instructions.
Quick start
Requirements: Node.js 22.18 or a supported newer release, a Cloudflare account, an active R2 subscription, and a domain using Cloudflare DNS. The exact Node range is in package.json.
npm ci
npx wrangler login
npx wrangler whoami
npm run checkBefore making DNS changes, check whether the domain already receives mail through another provider. Cloudflare Email Routing changes the domain's MX records and cannot share the same apex MX configuration with an external inbound provider.
The complete resource-creation, deployment, DNS-safety, credential, Email Routing, and end-to-end verification sequence is in Self-hosting on Cloudflare. Follow it from the beginning for a new account.
Agent configuration
Codex:
read -rsp 'Codex mailbox token: ' AGENTS_MAIL_CODEX_TOKEN
echo
export AGENTS_MAIL_CODEX_TOKEN
codex mcp add agents_mail \
--url https://YOUR-WORKER.YOUR-SUBDOMAIN.workers.dev/mcp \
--bearer-token-env-var AGENTS_MAIL_CODEX_TOKENHermes:
For Hermes's default profile, place the YAML in ~/.hermes/config.yaml and provide AGENTS_MAIL_HERMES_TOKEN through an owner-readable ~/.hermes/.env file.
mcp_servers:
agents_mail:
url: "https://YOUR-WORKER.YOUR-SUBDOMAIN.workers.dev/mcp"
headers:
Authorization: "Bearer ${AGENTS_MAIL_HERMES_TOKEN}"
tools:
resources: false
prompts: falseCodex and Hermes are optional clients; this repository does not install either one. Restart an installed agent after changing its environment or MCP configuration. Any compatible Streamable HTTP MCP client can use the endpoint with one of the two bearer credentials.
Cost
At low message volume, this design is expected to fit within Cloudflare's free allowances: Email Routing is free, and Workers, D1, R2, and Queues each have free usage tiers. R2 is metered beyond its allowance rather than hard-capped at $0. Check the current Workers, D1, R2, and Queues pricing before deploying.
Outbound delivery is intentionally disabled. Cloudflare's arbitrary-recipient sending path requires a Workers Paid plan; see Email Service pricing.
Development
npm run typecheck
npm run lint
npm test
npm run dry-run
npm run startup-checkThe integration suite runs the real Worker handlers against Wrangler's local D1, R2, Queue, and MCP implementations. It does not introduce a mock boundary.
See docs/ARCHITECTURE.md for constraints and tradeoffs and docs/OPERATIONS.md for the runbook.
This server cannot be installed
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseAqualityDmaintenanceEmail infrastructure for AI agents — create inboxes, send/receive email, search messages, and manage threads via MCP tools.Last updated10182MIT
- Alicense-qualityAmaintenanceOpen-source, self-hosted Inbox-as-a-Service API for AI agents. It enables agents to manage email inboxes, send/receive emails, search messages, and wait for replies via REST or MCP.Last updated26Apache 2.0
- Flicense-qualityBmaintenanceAn MCP server that provides email sending, reading, replying, and searching capabilities through a Cloudflare Worker, allowing an AI assistant to manage an independent mailbox.Last updated
- Alicense-qualityBmaintenanceA Gmail MCP server running on Cloudflare Workers that enables reading, searching, labeling, drafting, sending, and managing Gmail messages, including fetching raw attachment bytes, with per-user OAuth authorization.Last updated226MIT
Related MCP Connectors
Hosted email MCP for AI agents with inboxes, send/receive, memory, recovery, and credits.
Cloudflare Workers MCP server: email-validator
Shipmail MCP server for AI agent custom-domain email inboxes with REST API and webhooks.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/harpreetchima/mcp-inbox-cloudflare'
If you have feedback or need assistance with the MCP directory API, please join our Discord server