Skip to main content

Add an MCP Client Node

  1. In your n8n workflow, add an MCP Client node
  2. Set Transport to Streamable HTTP
  3. Set URL to https://mcp.actionlayer.dev/mcp
  4. Under Headers, add:
    • Key: Authorization
    • Value: Bearer YOUR_API_KEY
  5. Click Test connection — you should see 13 tools listed

Example Workflow: Draft Reply on Inbound Email

This workflow triggers when a new thread needs review and submits a draft:
Webhook (POST from ActionLayer)
  → Get Thread (MCP: get_thread)
  → AI Node (generate reply text)
  → Submit Draft (MCP: submit_draft)

Step 1 — Receive the webhook

Configure ActionLayer to POST to your n8n webhook URL when draft.needs_review fires.

Step 2 — Get the thread

Add an MCP Client node:
  • Tool: get_thread
  • Input: {"thread_id": "{{ $json.thread_id }}"}

Step 3 — Generate a reply with AI

Use n8n’s built-in AI node or HTTP Request to your preferred LLM. Pass the thread messages as context.

Step 4 — Submit the draft

Add an MCP Client node:
  • Tool: submit_draft
  • Input:
{
  "thread_id": "{{ $('Get Thread').item.json.id }}",
  "identity_id": "{{ $('Get Thread').item.json.identity_id }}",
  "based_on_message_id": "{{ $('Get Thread').item.json.messages[-1].id }}",
  "subject": "{{ $('AI Node').item.json.subject }}",
  "body": "{{ $('AI Node').item.json.body }}",
  "rationale": "{{ $('AI Node').item.json.rationale }}"
}
The draft appears in your ActionLayer dashboard for approval before anything sends.

Triage Workflow

Run a scheduled triage every 15 minutes:
Schedule Trigger (every 15 min)
  → List Threads (MCP: list_threads, needs_review: true)
  → Loop over threads
  → Notify via Slack / Email