littlebird-mail
An MCP server that provides email sending, reading, replying, and searching capabilities through a Cloudflare Worker, allowing an AI assistant to manage an independent mailbox.
README
littlebird-mail
Littlebird's independent mailbox - a Cloudflare Worker that acts as a remote MCP server for send, read, reply, and search.
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
Architecture
- Stateless: No Durable Objects or session state. All persistence is D1.
- Auth:
/mcpis guarded by a Bearer token (MCP_TOKENsecret). - 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 types
3. Deploy
npx wrangler deploy
4. Set secrets
npx wrangler secret put MCP_TOKEN
# Enter a long random string (this guards /mcp)
5. Inbound routing rule
Dashboard: Email Service > Email Routing > Create rule
- Custom address:
littlebird-mail@workslo.ai - Action: Send to a Worker
- Worker:
littlebird-mail
6. Wire up the MCP client
In Littlebird Settings > Integrations, add a Remote MCP server:
- URL:
https://littlebird-mail.<your-subdomain>.workers.dev/mcp - Auth: Bearer token = the value you set in step 4
Schema
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-mail - ID:
dbc3a61d-e581-4b03-9296-eee97dfb5851 - Region: WNAM
Environment
| Binding | Name | Purpose |
|---|---|---|
| D1 | DB |
Message store + config |
| send_email | EMAIL |
Outbound mail |
| var | LB_ADDRESS |
Default From address |
| secret | MCP_TOKEN |
Bearer auth for /mcp |
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.