Agents
The three ways an AI agent uses MachineMail - the REST API, the hosted MCP server, and self-registration through auth.md - and how to choose between them.
MachineMail is built to be used by agents directly, not only by the code around them. An agent can reach it three ways, and they combine: an agent that registered itself can use its token on both the REST API and MCP.
| REST API | Hosted MCP | Self-registration | |
|---|---|---|---|
| What | https://api.machinemail.dev/v0, AgentMail-compatible | https://mcp.machinemail.dev/mcp, Streamable HTTP | https://api.machinemail.dev/auth.md |
| Who sets it up | you, in code | you, in the agent’s MCP client config | the agent itself |
| Credential | an API key from the dashboard | an API key, or a token from auth.md | issues its own token, which a human claims later |
| Best for | your own agent loop, webhooks, full control | coding agents and assistants with MCP support | agents that need an address before a human has set anything up |
REST API
Your code holds an API key (mm_live_...) and calls /v0 like any other HTTP API. Because MachineMail speaks the AgentMail wire format, the AgentMail SDKs work with a changed base URL. You get every endpoint, webhooks for inbound mail, and the full trust report on each message.
Start with the Quickstart, or Give an agent an inbox.
Hosted MCP
Point an MCP client at https://mcp.machinemail.dev/mcp with an API key, and the model gets fifteen tools: create inboxes, wait for and read mail, send, reply, draft and check trust reports. Message bodies come back in agent-safe form, and quarantined content is withheld, so a model using these tools reads mail the safe way by default.
- MCP server: endpoint, transport, auth and the tool list
- Client setup: Claude Code, Claude Desktop, Cursor, Codex, OpenCode, VS Code and others
Self-registration
An agent with no key can read https://api.machinemail.dev/auth.md and register itself. Anonymous registration returns, in one call, a sandbox inbox on machinemail.dev and a credential to use it. The agent then shows its human a 6-digit code; the human enters it at https://machinemail.dev/claim, and the agent and its inbox move into the human’s organization with full access.
- auth.md registration: discovery, registration types, tokens, scopes and sandbox limits
- Claiming an agent: the human side
The dashboard’s landing page has a Copy agent prompt button that gives an agent these steps in one paste:
Whichever you choose
Every inbound message is untrusted input. Read the trust layer before you let an agent act on mail, and in particular Using trust in agents.