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" }
}
}
}401.
Available tools
| Tool | What it does |
|---|---|
| create_inbox | Create an inbox (temporary or persistent). Returns address, key, password. |
| list_inboxes | List accessible inboxes, optionally by project. |
| get_inbox | Address, message count, size, and status of one inbox. |
| delete_inbox | Delete an inbox and its messages. |
| wait_for_email | Long-poll until an email arrives — ideal for signup and OTP flows. |
| list_emails | Browse messages in an inbox (skip/take paging). |
| get_email | Fetch a single message by id. |
| get_last_email | Most recent message, optionally template-parsed. |
| create_template | Create a {{var}} extraction template. |
| test_template | Validate patterns against sample content — nothing is saved. |
| list_templates | List extraction templates. |
| delete_template | Delete 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:read | Read messages, wait for email, template extraction. |
| inbox:write | Create and delete inboxes. |
| config:write | Create, update, and delete extraction templates. |
| admin | Everything. 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.