spare-email-mcp
OfficialProvides read-only access to spare.email mailboxes hosted on any cloudflare_temp_email deployment: verify the authenticated mailbox, list recent mails, read a parsed mail in full, and poll for a new mail to extract verification codes.
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., "@spare-email-mcp wait for the new verification code and tell me what it is"
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.
spare-email-mcp
A read-only Model Context Protocol server for spare.email mailboxes (works with any cloudflare_temp_email deployment).
It lets MCP-aware agents (Claude, Cursor, Codex, ...) look inside a mailbox you already created: list the inbox, read a parsed mail, and wait for a verification code. It is deliberately read-only: it cannot create mailboxes, delete mail, or send anything, and it holds no credentials of its own — it uses the same Address JWT you can copy from the web UI.
Tools
Tool | Purpose |
| Returns the mailbox address the server is authenticated as. Use first to verify the JWT works. |
| List recent mails, newest first ( |
| Read one mail in full by id: from/to/subject/date, plain-text body, attachment metadata. |
| Poll until a new mail arrives after the call starts, then extract the most likely verification code. Supports |
Code extraction runs locally in the server using the multilingual rule-based
extractor ported verbatim from the upstream worker (extract_code.ts, MIT) —
keyword-anchored patterns in about a dozen languages, with guards against
dates, amounts, phone numbers, and URLs. No AI model and no extra API calls.
No mail arrives within the timeout? wait_for_otp returns a structured
"nothing arrived" result instead of hanging or guessing.
Related MCP server: Stalwart Mail MCP
Configuration
The server is configured entirely through environment variables:
Variable | Required | Meaning |
| yes | Address JWT, copied from the spare.email web UI (settings). |
| no | API base URL. Defaults to |
| no | Only if the deployment enabled the site-wide access password ( |
| no | Error-message language, |
Every tool reports an actionable error on failure — for example, an expired JWT returns a hint to copy a fresh one from the web UI.
Usage
Claude Code
claude mcp add spare-email -e SPARE_EMAIL_JWT=eyJ... -- node /path/to/spare-email-mcp/dist/index.jsClaude Desktop / Cursor / generic mcpServers block
{
"mcpServers": {
"spare-email": {
"command": "node",
"args": ["/path/to/spare-email-mcp/dist/index.js"],
"env": {
"SPARE_EMAIL_JWT": "eyJ...",
"SPARE_EMAIL_BASE_URL": "https://spare.email"
}
}
}
}Security notes
The JWT grants full read access to that one mailbox only. Treat it like a password in your MCP config; rotate it by opening a fresh mailbox (or changing its password) in the web UI.
The mailbox lifetime rules of the deployment apply: on spare.email a default mailbox auto-expires, so point long-lived agent workflows at a mailbox with the retention you want and keep a copy of its JWT.
The server is stateless and never writes: no mailbox creation, no send, no deletes. Rate limits are honored (429 responses back off a poll cycle).
Typical agent workflow
Human creates a mailbox in the web UI and copies the Address JWT into the MCP server config.
Agent signs up somewhere using that mailbox address.
Agent calls
wait_for_otp(optionally filtering by subject) and gets the verification code without any human copy-pasting.
Underlying REST API
The tools are a thin layer over the deployment's read-only parsed-mail
endpoints (GET /api/settings, GET /api/parsed_mails, GET /api/parsed_mail/:id). Build your own client with plain HTTP if you prefer —
usage notes, response shapes and the polling pattern are documented at
https://spare.email/docs/en/guide/feature/mail-api-parsed.
Development
npm install
npm run build # tsc -> dist/
SPARE_EMAIL_JWT=... SPARE_EMAIL_BASE_URL=... npm run smokeProvenance
Developed as part of the spare.email stack (https://spare.email); this repository is the canonical home of the published package.
Available Tools
4 toolslist_mailsList mailsA
List recent mails in the mailbox, newest first. Returns id, from, subject, date, and a short preview for each.
Inputs: limit, offset.
mailbox_infoMailbox infoA
Return the mailbox address this server is authenticated as. Use to verify the Address JWT works.
Inputs: no named parameters.
read_mailRead mailA
Read one mail in full by id (ids come from list_mails). Returns from, to, subject, date, plain-text body, and attachment metadata.
Inputs: id (required).
wait_for_otpWait for a verification codeA
Poll the mailbox until a NEW mail arrives after this call starts, then extract the most likely verification code. Use right after triggering a signup/verification mail. Requires the mail to actually arrive; if the timeout is reached with no new mail, ask the user to check the flow.
Inputs: poll_seconds, timeout_seconds, subject_contains.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
Each tool targets a distinct action: identity check, listing, full read, and blocking OTP wait. There is no plausible overlap — list_mails returns previews while read_mail requires an id from the list, and wait_for_otp is clearly the polling variant.
Three tools follow a clear verb_noun pattern (list_mails, read_mail, wait_for_otp) and the plural/singular distinction reads naturally. mailbox_info is a noun phrase that deviates slightly from the verb-first convention, but it remains immediately readable.
Four tools is on the lean side but each earns its place in the OTP/inbox flow. A search or delete tool would round it out, but nothing here is redundant.
The core lifecycle for a disposable inbox — verify identity, list, read full content, await new mail with code extraction — is fully covered. Gaps are minor: no search/filter by sender, no delete or mark-read, and no way to fetch attachments beyond metadata.
Maintenance
Related MCP Connectors
Disposable, receive-only email inboxes for AI agents. Create an address, wait for the verification email, and get the one-time code or magic link back as structured fields. Long-polling wait_for_email with sender and subject filters, attachments, sanitised HTML, and restore for later password resets. OAuth 2.1, hosted in the EU, cannot send email.
Disposable email addresses for tests and agents: register, wait for mail, extract codes and links.
Email inboxes for AI agents: send, receive, reply, search, and manage threaded email over MCP.
Email infrastructure for AI agents — send, receive, search, and reply to email over MCP.
Related MCP Servers
AlicenseAqualityBmaintenanceMCP server that gives an agent its own email inbox: it opens the inbox, waits for the one-time code a signup sends, and reads or sends mail. Addresses are permanent, so a test suite does not need a new one per run; only the messages expire, on a retention window you set.19MIT- AlicenseAqualityBmaintenanceEnables MCP clients to search, read, and manage a self-hosted mailbox over JMAP, including attachments with OCR, sending, drafts, and contacts.10198 npmMIT
- AlicenseNot gradedqualityCmaintenanceEnables authenticated MCP clients to list, search, read, flag, draft, and optionally send mail from one Gmail or Microsoft 365 mailbox using OAuth without app registration.MIT
- AlicenseNot gradedqualityCmaintenanceEnables software agents to read and manage their own mailboxes, inspect inbound messages, and request outbound email that remains pending until an owner approves it. Exposes these agent mail operations as remote MCP tools alongside a REST API.MIT