littlebird-mail
Allows sending and receiving emails through Cloudflare Email Routing and Workers, with tools for inbox management, replying, searching, and statistics.
Click on "Deploy 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., "@littlebird-mailsend an email to support@example.com with subject 'Question' and body 'Need help'"
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.
littlebird-mail
Littlebird's independent mailbox - a Cloudflare Worker that acts as a remote MCP server for send, read, reply, and search.
This repo also carries bin/mail, the fleet's hardened AgentMail CLI (unrelated to the Worker itself) — see docs/fleet-mail-check.md.
What it does
Outbound: Sends email as
littlebird-mail@workslo.aivia Cloudflare'ssend_emailWorker binding. DKIM-signed, so it lands as Littlebird - not Shane.Inbound: Receives email via Cloudflare Email Routing, parses with
postal-mime, and stores in D1.MCP Tools: Six tools exposed over a stateless HTTP endpoint (
/mcp):send_email- Send mail as Littlebirdreply- Reply to an existing threadlist_inbox- Paginated inbox list, optional unread-only filterread_message- Full message body + marks as readsearch_inbox- Text search across subject, body, and frominbox_stats- Total and unread counts
Related MCP server: mail-mcp
Architecture
Stateless: No Durable Objects or session state. All persistence is D1.
Auth:
/mcpaccepts onlyAuthorization: Bearer <MCP_TOKEN>. Unauthenticated requests return a plain401; there is no OAuth provider, authorization flow, token exchange, dynamic registration, or OAuth metadata.Threading: Unified
messagestable withthread_idandin_reply_to. Replies attach to the parent thread.
Deploy
1. Domain setup (alive-node only)
Onboard
workslo.aito Cloudflare Email Service (Dashboard: Compute & AI > Email Service > Onboard Domain).Add SPF + DKIM records as instructed.
2. Install & generate types
npm install
npx wrangler types # Generates worker-configuration.d.ts with runtime types3. Deploy
npx wrangler deploy4. Set the bearer secret for a new deployment
npx wrangler secret put MCP_TOKEN
# Enter a long random string. Littlebird uses this as the Remote MCP bearer token.Existing deployments keep their current MCP_TOKEN; a normal code deploy does not expose, replace, or rotate it. Do not re-run this command unless you intentionally need to replace the secret.
5. Inbound routing rule
Dashboard: Email Service > Email Routing > Create rule
Custom address:
littlebird-mail@workslo.aiAction: Send to a Worker
Worker:
littlebird-mail
6. Wire up the MCP client
In Littlebird Settings > Integrations, add a Remote MCP server:
URL:
https://birb.workslo.ai/mcpAuth: Bearer token = the value you set in step 4
This is the service's only authentication path. OAuth endpoints such as /authorize, /token, and /register are intentionally not exposed.
7. Smoke check the deployed MCP endpoint
Use the same URL + token shape as Littlebird:
MCP_TOKEN=<token-from-step-4> npm run smoke:mcpExpected result:
MCP smoke passed for https://birb.workslo.ai/mcp
Tools: inbox_stats, list_inbox, read_message, reply, search_inbox, send_emailSchema
D1 database littlebird-mail was provisioned manually. If you start fresh, run:
CREATE TABLE IF NOT EXISTS messages (
id INTEGER PRIMARY KEY AUTOINCREMENT,
direction TEXT NOT NULL, -- 'inbound' or 'outbound'
from_address TEXT,
to_address TEXT,
subject TEXT,
body_text TEXT,
body_html TEXT,
thread_id TEXT,
in_reply_to TEXT,
message_id TEXT UNIQUE,
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
read_at DATETIME,
labels TEXT,
raw_headers TEXT
);
CREATE INDEX IF NOT EXISTS idx_thread ON messages(thread_id);
CREATE INDEX IF NOT EXISTS idx_created ON messages(created_at);
CREATE INDEX IF NOT EXISTS idx_in_reply_to ON messages(in_reply_to);
CREATE TABLE IF NOT EXISTS config (
key TEXT PRIMARY KEY,
value TEXT
);D1 Database ID
Name:
littlebird-mailID:
dbc3a61d-e581-4b03-9296-eee97dfb5851Region: WNAM
Environment
Binding | Name | Purpose |
D1 |
| Message store + config |
send_email |
| Outbound mail |
var |
| Default From address |
secret |
| Bearer auth for |
This server cannot be deployed
Maintenance
Related MCP Connectors
Email infrastructure for AI agents — send, receive, search, and reply to email over MCP.
Cloudflare Workers MCP server: ai-agent-scratchpad
Hosted email for AI agents: create inboxes, send, receive, and reply over MCP with scoped API keys
Email inboxes for AI agents: send, receive, reply, search, and manage threaded email over MCP.
Related MCP Servers
- AlicenseNot gradedqualityFmaintenanceAn MCP server that receives emails on your domain and allows AI assistants to search, read, and manage them via natural language queries.890 npmMIT
- AlicenseNot gradedqualityAmaintenanceA self-hosted MCP server that gives AI agents full email superpowers.1MIT
- AlicenseNot gradedqualityCmaintenanceAn MCP server that enables AI agents to validate email addresses and send emails via SMTP with zero external dependencies.MIT
- AlicenseNot gradedqualityCmaintenanceMCP server that gives AI agents programmable email inboxes with tools to create inboxes, send and list threaded email, and search messages.2 npm1MIT