apumail / blog

Temp email as an MCP server

REST is fine when you're writing the code. When the agent is writing the code, tools beat endpoints.

July 14, 2026

There's a real difference between an API an agent can call and an API an agent knows how to call. A REST endpoint needs the model to hold the base URL, the auth header shape, the JSON body and the response schema in context, and to get all four right in one shot. A tool definition hands it those for free, from the protocol.

That's the whole argument for MCP here. An inbox is a small enough surface that the tool list is the documentation.

Wiring it up

apumail ships an MCP descriptor at /.well-known/mcp.json. For a client that reads descriptors, pointing it at the origin is enough:

https://api.apumail.com/.well-known/mcp.json

No install step, no package to pull, no key to provision first — the inbox tools that need auth take the inbox token that create_inbox hands back.

The 9 tools

They fall into three groups, and the grouping is the mental model:

Get an address

Receive

Send

Plus wait_for_sms and extract_latest_sms_otp on the paid tier, which do exactly what their email counterparts do — same wait/extract shape, phone numbers instead of addresses.

What the flow looks like as tools

The signup dance that was three curl calls in the OTP post collapses to this:

  1. create_inbox → agent gets vivid-llama-4a2c@apumail.com
  2. agent types that address into the form it's working on
  3. wait_for_mail → blocks, returns when the confirm lands
  4. extract_latest_otp"482910"

Nothing in there is apumail-specific reasoning. The model doesn't need to know what apumail is — it needs to know there's a tool called wait_for_mail, which the protocol already told it.

When to skip MCP

Honestly: if you're writing a test suite, use the REST API. MCP earns its keep when the caller is a model deciding what to do next. When the caller is your CI pipeline running a known script, the endpoints are simpler and there's no protocol in the way. Both hit the same backend, so mixing them is fine — provision over REST in a fixture, hand the address to the agent, let it wait_for_mail over MCP.

The descriptor is the docs

If you want to read the surface before wiring anything, three URLs answer everything:

Try it — no signup

One unauthenticated POST returns a working address and its token.

curl -sS -X POST https://api.apumail.com/api/v1/inboxes