apiwren
Use case AI agents

Give your AI agent an email inbox

Give Claude, Cursor or your own agent a disposable inbox through a remote MCP server: create an address, wait for the email, read the OTP or magic link.

By Terrell Louis · Updated

Short answer

Agents that sign up for things, or test your sign-up flow, get stuck at “check your email”. Add the Spare Mailbox MCP server at https://mcp.sparemailbox.com/mcp. The agent can then create an address, wait for the email and read the code or link. No key is needed for 10 new inboxes a day.

Connect it

It’s a remote MCP server over HTTP, so there’s nothing to install. In Claude Desktop, open Settings → Connectors → Add custom connector and paste the URL.

claude mcp add --transport http spare-mailbox https://mcp.sparemailbox.com/mcp
// ~/.cursor/mcp.json
{
  "mcpServers": {
    "spare-mailbox": { "url": "https://mcp.sparemailbox.com/mcp" }
  }
}
# Removes the 10-inboxes-a-day limit and enables attachments
claude mcp add --transport http spare-mailbox https://mcp.sparemailbox.com/mcp \
  --header "X-RapidAPI-Key: YOUR_RAPIDAPI_KEY"

What the agent can do

ToolWhat it does
create_inboxA new address with an unguessable random part. Lasts 7 days.
get_otpWaits up to 60 seconds for a verification code and returns it.
get_magic_linkWaits for a sign-in or sign-up link and returns it. Password-reset links are not returned.
wait_for_emailWaits for any message, optionally filtered by sender or subject.
list_emailsMessages in the inbox, newest first.
read_emailOne message as plain text with every link in it. Never raw HTML.
get_attachmentDownloads one attachment up to 5 MB. Needs a RapidAPI key.
check_deliverabilityScores a sender’s SPF, DKIM, DMARC and DNS setup from one test email.

The three waiting tools take a since argument, a message ID or ISO time. Without it, an agent that reuses an inbox for a second sign-up would get the first code back.

Test a sign-up flow end to end

Pair it with the Playwright MCP server. Playwright drives the browser, and Spare Mailbox receives the email. The agent fills in the form, waits for the code, enters it and checks the result. You don’t need test accounts or a shared Gmail with plus-addressing.

claude mcp add playwright -- npx @playwright/mcp@latest
claude mcp add --transport http spare-mailbox https://mcp.sparemailbox.com/mcp
Open http://localhost:3000/signup with Playwright.
Create a Spare Mailbox inbox and sign up with that address.
Use get_otp with from="noreply@myapp.test" to get the verification code,
enter it, and confirm the dashboard loads.
Report each step that failed, with a screenshot.

Use it from your own agent

The Claude API’s MCP connector calls the server for you, so your code needs no MCP client. This example creates an address, then asks for the code after your test has submitted the form.

import anthropic

client = anthropic.Anthropic()

def ask(prompt: str) -> str:
    response = client.beta.messages.create(
        model="claude-opus-5-5",
        max_tokens=16000,
        betas=["mcp-client-2025-11-20", "server-side-fallback-2026-07-01"],
        fallbacks="default",
        mcp_servers=[{"type": "url", "url": "https://mcp.sparemailbox.com/mcp", "name": "spare-mailbox"}],
        tools=[{"type": "mcp_toolset", "mcp_server_name": "spare-mailbox"}],
        messages=[{"role": "user", "content": prompt}],
    )
    return "".join(b.text for b in response.content if b.type == "text")

address = ask("Create an inbox. Reply with the address only.")
# ... your agent or test submits the sign-up form with this address ...
code = ask(f"Wait up to 60 seconds for a verification code at {address}. Reply with the code only.")

To call it without an LLM, for example from a CI test, use the temp mail REST API. It reads the same mailboxes and returns the same otp and magicLink fields.

Limits and safety

  • Without a key: 10 new inboxes a day per IP (shared with check_deliverability), and 60 tool calls a minute.
  • With a RapidAPI key: no daily inbox limit, plus attachments. Each call counts toward your plan. The free plan is listed on the pricing page.
  • Untrusted content: the server returns plain text, never HTML. Filter by from so the agent only reads mail from the service it’s testing.

Spare Mailbox

Disposable inboxes with OTP and magic-link extraction, over MCP or REST.

Get a RapidAPI key

FAQ

Do I need an API key?
No. The MCP server works without a key for up to 10 new inboxes a day per IP address. A RapidAPI key removes that limit and enables attachments.
How does the agent get the verification code?
Spare Mailbox extracts the code and any sign-in link when the email arrives. get_otp returns the newest code, waiting up to 60 seconds if none has arrived yet, so the agent never parses the email itself.
Can someone else read my agent’s inbox?
Addresses created through MCP end in a 10-character random token, so they cannot be guessed. Anyone who knows the full address can read it, so don’t post it publicly.
Can an email trick the agent?
Email content is untrusted. read_email returns plain text, never HTML, and every tool description tells the model not to follow instructions found in mail. Filter by sender with the from argument so the agent only reads mail it expects.
Can the agent send email?
No. Spare Mailbox only receives. It is built for signing up, verifying and logging in.
Does it work with the Claude API, not just chat apps?
Yes. It is a remote MCP server, so the Claude API MCP connector can call it directly with mcp_servers and an mcp_toolset entry, as in the Python example on this page.