Docs AI Agents & MCP

AI Agents & MCP

Give your agent a real email address. Connect the DevInbox MCP server and your agent can create inboxes, wait for verification emails, and extract OTP codes as structured data — no SDK, no glue code.

Why agents need email

An agent acting on the web keeps hitting the same wall: every service wants an email address. Sign-up forms, verification links, one-time codes, password resets, receipts. DevInbox gives your agent an inbox it can create in milliseconds and read as structured data — on devinbox.io or on your own verified domain.

Inboxes can be temporary (throwaway, for a single flow) or persistent — so the account your agent registered today still receives its password reset next month.

Connect the MCP server (hosted)

Zero install — point any MCP client at the hosted endpoint and pass your DevInbox API key as a bearer token. With the Claude Code CLI:

claude mcp add --transport http devinbox https://mcp.devinbox.io \
  --header "Authorization: Bearer YOUR_API_KEY"

Or in any MCP client configuration (Claude Desktop, Cursor, LangGraph, CrewAI, ...):

{
  "mcpServers": {
    "devinbox": {
      "type": "http",
      "url": "https://mcp.devinbox.io",
      "headers": { "Authorization": "Bearer YOUR_API_KEY" }
    }
  }
}
Find your API key in the dashboard under Settings > API Keys. Requests without a bearer token are rejected with 401.

Available tools

Tool What it does
create_inboxCreate an inbox (temporary or persistent). Returns address, key, password.
list_inboxesList accessible inboxes, optionally by project.
get_inboxAddress, message count, size, and status of one inbox.
delete_inboxDelete an inbox and its messages.
wait_for_emailLong-poll until an email arrives — ideal for signup and OTP flows.
list_emailsBrowse messages in an inbox (skip/take paging).
get_emailFetch a single message by id.
get_last_emailMost recent message, optionally template-parsed.
create_templateCreate a {{var}} extraction template.
test_templateValidate patterns against sample content — nothing is saved.
list_templatesList extraction templates.
delete_templateDelete a template by key.

The canonical flow: sign up somewhere, unaided

The pattern behind most agent email work — registering for a third-party service and getting past email verification without a human:

1. create_inbox()                                   -> agent-3f9c@devinbox.io
2. [browser fills the signup form with that address]
3. wait_for_email(inbox_key, timeout_s=90)          -> "Your verification code is 482913"
4. create_template("saas-otp",
     body_pattern="Your verification code is {{code}}")
5. get_last_email(inbox_key, template="saas-otp")   -> { "code": "482913" }
6. [agent completes signup]

Steps 4–5 are the interesting part: when the agent meets a sender it has never seen, it defines its own extraction template at runtime — and can dry-run it with test_template before saving.

Run locally over stdio

Prefer not to route mail metadata through the hosted bridge? The server also runs locally over stdio, taking its API key from the DEVINBOX_API_KEY environment variable. The devinbox-mcp package is coming soon — contact us for early access. Config shape:

{
  "mcpServers": {
    "devinbox": {
      "command": "devinbox-mcp",
      "args": ["--stdio"],
      "env": { "DEVINBOX_API_KEY": "YOUR_API_KEY" }
    }
  }
}

API key scopes

Agents run unattended, so give them least-privilege keys. Scopes are set per API key in the dashboard; a key can also be confined to a single project so each agent (or fleet) is isolated.

Scope Grants
inbox:readRead messages, wait for email, template extraction.
inbox:writeCreate and delete inboxes.
config:writeCreate, update, and delete extraction templates.
adminEverything. Existing keys without scopes keep full access.

Prefer the raw REST API?

Every MCP tool is a thin wrapper over the public API, so anything an agent can do, your code can do directly: POST /mailboxes, GET /messages/{key}/wait, key-addressed template CRUD, and more.