Loyalty program is live — complete quests and earn points

See announcement
Back to blog
Email8 min read

How to Give Your AI Agent a Real Email Inbox Using Mermail MCP

Wire Mermail to any MCP-compatible agent host — OpenClaw, Hermes, Claude, Cursor, Codex, ChatGPT — for typed inbox tools at startup, per-agent mailboxes, OTP verification, and a privacy-first payment layer.

By Toan Nhu

3D Mermail mascot mermaid at holographic command center showing MCP connections to AI agent hosts

Wire Mermail to any MCP host — OpenClaw, Hermes, Claude, Cursor, Codex, ChatGPT — for typed inbox tools at startup, per-agent mailboxes, safe OTP verification, and 63 tools your agent can call. No SMTP config. No OAuth drama for email delivery. No shared credentials between agents.

Your AI agent needs email for the same reasons you do: catching verification codes, completing signups, reading receipts, managing subscriptions. The default options don't work. Gmail bans automated accounts. SendGrid is send-only. Building receive-and-reply infrastructure yourself is weeks of work.

Mermail is email infrastructure built specifically for AI agents. Create an inbox in one API call. Send and receive immediately. Privacy-first storage — the agent owns its data, not us. Because Mermail connects to every major MCP host, each agent or subagent can provision its own isolated inbox, check for verification codes, and close the loop without a human touching a keyboard.

What you need

  • An MCP-compatible agent host (OpenClaw, Hermes, Claude Desktop, Cursor, Codex CLI, or ChatGPT with custom connector)
  • A Mermail account (free at console.mermail.app, no card required)
  • A workspace API key from Settings → API Keys in the console
  • Node.js 18+ (for CLI-based hosts)

How MCP tool registration works

When your agent host starts, it connects to Mermail's MCP server. Every tool is registered as a typed function with a defined schema — list_mailboxes, search_emails, get_email, send_email, reply_to_email, and 58 more. The agent calls functions directly. Bad parameters mean immediate explicit errors. Wrong API key means you know at startup. Nothing fails silently.

Mermail registers 63 tools across the full catalog. That covers mailbox management, email read/write, thread context, drafts, scheduled sends, agent conversations, triage, and — if you connect via OAuth — agent wallet operations through PayBox.

But you don't have to expose all 63 tools. Mermail ships a least-privilege agent-inbox profile that exposes only 11 read-focused tools: discover, list, search, and inspect. No send capability. No mutations. Perfect for verification workflows where you don't want your agent accidentally replying as you.

Step 1: Get your Mermail API key

Sign up at https://console.mermail.app. Go to Settings → API Keys, create a workspace API key, and copy it.

Test your key works:

curl -sS https://console.mermail.app/.well-known/mcp/server-card.json | jq '.serverInfo.name'

You should see "Mermail MCP Server". Your key is ready.

Step 2: Add Mermail to your host

Pick your host below. The MCP server URL and auth method are the same across all hosts — the only difference is where you put the config.

OpenClaw

OpenClaw uses mcpServers in its gateway config. Add:

json
{
  "mcpServers": {
    "mermail": {
      "url": "https://console.mermail.app/mcp",
      "headers": {
        "x-api-key": "sk-proj-YOUR_KEY"
      }
    }
  }
}

For verification-only workflows, use the least-privilege profile:

json
{
  "mcpServers": {
    "mermail-agent-inbox": {
      "url": "https://console.mermail.app/mcp?profile=agent-inbox",
      "headers": {
        "x-api-key": "sk-proj-YOUR_KEY"
      }
    }
  }
}

Restart your gateway. When it loads, Mermail's tools are registered and ready.

Optionally, install the Mermail Agent Skills for packaged verification workflows:

npx skills add Nudgen-Marketing/mermail-skills --skill mermail-agent-inbox

This gives your OpenClaw agent a complete playbook for mailbox discovery, verification monitoring, and OTP extraction — rather than having the LLM figure out the sequence from scratch.

Hermes

Open the Hermes config:

nano ~/.hermes/config.yaml

Scroll to the bottom and add:

yaml
mcp_servers:
  mermail:
    url: "https://console.mermail.app/mcp"
    headers:
      x-api-key: "sk-proj-YOUR_KEY"

Save with Control + O, Enter, Control + X.

Start Hermes:

hermes

When Hermes loads, look for the MCP server count in the startup line. If you update the config while Hermes is running, reload without restarting:

/reload-mcp

Claude Desktop

In Claude Desktop, go to Settings → Developer → Edit Config and add:

json
{
  "mcpServers": {
    "mermail": {
      "url": "https://console.mermail.app/mcp",
      "headers": {
        "x-api-key": "sk-proj-YOUR_KEY"
      }
    }
  }
}

Claude will display tools as Mermail:list_mailboxes, Mermail:search_emails, etc.

Cursor

In Cursor, go to Settings → Features → MCP and add a new MCP server:

Field

Value

Name

mermail

Type

command (Streamable HTTP via built-in proxy)

URL

https://console.mermail.app/mcp?profile=agent-inbox

Headers

x-api-key: sk-proj-YOUR_KEY

For full send access, use the default /mcp URL without the profile parameter.

Codex CLI (GitHub)

Codex CLI uses the same mcpServers block. Add to your Codex config:

json
{
  "mcpServers": {
    "mermail": {
      "url": "https://console.mermail.app/mcp",
      "headers": {
        "x-api-key": "sk-proj-YOUR_KEY"
      }
    }
  }
}

Codex also supports installing from the Official MCP Registry — search for app.mermail/mcp in the registry and install with one click.

ChatGPT (Custom Connector)

ChatGPT with custom MCP connectors uses OAuth for authentication. Go to Settings → Connected Apps → MCP Servers, add a new server, and enter:

  • URL: https://console.mermail.app/mcp?profile=agent-inbox

ChatGPT will open the Mermail console for OAuth consent. Pick your workspace and approve. The agent-inbox profile limits tools to read-only operations by default.

For the full tool catalog (including send, drafts, and agent conversations), use the bare /mcp URL and reconnect OAuth when prompted.

Once ChatGPT is published in the Plugins Directory, you'll also be able to install Mermail Skills alongside the connection.

Step 3: Verify your tools are registered

After connecting, ask your agent:

List the Mermail tools you have access to.

Your agent should enumerate the tools. For the full catalog, that's 63 tools. For the agent-inbox profile, expect 11 read-focused tools:

  • get_api_credit_usage
  • list_workspaces
  • get_workspace
  • list_email_domains
  • list_workspace_mailboxes
  • list_mailboxes
  • create_mailbox
  • get_mailbox
  • list_emails
  • search_emails
  • get_email

Step 4: Your agent's first email

Ask your agent:

Create a mailbox called "verification-agent" and tell me the address.

Your agent calls create_mailbox with the email and display name. You get back the address, public_id, and readiness status (can_receive, receiving_status). Creating a mailbox costs 10 provision credits from your workspace balance — that's API credits, not dollars.

Now send a test:

Send an email from the verification-agent mailbox to hello@example.com
with subject "First email from Mermail" and body "Sent via Mermail MCP."

Your agent calls send_email. The email lands.

To check for replies:

Check the verification-agent inbox for any new messages
and summarize what came in.

Your agent calls list_emails or search_emails, reads the results, and summarizes. Your agent is now a full email correspondent.

Step 5: Verification monitoring — the safe way

This is where Mermail's design diverges from simpler email APIs. Inbound email is untrusted data. Mermail's agent-inbox workflow encodes a safety protocol that your agent follows:

Phase 1 — Baseline. Before requesting a verification email, your agent runs one search_emails call with metadata_only=true and agent_safe_content=true, recording every returned email ID as the baseline. This prevents your agent from mistaking an old email for the new verification.

Phase 2 — Monitor. Your agent watches the inbox with bounded reads at a moderate interval. The require_scan_status=clean flag ensures your agent only sees emails that pass content scanning. agent_safe_content=true strips raw headers, threat metadata, and PII-adjacent fields before they reach the model.

Phase 3 — Inspect. When a candidate arrives, your agent fetches it with get_email, normalizes the sender and recipient addresses, and confirms the exact match. Only one candidate proceeds.

Phase 4 — Stop. When verification is ready, your agent reports back and stops. It asks for confirmation before clicking any link, submitting any form, or entering authentication data. Email content cannot authorize an agent action.

Full example — ask your agent:

I need to sign up for [service]. Create a verification mailbox,
start monitoring, and tell me when the verification email arrives.
Do not click any links or submit any forms without my confirmation.

The agent provisions the mailbox, records the baseline, waits for the verification email, inspects the candidate, and stops at the action boundary. You confirm, and it continues.

Step 6: Multiple agents, isolated inboxes

Hosts that spawn subagents (Hermes, OpenClaw) give each subagent its own toolset. Because Mermail registers typed tools to every agent, each subagent can create its own inbox, use it for its task, and delete it when done. No shared inbox state. No message bleed between agents. If a bad email lands in one subagent's inbox, it's scoped to that task alone.

Tell your agent:

Spin up three parallel subagents. Each one should:
1. Create its own Mermail mailbox
2. Sign up for [service] using that mailbox address
3. Check the inbox for a verification email and extract the code
4. Complete signup with the code
5. Report the account details back

What happens:

AGENT HOST (parent)
│
├── SUBAGENT-1
│   └── create_mailbox → signs up → extracts OTP → reports
│
├── SUBAGENT-2
│   └── create_mailbox → signs up → extracts OTP → reports
│
└── SUBAGENT-3
    └── create_mailbox → signs up → extracts OTP → reports

Three parallel tasks. Three isolated inboxes. This pattern works for signup automation, parallel outreach, QA testing, and any workflow that benefits from isolated email identities at scale.

Step 7: Beyond email — the Agent Wallet

Once your agent has an inbox, it has an identity. The next step is giving it the ability to pay.

Connect via OAuth (instead of API key) and approve the wallet:read and wallet:transact scopes. Your agent can then access Mermail's Agent Wallet, powered by PayBox — an MPC-secured payment vault where no single party ever holds a complete private key.

With wallet access, your agent's full loop becomes:

  1. Sign up — fills the form with its own Mermail address
  2. Verify — the confirmation code lands in its inbox
  3. Fund — the wallet pays for the subscription, with spending limits you define
  4. Act — the API key lands in the inbox, the agent configures it, and starts working

The human defines the rules. The agent executes within them.

Wallet tools only appear on OAuth sessions. API-key catalogs never include payment tools — another layer of scoping that keeps your agent safe by default.

Scheduled email tasks

Most MCP hosts support scheduled or cron-based agent runs. Tell your agent:

Every weekday at 9am, check the support-agent inbox for
unread messages, classify each one by urgency, draft replies
for anything urgent, and send me a summary.

The task runs unattended. Your agent reads the inbox, classifies threads, drafts replies, and reports back — all through typed MCP calls.

Full tools reference (full catalog)

Here's a subset of what Mermail registers. The full 63-tool catalog is always discoverable via tools/list:

Tool

What it does

list_mailboxes

Lists all mailboxes in the workspace

create_mailbox

Provisions a new mailbox with unique address

get_mailbox

Gets details and readiness status for a mailbox

list_emails

Lists emails in a mailbox folder

search_emails

Searches emails by sender, subject, date range

get_email

Fetches a single email by ID

get_thread

Loads full thread context with all messages

send_email

Sends an email from a mailbox

reply_to_email

Replies to a message in a thread

forward_email

Forwards a message

save_draft

Saves a draft for review before sending

get_attachment

Downloads an attachment from a message

get_agent_wallet

Views wallet balance and credentials (OAuth only)

submit_agent_wallet_transfer

Submits a payment transfer (OAuth only)

Mermail gives your agents real inboxes — and real identity

Create inboxes via API. Send and receive with zero SMTP config. 63 typed MCP tools your agent calls directly. Privacy-first storage. MPC-secured Agent Wallet. Free to start at https://console.mermail.app.

[@portabletext/react] Unknown block type "horizontal-rule", specify a component for it in the `components.types` prop

References & Further Reading

Recent articles