inzpyre.me
Learn AIExamples

04 · n8n · MCPs · Self-hosted

Build automation with AI.

From workflow concept to a running cron job. We plan automations with Cowork, generate the n8n JSON with Claude Code via the n8n MCP, and host the whole thing for under ten euros a month on Hetzner.

We have no partnerships with n8n or Hetzner. We recommend what we use ourselves.

Setup

Before you automate — the four steps.

Claude Code is the anchor. Around it you build your tool set: an automation tool, the matching MCP, and a hosting setup that doesn't blow up on your first production workflow.

  1. Step 01

    Install Claude Code

    Claude Code is the anchor of the whole setup — you build and import your workflows with it. If you've done the „Build products with AI“ cluster, this is nothing new. Install via the terminal, in VS Code, or alongside in the desktop app.

    bash·Install via terminal
    npm install -g @anthropic-ai/claude-code
  2. Step 02

    Pick an automation tool — n8n, Make or Zapier

    Three sensible options. n8n (open source, official MCP server, self-hostable) — our pick if you want to generate workflows with Claude Code. Make.com (SaaS, visual editor, huge integration library) — good if you think visually and don't want self-hosting. Zapier (8,000+ integrations, friendliest onboarding) — good if you just want to connect a few apps without digging in deeper. For DACH/EU all three offer EU regions. For AI-driven workflow generation, n8n stays ahead.

  3. Step 03

    Connect an MCP for your tool

    With an MCP server, Claude Code reads and writes directly in your workflow instance — generates workflow JSON, imports it, tests trigger payloads. As of May 2026: n8n has the official n8n MCP. Make and Zapier don't have an official MCP — those you build manually in the editor and only use Claude Code for the logic planning. Snippet below is for n8n.

    bash·n8n MCP connected to Claude Code (if you picked n8n)
    claude mcp add n8n --transport http \
      "https://YOUR-N8N-DOMAIN/mcp" \
      --header "Authorization: Bearer YOUR_N8N_API_KEY"
  4. Step 04

    Pick hosting

    Pick a cloud where you host yourself. Self-hosted is cheaper than managed cloud and gives you full control over data and workflows. With Make or Zapier you don't get the choice — those run cloud-managed only.

    Our pick: Hetzner Cloud, from €5/month

    CX22 (2 vCPU, 4 GB RAM), EU region Falkenstein or Nuremberg. n8n + Postgres + Caddy as a Docker Compose stack, Claude Code rolls it out initially. Same thing works on DigitalOcean, AWS Lightsail or Scaleway — Hetzner wins on price-performance.

How the generation flow runs after that

Three steps from briefing to a running workflow.

  1. 1

    Plan the workflow

    You describe what the automation should do with Cowork. At the end, a markdown file falls out with trigger, data sources, transformations and output.

  2. 2

    Hand the markdown to Claude Code

    Claude Code reads the briefing and builds the n8n nodes directly in your instance — trigger, AI calls, filters, output. You don't have to drag boxes around any more.

  3. 3

    Add credentials

    For each tool in the workflow (Gmail, Notion, Stripe, …) you add an OAuth token or API key in n8n. The workflow only runs live after that.

Workflow planning

Plan with Cowork first, then let it generate.

You plan the workflow itself with Cowork. The briefing walks through trigger, data sources, transformations and output in dialogue — you don't have to structure it beforehand. Less is more.

Copy the prompt below into Cowork, answer the questions. At the end, a markdown file falls out that you hand to Claude Code — and it builds the n8n JSON from it.

text·workflow-briefing.md
I want to plan an n8n workflow. Please ask me four blocks of questions, one after another:

1) Trigger — what starts the workflow?
2) Data sources — which tools does n8n have to read?
3) Transformations — what happens between trigger and output?
4) Output — what happens at the end?

Per block, always ask only one question at a time and wait for my answer.
If I get vague, ask for concrete examples.

At the end, create a markdown file "workflow-briefing.md" with:
- workflow name
- trigger (type + configuration)
- data sources (with auth method)
- transformation logic (step by step)
- output (with example payload)
- known edge cases

n8n + Claude Code

What a typical generation prompt looks like.

With the n8n MCP connected, you don't build workflows by clicking any more. You describe them. Claude Code reads the existing n8n state, plans the JSON, imports it into your instance, and hands you back the workflow link.

Workflow as prose

You describe in one sentence what should happen — Claude Code generates the n8n JSON. Instead of dragging 40 nodes around, you speak the workflow.

Iterable in code

Workflows live as JSON in Git. Diff, branch, review. Instead of a click editor you get version control like real code.

Test data generated

Claude Code also writes example payloads for the trigger webhooks for every workflow. You test directly, without needing live data.

Docs included

For every workflow Claude Code drops a README.md in the repo — trigger, steps, edge cases. When you come back three months later, you still know what's running.

Example: Claude Code generates the social-media-reels automation

You hand Claude Code the workflow briefing from the planning phase and say:

text·Claude Code prompt
Read social-media-reels-workflow.md and build an n8n workflow from it.
The workflow takes a one-pager input (headline, body, image assets, hashtags)
and automatically generates a reel video for Instagram, TikTok, and LinkedIn.

[Alex delivers: detailed workflow steps — trigger, AI calls for script
and voiceover, asset generation via Remotion or video API, posting targets
with auth setup, logging, and error handling.]

Import the workflow directly into our n8n instance via MCP.
Also write a README.md with a trigger payload example and edge cases.

Claude Code reads your briefing, generates the JSON, calls the n8n MCP, imports the workflow, hands you back the n8n editor link. You check visually, click „Activate“. Done.

Hetzner self-hosted

n8n on Hetzner — five euros a month, full data control.

Once you automate regularly, self-hosted pays off. A Hetzner CX22 (2 vCPU, 4 GB RAM, 40 GB SSD) is enough for n8n + Postgres + Caddy as a reverse proxy. Frankfurt or Falkenstein, EU region, GDPR-compliant.

Cost comparison

VariantPriceExecutionsNote
n8n Cloud Starterapprox. €24/month2,500 executionsComfortable, but costs scale fast once workflows go to production.
n8n Cloud Proapprox. €60/month10,000 executionsWorth it if you don't want your own infrastructure and stay below the Pro cap.
Self-hosted (Hetzner CX22)around €5/monthUnlimited (until resource cap)Server know-how required. EU region, full data control, no lock-in. Our pick from the first production workflow on.

Minimal Docker Compose stack

n8n runs as a Docker container next to Postgres and Caddy. Caddy handles HTTPS automatically via Let's Encrypt — you don't have to configure any certificates.

yaml·docker-compose.yml
services:
  postgres:
    image: postgres:16
    restart: unless-stopped
    environment:
      POSTGRES_USER: n8n
      POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
      POSTGRES_DB: n8n
    volumes:
      - postgres_data:/var/lib/postgresql/data

  n8n:
    image: n8nio/n8n:latest
    restart: unless-stopped
    environment:
      DB_TYPE: postgresdb
      DB_POSTGRESDB_HOST: postgres
      DB_POSTGRESDB_DATABASE: n8n
      DB_POSTGRESDB_USER: n8n
      DB_POSTGRESDB_PASSWORD: ${POSTGRES_PASSWORD}
      N8N_HOST: ${N8N_HOST}
      N8N_PROTOCOL: https
      WEBHOOK_URL: https://${N8N_HOST}/
      GENERIC_TIMEZONE: Europe/Berlin
    depends_on:
      - postgres
    volumes:
      - n8n_data:/home/node/.n8n

  caddy:
    image: caddy:2-alpine
    restart: unless-stopped
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - ./Caddyfile:/etc/caddy/Caddyfile
      - caddy_data:/data
      - caddy_config:/config

volumes:
  postgres_data:
  n8n_data:
  caddy_data:
  caddy_config:

Let Claude Code roll out the setup on the server. Add SSH key, clone the repo, [docker compose up -d]. A backup cron is part of it — Claude writes the script along with it.

If you don't know how all of this works, just ask Claude Code: it knows the stack, walks you through step by step and corrects you when you mistype. You don't have to remember any of it — you only have to describe what should run at the end.

Example workflow

Generate social-media reels automatically.

One-pager in, a finished reel out — automatically generated video for Instagram, TikTok and LinkedIn. Fully in n8n, generated via Claude Code, runs on Hetzner. Reusable: take the briefing, adapt it to your use case, have Claude Code rewrite the workflow.

What the workflow does

From one-pager to a finished reel

[Alex to deliver: detailed description of the workflow steps — trigger (webhook or schedule), AI calls for script and voiceover, asset generation via Remotion or video API, posting targets (Instagram Graph, TikTok, LinkedIn), logging and error handling.]

n8n workflow in the editor

What the workflow looks like in n8n

n8n workflow in the editor — node structure of the social media reels workflow
The result

An automatically generated reel

Take with you

Workflow briefing as markdown

The full workflow briefing as markdown — drop it straight into Claude Code, adapt it to your use case, done. Reusable for every reel workflow you want to build.

Social media reels workflow · One-PagerMarkdown · to adapt and pass on

Learning lever

Two years ago you couldn't build this workflow in an hour. Today: write the briefing once, let Claude Code ship it on self-hosted n8n via MCP, five minutes of testing. Once the pattern clicks, every new workflow takes the same time.

On to the next station

Examples

Our own apps. With story, trick and tech stack.

Take a look