---
title: "Send email and SMS from an n8n AI agent with MCP"
description: "Connect an n8n AI Agent to Unitpost with the MCP Client Tool and a Bearer API key, or call the REST API from an HTTP Request tool."
url: https://www.unitpost.com/blog/agents/n8n-ai-agent-email-sms
section: Blog
updated: 2026-11-02
---
# Send email and SMS from an n8n AI agent with MCP

Unitpost has no native n8n node, so there are two routes. Attach an MCP Client Tool to the AI Agent with the endpoint https://mcp.unitpost.com/mcp?toolsets=sending,sms, Server Transport set to HTTP Streamable and a Bearer Auth credential holding a scoped API key, then include only email_send and sms_send. Or attach an HTTP Request node as a tool that posts to /api/v1/email, and let the model fill only the fields you leave open.

## Send email and SMS from an n8n AI agent with MCP

> Connect an n8n AI Agent to Unitpost with the MCP Client Tool and a Bearer API key, or call the REST API from an HTTP Request tool.

n8n's AI Agent node decides which tools to call. Unitpost doesn't ship an n8n node, but an n8n agent can use the same tools Claude or Cursor use, through Unitpost's hosted MCP server, or call the REST API through the HTTP Request node. Both routes end in the same API call, with the same scopes, rate limits and verified-domain gate.

### MCP Client Tool or HTTP Request: which one?

n8n's MCP servers page (https://docs.n8n.io/build/integrate-ai/mcp-servers) states the trade-off well: a built-in tool gives you tighter control, because you fix the operation and pin parameters so the model fills only what you leave open, while an MCP server gives the agent more room, at the cost of control and more context per call.

- MCP Client Tool. The agent gets Unitpost's tools with their descriptions and input schemas, can read a send back with `email_get`, and gets a hint with each error. Use it when the agent should decide what to send, inside a list of tools you allow.
- HTTP Request tool. You fix the URL, the From address and, if you like, the recipient. The model writes only the subject and the text. Use it when the agent drafts and your workflow decides who gets it.

### Create a key for the workflow

In Unitpost, open Settings → API keys. The Sending only preset works on every plan. On a paid plan, open Advanced and keep only `emails:send`, plus `sms:send` if the agent texts. Give each workflow its own key, so you can revoke one without stopping the others.

The key goes into an n8n credential, not into a node, so it never appears in the workflow's JSON.

n8n's MCP OAuth2 credential (https://docs.n8n.io/integrations/builtin/credentials/mcp) is the other option. By default it registers itself with the server through Dynamic Client Registration, which Unitpost's authorization server accepts for an https callback, or a localhost one. Unitpost's consent screen marks a self-registered client's name as unverified. For a workflow on a server with nobody at a browser, a key is simpler: you choose its exact scopes and revoke it in one place.

### How do I connect the MCP Client Tool?

- Add an AI Agent node. Per n8n's AI Agent docs (https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.agent), it needs a chat model and at least one tool sub-node.
- On its Tools connector, add an MCP Client Tool.
- Endpoint: `https://mcp.unitpost.com/mcp?toolsets=sending,sms`, or `?toolsets=sending` for email only. The `toolsets` parameter lists those groups instead of the full default set, which keeps tool definitions out of the model's context.
- Server Transport: HTTP Streamable. Unitpost's server answers POST and keeps no SSE stream, so the Server Sent Events option won't connect.
- Authentication: Bearer Auth. In the credential's Bearer Token field, paste only the `pk_live_…` value. n8n sends it as `Authorization: Bearer <token>`.
- Tools to Include: Selected, then `email_send` and `sms_send`, plus `email_get` if the agent should check a send.

One naming wrinkle: n8n's page for this node (https://docs.n8n.io/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.toolmcp) still calls the URL field SSE Endpoint. That is the node's first version. In the node's source, versions 1.1 and later show Endpoint and Server Transport, and HTTP Streamable is the default from 1.2.

`email_send` takes the API's body fields and an `idempotency_key`. Have the agent derive the key from the thing it is working on, such as an order or ticket id: the same key within 24 hours returns the first result instead of sending twice, and the same key with a different body is refused with a 409. When a call fails, the agent gets the API's `{ error: { code, message, details } }` and a `hint` with the next move.

### How do I call the API with the HTTP Request node instead?

The HTTP Request node can run as a regular step or attached to an AI Agent as a tool. Attach it, choose Import cURL, and paste Unitpost's send example:

```bash
curl https://www.unitpost.com/api/v1/email \
  -H "Authorization: Bearer $UNITPOST_API_KEY" \
  -H "Content-Type: application/json" \
  -H "User-Agent: my-app/1.0" \
  -d '{
    "from": "Acme <you@yourdomain.com>",
    "to": "customer@acme.com",
    "subject": "Welcome aboard",
    "html": "<p>Thanks for signing up.</p>"
  }'
```

Then adjust what the import filled in:

- Delete the Authorization header and set Authentication to a Generic Credential Type, Bearer Auth, with the key's credential.
- Keep `from` fixed. Fix `to` too, from the item the workflow is handling, unless the agent must choose the recipient.
- Replace the subject with `{{ $fromAI('subject') }}` and swap `html` for `text` with `{{ $fromAI('body', 'Plain-text email body') }}`. `$fromAI()` (https://docs.n8n.io/build/integrate-ai/ai-examples/use-ai-for-parameters) works only in tools connected to the AI Agent, and its arguments are hints to the model, not references to existing values.
- Add an `Idempotency-Key` header built from the same stable id.

For a text, post to `https://www.unitpost.com/api/v1/sms` with `to` in E.164 format and `body`. Without a paid plan, it answers `403 limit_reached`.

### How do I keep the agent inside a lane?

Put a person in front of the sends that matter. n8n can require human review for a tool (https://docs.n8n.io/build/integrate-ai/ai-examples/human-in-the-loop-for-tools): the workflow pauses, a reviewer sees the tool and its parameters in Chat, Slack, Gmail, Teams or another channel, and approves or denies. A denied call doesn't run, and the agent is told. Use it for `sms_send`, for anything to a new recipient, and for anything one-to-many. How to make an AI agent ask before it sends email (/blog/agents/ai-agent-approval-before-send) covers which sends deserve it.

Unitpost holds its side whatever the workflow does:

- A From address on a domain that isn't verified in the key's workspace gets `403 domain_not_verified`.
- An address that hard bounced or complained is on the suppression list, and every send skips it.
- A key without `sms:send` can't text, however the agent asks.

One rule no setting enforces for you: send only transactional mail and mail to people who opted in. An agent that finds addresses on the web and writes to them is cold outreach, and Unitpost's Acceptable Use Policy prohibits it on every plan, B2B included.

## FAQ

### Is there a Unitpost node for n8n?

No. Unitpost has no native n8n node. An n8n AI agent reaches it through the MCP Client Tool node, which connects to Unitpost's hosted MCP server, or through the HTTP Request node calling the REST API with a Bearer key. Both end in the same API call, and both work on every plan. SMS needs a paid plan.

### Should n8n sign in to Unitpost with OAuth or an API key?

An API key. n8n's MCP OAuth2 credential can register itself with Unitpost's authorization server, but a workflow runs on a server with nobody at a browser. A key dedicated to the workflow has exactly the scopes you picked, sits in n8n's encrypted credential store, and can be revoked without touching anything else.

### Why doesn't the MCP Client Tool list Unitpost's tools?

Check the Server Transport first. Unitpost's MCP server speaks HTTP Streamable and keeps no SSE stream, so the deprecated Server Sent Events option can't connect. Then check the credential: a 401 Invalid API key usually means a mistyped key or a missing Bearer prefix. With n8n's Bearer Auth credential, paste only the pk_live_ value.

## Related

- [Personalize onboarding emails with an LLM without losing control](https://www.unitpost.com/blog/agents/personalize-onboarding-email-llm): Keep the onboarding template fixed and reviewed, let an LLM fill named variables from product data, check each value, and send once with an idempotency key.
- [Send a product update email with Claude and an MCP server](https://www.unitpost.com/blog/agents/product-update-email-with-claude): Turn a changelog into a product update with Claude and Unitpost's MCP tools: segment, topic, template, validation and a test send, then a person sends it.
- [How to protect an AI email agent from prompt injection](https://www.unitpost.com/blog/agents/protect-ai-email-agent-prompt-injection): Keep inbound mail from steering an AI agent: treat bodies as data, check DMARC and the webhook signature, scope the key, and approve the unusual.
