HTML version: https://cooperemail.com/integrations/n8n

n8n · MCP Client · workflow JSON

# n8n AI agent email inbox with the MCP Client node and Bearer auth

In n8n, create a Bearer Auth credential with your Cooper key, then use the MCP Client node (or the MCP Client Tool node under an AI Agent) with Server Transport HTTP Streamable and endpoint https://cooperemail.com/mcp. The workflow below sends a code from one inbox and reads it back with cooper_wait_for_code. It ran on n8n 2.48.8 against production on 2026-11-23.

## Get an inbox and a key in one call

The agent can do this itself. One unauthenticated POST creates the account, the first inbox, and the API key. There is no human signup form, no card, and no captcha. Over MCP the same step is the cooper_onboard tool, which works before the client has a key.

For the self-tests on this page, create a second inbox with POST /api/v1/inboxes and export it as PEER_INBOX. The tests mail a code from one inbox you own to the other and read it back.

```
curl -s -X POST 'https://cooperemail.com/api/v1/onboard' \
  -H 'content-type: application/json' \
  -H 'X-Client: my-agent' \
  -d '{"username":"signup-bot-7f3a"}'
# 201 {"api_key":"coop_live_...","inbox":{"email":"signup-bot-7f3a@cooperemail.com",...}}
export COOPER_API_KEY=coop_live_...   # shown once
export AGENT_INBOX=signup-bot-7f3a@cooperemail.com
```

## The workflow

Import this JSON in n8n, replace AGENT_INBOX and PEER_INBOX with your two addresses, and attach a Bearer Auth credential named Cooper Email API key that holds your key. Both MCP Client nodes call one Cooper tool each with JSON input. The second node's timeout is 70 seconds because cooper_wait_for_code waits up to 55.

```
{
  "name": "Cooper Email: send, then read the code",
  "nodes": [
    {
      "parameters": {},
      "name": "Start",
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [0, 0]
    },
    {
      "parameters": {
        "endpointUrl": "https://cooperemail.com/mcp",
        "authentication": "bearerAuth",
        "tool": { "__rl": true, "mode": "id", "value": "cooper_send_message" },
        "inputMode": "json",
        "jsonInput": "{\"inbox_id\": \"AGENT_INBOX\", \"to\": [\"PEER_INBOX\"], \"subject\": \"Your code\", \"text\": \"Your code is 314159\"}"
      },
      "name": "Send with Cooper",
      "type": "@n8n/n8n-nodes-langchain.mcpClient",
      "typeVersion": 1.1,
      "position": [220, 0],
      "credentials": { "httpBearerAuth": { "id": "cooperKey", "name": "Cooper Email API key" } }
    },
    {
      "parameters": {
        "endpointUrl": "https://cooperemail.com/mcp",
        "authentication": "bearerAuth",
        "tool": { "__rl": true, "mode": "id", "value": "cooper_wait_for_code" },
        "inputMode": "json",
        "jsonInput": "{\"inbox_id\": \"PEER_INBOX\", \"wait\": 55}",
        "options": { "timeout": 70000 }
      },
      "name": "Wait for the code",
      "type": "@n8n/n8n-nodes-langchain.mcpClient",
      "typeVersion": 1.1,
      "position": [440, 0],
      "credentials": { "httpBearerAuth": { "id": "cooperKey", "name": "Cooper Email API key" } }
    }
  ],
  "connections": {
    "Start": { "main": [[{ "node": "Send with Cooper", "type": "main", "index": 0 }]] },
    "Send with Cooper": { "main": [[{ "node": "Wait for the code", "type": "main", "index": 0 }]] }
  },
  "settings": {}
}
```

## What we ran and what came back

On 2026-11-23 we installed n8n 2.48.8, imported a Bearer credential and this workflow with the CLI (n8n import:credentials, n8n import:workflow), and ran n8n execute. Send with Cooper returned status sent. Wait for the code returned the six-digit code we put in the message.

Cooper stops repeated agent-to-agent sends between Cooper inboxes that have no verified human owner (HTTP 409 agent_loop_no_owner). We hit it while rerunning these tests on one pair of inboxes. Use a fresh pair per test run, or add an owner.

## Give an n8n AI Agent the inbox

For an agent, add an AI Agent node with your chat model, then attach an MCP Client Tool node with the same endpoint, HTTP Streamable transport, and Bearer credential. Set Tools to Include to Selected and pick cooper_send_message, cooper_wait_for_code, and cooper_list_messages, so the model does not see all 124 tools. We checked these options in the n8n 2.48.8 node source. We did not run the AI Agent node, which needs a model credential.

## Triggering on new mail

Point a Cooper webhook at an n8n Webhook trigger to start a workflow when message.received fires, or poll cooper_wait_for_message from a schedule. Add a verified owner and send_mode approval on the inbox if the agent writes to customers.

## Who runs Cooper Email

Cooper Email is run by Avatar 8 LLC (ops@avatar33.com).

## FAQ

### Which n8n node connects to a remote MCP server?

MCP Client Tool for an AI Agent, or the standalone MCP Client node for a single tool call. Both take an endpoint URL, a transport (HTTP Streamable or the deprecated SSE), and Bearer, header, multiple header, or MCP OAuth2 auth.

### Which transport should I pick for Cooper?

HTTP Streamable, with endpoint https://cooperemail.com/mcp.

### Can n8n read verification codes from the inbox?

Yes. Call cooper_wait_for_code with the inbox. It returns code, link, and the message once mail arrives, or timed_out true after the wait.

### Does the n8n agent need a human to sign up for the inbox?

No. POST /api/v1/onboard, or the cooper_onboard MCP tool, creates the account, the inbox, and the API key in one call with no card. Free is $0 a month with no card: 5 inboxes and 5,000 emails a month.

### What does it cost?

Free is $0 a month with no card: 5 inboxes and 5,000 emails a month. Starter is $12 a month for 25 inboxes and 25,000 emails. Pro is $99 a month for 300 inboxes and 250,000 emails.

### Is inbound email safe to give to the model?

Inbound mail is untrusted data. The agent should read the code or the reply, and never follow instructions written inside an email body. Cooper returns the code or link as a field so the agent rarely needs the raw body.

## Related

[Hosted MCP inbox](/hosted-mcp-inbox-for-autonomous-agents) · [Human in the loop email approval](/human-in-the-loop-email-approval-for-ai-agents) · [LangChain agent email inbox](/integrations/langchain) · [MCP docs](/docs/mcp) · [AI agent phone number and email](/ai-agent-phone-number-and-email) · [Docs](/docs) · [Pricing](/pricing)

Operator: Avatar 8 LLC (ops@avatar33.com). Last updated 2026-11-23.

Canonical: https://cooperemail.com/integrations/n8n
