Email for OpenClaw agents

OpenClaw agents already run long-lived sessions. With an MCPmailer inbox they gain a durable identity the outside world can reach: email in, email out, threads preserved.

Setup

  1. 01

    Create a mailbox

    One per agent, so its address and its key are the same identity.

  2. 02

    Run openclaw mcp add

    With --auth oauth there is no token to store anywhere.

  3. 03

    Check it

    openclaw mcp doctor mcpmailer --probe connects and lists what it found.

  4. 04

    Restart the gateway

    The tool list is read when the server connects.

openclaw.json
{
  "mcp": {
    "servers": {
      "mcpmailer": {
        "url": "https://connect.mcpmailer.com/mcp",
        "transport": "streamable-http",
        "requestTimeoutMs": 320000,
        "headers": {
          "Authorization": "Bearer ${MCPMAILER_KEY}"
        }
      }
    }
  }
}

Add it from the terminal

OAuth is the route their docs recommend, and ours supports it. The second form is for a key you already hold: keep it in the environment rather than in the file.

Add it from the terminal
# OAuth: a browser opens once, nothing is written to disk
openclaw mcp add mcpmailer \
  --url https://connect.mcpmailer.com/mcp \
  --transport streamable-http \
  --auth oauth \
  --timeout 320000

# Or with a key you already have
openclaw mcp add mcpmailer \
  --url https://connect.mcpmailer.com/mcp \
  --transport streamable-http \
  --header "Authorization: Bearer \$MCPMAILER_KEY" \
  --timeout 320000

openclaw mcp doctor mcpmailer --probe

Worth knowing

01

Set transport explicitly

Without "transport": "streamable-http" the server is treated as the older SSE style and the connection does not come up. The CLI writes the field for you; a hand-edited config is where it goes missing.

02

Interpolate the token, do not paste it

Headers expand ${VAR} from the environment, which is how their docs suggest avoiding a literal bearer token in a file you might commit.

03

Raise the request timeout past the wait

wait_for_reply can block for 300 seconds. requestTimeoutMs is in milliseconds and has no documented default, so set it to 320000 or the gateway may give up before the reply lands.

04

Or let mail wake the gateway

A session that is already running does not have to wait on a tool call. Turn on hooks in the OpenClaw config, then register a webhook pointing at its /hooks/wake route to interrupt the main session, or /hooks/agent to run an isolated turn beside it. The hooks token goes in an Authorization header and the body template takes the shape that route expects. /docs/openclaw has both templates, along with the timeouts, the tool filter, and running one gateway against several mailboxes.

What OpenClaw can reach

The endpoint speaks Streamable HTTP MCP with 67 tools across mail, contacts, notes, and a vault, including send_email, read_message, search_inbox, and wait_for_reply. Errors are structured so OpenClaw can react: a quota rejection includes the reset time.