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
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.
- Add the MCP Client node. Set Server Transport to Streamable HTTP and MCP Endpoint URL to
https://api.postyard.dev/mcp. - 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.
- Pick a Tool. n8n fetches the list from the server.
- 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.
- Add a Webhook node as the trigger. Set HTTP Method to POST and Respond to Immediately.
- Publish the workflow and copy the node's Production URL.
-
In Postyard, open Agents & API > Webhooks, click Add
endpoint, paste the URL and tick only
message.received. - Add an HTTP Request node that reads the message. Use Generic Credential Type, Bearer Auth and your API key:
GET https://api.postyard.dev/v1/messages/{{ $json.body.data.message_id }}-
Continue only if
{{ $json.message.folder }}isinbox. The event also fires for mail filed in Junk. The body is in{{ $json.text }}. - 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:
POST https://api.postyard.dev/v1/messages/{{ $('Webhook').item.json.body.data.message_id }}/reply-drafts- Mark the message as handled, so it drops out of the queue. The JSON body is
{"handled": true}:
POST https://api.postyard.dev/v1/messages/{{ $('Webhook').item.json.body.data.message_id }}/handledThe same calls with curl, for trying them first or for Import cURL in the node:
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.
- On Zapier's Apps page, click + Add connection, search for MCP Client, and click Add connection.
- Enter
https://api.postyard.dev/mcpas the Server URL and choose Streamable HTTP. - 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.
- Click Yes, Continue to MCP Client.
- 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:
- Open Customize > Connectors and click + (Add Custom MCP).
- Enter
https://api.postyard.dev/mcpas the MCP Server URL and click Connect. - Gumloop shows the detected authentication. Click Authenticate and sign in. For a key, choose API Key / Credentials and paste it as the access token.
- 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:
- In Integrations, select MCP server. If you see + Add, open it and choose MCP.
- Paste
https://api.postyard.dev/mcpinto MCP link and set a Display name. - For OAuth, leave Advanced empty. For an API key, open Advanced and send it as an Authorization bearer token.
- 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.