Automation tools

Connect a mailbox to n8n, Zapier, Gumloop or Lindy by its MCP URL, or use the REST API and a webhook.

On this page
  1. Before you start
  2. n8n
  3. Zapier
  4. Gumloop
  5. Lindy
  6. If it doesn't work

Before you start

  • The MCP URL is https://api.postyard.dev/mcp, over Streamable HTTP.
  • For a workflow that runs unattended, create an API key under Agents & API > API keys. Pick Read and draft and limit it to one mailbox. Choose Read, draft and send only if the workflow must send.
  • If you sign in with OAuth instead, choose the connection's mailboxes under Agents & API > Connections afterwards.
  • Every connection lists all 13 tools. The server refuses the ones the key may not use. The tool table says what each may change.

Anyone can email your mailbox, so the text your workflow reads is untrusted. Let the model draft, and let a person send.

n8n

A tool as a workflow step

The MCP Client node runs one tool as a normal step.

  1. Add the MCP Client node. Set Server Transport to Streamable HTTP and MCP Endpoint URL to https://api.postyard.dev/mcp.
  2. Under Authentication, pick Bearer and paste your API key. Or pick OAuth2 and create an MCP credential: leave Register Client Automatically on (older versions call it Use Dynamic Client Registration), and sign in.
  3. Pick a Tool. n8n fetches the list from the server.
  4. Fill in its parameters, by hand or as JSON.

Tools for an AI Agent node

Connect the MCP Client Tool to your AI Agent with the same URL and credential. Set Tools to Include to Selected and pick only what the agent needs, for example list_conversations, get_conversation, get_message, create_reply_draft and mark_handled.

New mail starts the workflow

This uses the REST API and a Postyard webhook, with no MCP.

  1. Add a Webhook node as the trigger. Set HTTP Method to POST and Respond to Immediately.
  2. Publish the workflow and copy the node's Production URL.
  3. In Postyard, open Agents & API > Webhooks, click Add endpoint, paste the URL and tick only message.received.
  4. Add an HTTP Request node that reads the message. Use Generic Credential Type, Bearer Auth and your API key:
Text
GET https://api.postyard.dev/v1/messages/{{ $json.body.data.message_id }}
  1. Continue only if {{ $json.message.folder }} is inbox. The event also fires for mail filed in Junk. The body is in {{ $json.text }}.
  2. Write the reply in any node you like, then save it as a draft in the same thread. Send a JSON body with the field text:
Text
POST https://api.postyard.dev/v1/messages/{{ $('Webhook').item.json.body.data.message_id }}/reply-drafts
  1. Mark the message as handled, so it drops out of the queue. The JSON body is {"handled": true}:
Text
POST https://api.postyard.dev/v1/messages/{{ $('Webhook').item.json.body.data.message_id }}/handled

The same calls with curl, for trying them first or for Import cURL in the node:

Shell
curl https://api.postyard.dev/v1/messages/MESSAGE_ID \
  -H "Authorization: Bearer $POSTYARD_API_KEY"

curl -X POST https://api.postyard.dev/v1/messages/MESSAGE_ID/reply-drafts \
  -H "Authorization: Bearer $POSTYARD_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text": "Thanks, we are on it.", "reply_all": false}'

curl -X POST https://api.postyard.dev/v1/messages/MESSAGE_ID/handled \
  -H "Authorization: Bearer $POSTYARD_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"handled": true}'

Keep the webhook URL private. This workflow takes only the message ID from the webhook and reads the rest with its own key, so a forged call can at most make it draft a reply to, and mark as handled, a message the key can already reach. If yours trusts more of the webhook body, verify the signature first.

Zapier

Zapier's MCP Client app connects to a remote MCP server. Zapier labels it a beta.

  1. On Zapier's Apps page, click + Add connection, search for MCP Client, and click Add connection.
  2. Enter https://api.postyard.dev/mcp as the Server URL and choose Streamable HTTP.
  3. Set OAuth to Yes and sign in with your Postyard account. Or leave it at No and paste an API key as the Bearer Token; with OAuth set to Yes, Zapier ignores that field.
  4. Click Yes, Continue to MCP Client.
  5. In a Zap, add the Run Tool action and pick a tool, such as create_draft.

Zapier MCP is a different product. It goes the other way: it gives your AI app Zapier's actions.

Gumloop

From Gumloop's docs:

  1. Open Customize > Connectors and click + (Add Custom MCP).
  2. Enter https://api.postyard.dev/mcp as the MCP Server URL and click Connect.
  3. Gumloop shows the detected authentication. Click Authenticate and sign in. For a key, choose API Key / Credentials and paste it as the access token.
  4. Open your agent, click + Add under Connectors, add the server and click Save.

Gumloop says there are no approval prompts before a tool runs. Keep this connection on Read and draft.

Lindy

From Lindy's docs:

  1. In Integrations, select MCP server. If you see + Add, open it and choose MCP.
  2. Paste https://api.postyard.dev/mcp into MCP link and set a Display name.
  3. For OAuth, leave Advanced empty. For an API key, open Advanced and send it as an Authorization bearer token.
  4. Select Connect and finish the sign-in.

Every action arrives switched on. Open the server, and under Actions turn off send_draft, reply_to_message and send_message. Under Guardrails you can choose Ask for approval.

If it doesn't work

An empty mailbox list means the connection has no mailboxes yet. Errors are explained under troubleshooting. Or write to support.