MCP Email Setup by Client: One Server, an Address per Agent
One email MCP server for Claude Code, Cursor, Codex and any other MCP client: an address per agent, and verification codes that arrive while it waits.

An agent that signs up somewhere, or answers a customer, needs an email address it can read. One MCP server gives it that in every client: mailcycle-mcp is a single command, and each agent you pair gets its own Mailcycle address.
This page is the map. Pick your client below for the full setup, or read the short version first.
The short version
Every client runs the same command, npx -y mailcycle-mcp, with no arguments and no environment variables. Only where you put it differs.
-
Create an account at app.mailcycle.email and pick the Scale plan. There’s no email or password: the account is a 12-word recovery phrase made on your device.
-
On the machine where the agent runs, pair it:
npx -y mailcycle-mcp pair --name "My agent" -
Paste the
MC1:line it prints into AI agents in the app, and assign an email address. -
Add the server to your client’s MCP config:
{ "mcpServers": { "mailcycle": { "command": "npx", "args": ["-y", "mailcycle-mcp"] } } }
The agent now has seven tools: list_addresses, wait_for_message, list_messages, read_message, read_attachment, reply and send_message. New agents are reply-only, so they answer whoever wrote to them.
Codes that arrive while it waits
wait_for_message is the tool that makes the inbox useful for sign-ups. The agent triggers a verification email, calls the tool, and gets the whole message back when it lands: sender, subject, body and attachments. Each call waits up to 50 seconds, and the next call carries on from where the last one started, so mail that arrives in between is not missed. If you were about to connect your own Gmail for this, see a Gmail MCP alternative.
Mail is encrypted the moment it arrives, and mailcycle-mcp decrypts it on the machine where the agent runs.
Setup guides by client
| Client | Guide |
|---|---|
| Claude Code | Give Claude Code an email inbox |
| Claude Desktop | Give Claude Desktop an email inbox |
| Codex | Give Codex an email inbox |
| Cursor | Give Cursor an email inbox |
| VS Code Copilot | Give VS Code Copilot an email inbox |
| Windsurf | Give Windsurf an email inbox |
| Cline | Give Cline an email inbox |
| Gemini CLI | Give Gemini CLI an email inbox |
| Goose | Give Goose an email inbox |
| OpenCode | Give OpenCode an email inbox |
| Qwen Code | Give Qwen Code an email inbox |
| Kilo | Give Kilo an email inbox |
| Crush | Give Crush an email inbox |
| OpenClaw | Give OpenClaw an email inbox |
| Hermes Agent | Give Hermes Agent an email inbox |
Using a client that isn’t in the list? The JSON block above works in any other MCP client. The email MCP server guide covers the details that apply everywhere, such as send modes and troubleshooting.
Setup guides by framework
Building your own agent? Each of these gives it a real inbox, per user or per task, by pairing one agent for each.
| Framework | Guide |
|---|---|
| OpenAI Agents SDK | Give the OpenAI Agents SDK an email inbox |
| Mastra | Give Mastra an email inbox |
| Vercel AI SDK | Give the Vercel AI SDK an email inbox |
| LangGraph | Give LangGraph an email inbox |
| CrewAI | Give CrewAI an email inbox |
| Pydantic AI | Give Pydantic AI an email inbox |
| LlamaIndex | Give LlamaIndex an email inbox |
| AutoGen | Give AutoGen an email inbox |
| Semantic Kernel | Give Semantic Kernel an email inbox |
| Agno | Give Agno an email inbox |
| smolagents | Give smolagents an email inbox |
| n8n | Give n8n an email inbox |
The OpenAI Agents SDK, Mastra, Vercel AI SDK, LangGraph, Pydantic AI, LlamaIndex, AutoGen, Semantic Kernel, Agno and smolagents guides use the same server from code, so the agent you build in a framework reads mail the same way a client does. For plain HTTP, the REST API and SDKs cover nine languages.
Account and pairing, step by step
- Go to app.mailcycle.email/operator/signup. You won’t be asked for an email or a password: the account is a 12-word recovery phrase created on your device.
- Tick I’m 18+ and agree to the Terms of Service, then choose Create account.
- Store the 12 words somewhere safe, tick I’ve saved my 12 words somewhere safe. and choose Continue.
- The free Scale trial starts on its own and you land on AI agents. If it can’t start, Plans & Billing opens instead.
- On the machine that will run the agent, run
npx -y mailcycle-mcp pair --name "My agent". It prints a line starting withMC1:and waits. - In the web app, choose AI agents, paste the line under Paste the line it prints, choose Find agent, then Connect agent. On Add email address, leave Generate new selected and choose Assign email address.
The terminal prints Ready: with the new address and exits. The agent shows under Your agents with the sending mode Reply only. The key is saved to ~/.config/mailcycle/agent.json, readable only by your user. Agents are a Scale feature, and from Scale up an agent can use an address on your own domain.
The seven tools
| Tool | What it does |
|---|---|
list_addresses |
The agent’s addresses, and what it may send |
wait_for_message |
Waits up to 50 seconds per call for new mail and returns it in full |
list_messages |
The newest messages, with a preview of each |
read_message |
One message in full |
read_attachment |
Opens an attachment, or saves it to the files folder |
reply |
Replies to the sender, threaded, from the address they wrote to |
send_message |
Sends a new message, when the agent is set to Send to anyone |
Troubleshooting the server
“Mailcycle isn’t connected on this machine yet, so this agent has no mailbox.”
The server runs, but this machine isn’t paired for the user running your code. Run npx -y mailcycle-mcp pair there and follow the setup steps. No restart is needed afterwards.
“This agent has no email address yet.” Open the agent in the Mailcycle app and add an address.
“Nothing matching arrived in 50 seconds…”
Each wait stops at its timeout by design. Call again and the new call carries on from where the first started. A wait counts only mail that arrives after it starts, so for mail sent earlier use list_messages and read_message.
“This agent is set to reply only, so it cannot start new conversations.”
Use reply on a message the agent received, or change the agent’s sending mode in the app.
How the server works
mailcycle-mcp is a small program that runs on the same machine as your agent. The client or framework starts it as a child process with npx, and it speaks the Model Context Protocol over standard input and output. Mail for the agent’s address is encrypted the moment it arrives. The server fetches it with the agent’s key, decrypts it on your machine and hands the text to the client.
Because every client starts the same command, one setup carries across tools. The JSON block above is the whole client configuration. A framework such as Pydantic AI, LlamaIndex or AutoGen starts the same command from code, and the guides for each show the exact lines.
Reading the tool replies
Every tool answers in plain text, so a person, a model and a regular expression can all read it. A listing has one line per message with its id, time, recipient, sender and subject, and an indented preview underneath. A single message has its header lines, a blank line and the body between <<<BODY and BODY>>>, introduced as text written by the sender.
That wrapper is useful. It tells the model where the sender’s words start and end, so a prompt can say to treat that part as data to read. When a message has attachments, they are numbered from [0], and read_attachment opens one or saves it to the files folder.
Plans, trial and addresses
AI agents are part of the Scale plan. The 7-day trial covers the whole Scale plan and starts from the web app with no card. From Scale up an agent can use an address on your own domain, so mail reaches a name your customers recognise, such as support@yourdomain.com. On the shared Mailcycle domains the part before the @ is generated for you.
Mail is kept for 7 days by default and for up to 90 if you raise it. Trackers are stripped from every message, and old mail clears itself, so each agent works from what is current.
A client or a framework
Use a client such as Claude Code, Cursor or Codex when a person drives the agent in an editor or a terminal. Add the server to the client’s MCP config, and the agent in that tool can read its own mail.
Use a framework when you build the agent yourself and run it on a schedule or behind an API. Pydantic AI, LlamaIndex, AutoGen, CrewAI, LangGraph, Mastra, the OpenAI Agents SDK and the Vercel AI SDK each start the same server from code. The framework guides below show a real run for each. Either way the agent gets its own address and the same seven tools.
Keeping agents contained
Pair one agent per job. A sign-up agent, a support agent and a per-customer agent each have their own key and addresses, and each sees only its own mail. New agents are reply-only: they answer whoever wrote to them, and the sending mode can be changed only by you, signed in, in the Mailcycle app.
Because the sender’s words arrive labelled as data, your instructions can tell the agent to read them as information, not as commands. AI agent email security goes deeper on prompt injection through email.
Which tool for which job
Seven tools cover what an agent does with mail, and each has one job.
list_addressesis the first call in most runs. It returns the agent’s addresses and what it may send, so the agent knows its own address before it fills in a sign-up form.wait_for_messageis for mail that has not arrived yet. It holds the call for up to 50 seconds and returns the whole message when one lands. A longer wait is several calls in a row, and each carries on from where the last started.list_messagesis for mail that is already there. It returns the newest messages with a preview of each.read_messageopens one message in full, by the id from the listing.read_attachmentopens an attachment, or saves it to the files folder.replyanswers the person who wrote, threaded under their message, from the address they wrote to.send_messagestarts a new conversation, and only works when the agent’s sending mode allows it.
A typical sign-in run uses three of them: list_addresses to get the address, wait_for_message to catch the code and read_message when the preview is not enough.
One agent per job
Pair a separate agent for each job: one for your staging sign-ups, one for a support address, one per customer. Each has its own key and its own addresses, sees only its own mail, and can be removed from the app on its own.
Read more in the AI agents guide, the Mailcycle MCP server page and AI agent email security.
FAQ
Which MCP clients work with Mailcycle?
Claude Code, Claude Desktop, Codex, Cursor, VS Code Copilot, Windsurf, Cline, Gemini CLI, Goose, OpenCode, Qwen Code, Kilo, Crush, OpenClaw, Hermes Agent, or any other MCP client. Each runs the same command, npx -y mailcycle-mcp, so only the place you put it differs.
Can every agent have its own address?
Yes. Each agent is paired from the machine it runs on and gets one or more addresses of its own. It sees only the mail sent to those addresses.
How does an agent get a verification code?
It calls wait_for_message, which waits up to 50 seconds per call and returns the whole message when it arrives. A longer wait is several calls in a row, and each one carries on from where the last started.
Does the agent need a plan?
AI agents run on the Scale plan. The MCP server itself is mailcycle-mcp on npm and runs on the machine where the agent runs.
What if my client isn't listed?
Add the same server to its MCP config: command npx, arguments -y and mailcycle-mcp. It works with any other MCP client.
How do I pair an agent with Mailcycle?
Run npx -y mailcycle-mcp pair --name "My agent" on the machine where the agent runs, paste the MC1: line it prints into **AI agents** in the app and assign an address. The terminal then prints Ready: with the address.
Where does the agent's key live?
Pairing saves the key to ~/.config/mailcycle/agent.json, readable only by your user. The server finds it on its own, and MAILCYCLE_AGENT_FILE points it at a different file when you run several agents.
How long does mail stay in an agent's inbox?
Retention defaults to 7 days and goes up to 90, and trackers are stripped from every message, so an agent works from what is current.