r/ClaudeMCP • u/uriwa • 1h ago
Remote Streamable HTTP MCP server for giving agents their own email inbox (MIT open source, scoped per-mailbox keys)
Most setups for giving Claude Code or Cursor an email address either hand the agent a personal Gmail token (way too much blast radius if a prompt injection hits) or force you to spin up a local stdio bridge and manage DNS/SPF/DKIM yourself.
We just added a native Streamable HTTP MCP endpoint directly inside the Cloudflare Worker for AgentMail (our MIT open-source agent email infra):
```bash
claude mcp add --transport http agentmail https://api.theagentmail.net/mcp \
--header "Authorization: Bearer am_..."
```
A few design details that mattered in practice:
- Strict token scoping at the MCP layer. An account-scoped key only exposes tools for that single mailbox (`get_mailbox`, `list_messages`, `get_message`, `send_email`, `get_attachment_url`, and webhook management). It cannot list other mailboxes, touch org billing, or pass another `accountId` to read a neighbor inbox. Org keys additionally expose `list_mailboxes`, `create_mailbox`, and `get_balance`.
- Real-time outbound spam/phishing filter. Shared agent email domains get burned fast if spammers slip through, so every outbound `send_email` call is evaluated synchronously before leaving the server.
- Zero local bridge or SDK needed. It speaks JSON-RPC 2.0 over Streamable HTTP directly from the worker, and `https://theagentmail.net/llms.txt` mirrors the full REST + MCP spec if you prefer raw curl/fetch.
First mailbox is free for 30 days (phone verified), then $1/mo per active mailbox from a $5 prepaid balance that never expires. Everything including the MCP handler (`src/handlers/mcp.ts`) and spam guard is MIT licensed on GitHub if you want to inspect it or self-host on your own Cloudflare account: https://github.com/uriva/agentmail