The setup, the prompt, and what it costs
People are building their n8n automations with Claude Code now instead of dragging boxes around.
You describe the automation you want, and Claude Code picks the nodes, connects them, checks the workflow for errors and puts it in your n8n. If you don't like what it built, you tell it what to change.
Below is the whole setup: what you need, the install commands, the prompt to paste, what it costs, and the mistakes to avoid.
Find 5 ways AI automation can make your business more money, ranked by revenue. Get your plan.
How it works
On its own, Claude Code knows roughly what n8n is, but it doesn't know the exact settings of every node, so it guesses, and the workflow breaks.
A developer fixed that by building a free, open-source tool called n8n-MCP. It gives Claude Code the documentation for every n8n node, so it builds with the real settings instead of guessing. It has over 23,000 stars on GitHub and covers about 3,500 nodes (around 840 built into n8n plus the community ones).
Once it's installed, Claude Code can look up the right nodes, wire them together, validate the workflow, and, if you give it access, create it straight in your n8n account.
What you need
- Claude Code. It comes with a paid Claude plan: Pro is $20 a month ($17 a month billed yearly), and Max starts at $100 a month. It's not on the free plan.
- n8n. Either self-host it for free (n8n's license lets you use it for your own business) or use n8n Cloud. Cloud starts at €20 a month billed yearly for 2,500 workflow runs, with a 14-day free trial. One catch: the n8n API isn't available during the free trial, so to have Claude Code create workflows in a Cloud account, you need a paid plan.
- Node.js on your computer, because n8n-MCP runs through
npx.
Step 1: Install n8n-MCP
Paste this into your terminal (Mac, Linux, or Windows through WSL or Git Bash):
claude mcp add n8n-mcp \
-e MCP_MODE=stdio \
-e LOG_LEVEL=error \
-e DISABLE_CONSOLE_OUTPUT=true \
-- npx n8n-mcp
That gives Claude Code the node docs, so it can design workflows and hand you the result to import.
Step 2: Connect it to your n8n (so it builds it for you)
To let Claude Code create the workflow in your account instead of handing you a file:
- In n8n, go to Settings, then n8n API, and create an API key. Copy it right away, it's only shown once.
- Run the same command with your n8n address and the key added:
claude mcp add n8n-mcp \
-e MCP_MODE=stdio \
-e LOG_LEVEL=error \
-e DISABLE_CONSOLE_OUTPUT=true \
-e N8N_API_URL=https://your-n8n-instance.com \
-e N8N_API_KEY=your-api-key \
-- npx n8n-mcp
If you already ran step 1, remove the first one before adding this one: claude mcp remove n8n-mcp.
A few things that save headaches:
- For n8n running on your own computer, the address is usually
http://localhost:5678. - Check it worked with
claude mcp list, or type/mcpinside Claude Code. - On Windows in PowerShell (not WSL or Git Bash), the command needs a different format. The n8n-MCP Claude Code setup guide on GitHub has the PowerShell version.
- Don't want to run anything locally? n8n-MCP also has a hosted version with a free tier of 100 tool calls a day.
Step 3 (optional): Add the n8n skills
The same developer also made a free set of Claude Code skills that teach it n8n's expression syntax, common workflow patterns, validation and Code nodes. It makes the first build right more often. Inside Claude Code, run:
/plugin install czlonkowski/n8n-skills
Step 4: Paste one prompt
Open Claude Code and describe what you want. Be specific about the trigger, the steps, and where things go. Here's the shape I use:
Build an n8n workflow:
Trigger: when someone books a call in Calendly.
Then:
1. Add them to HubSpot as a contact, with the booking date in a note.
2. Send them a confirmation email from Gmail with a short prep question.
3. The day before the call, send a reminder email.
4. Post a message in our #sales Slack channel with their name and company.
Use the n8n-mcp tools to look up the real node settings, don't guess
parameters. Validate the workflow before creating it. Create it in my n8n as
inactive, and tell me which credentials I need to connect.
Claude Code will search the nodes, build it, run the validation, fix what fails, and create it in your n8n. You open it, connect your accounts (Calendly, HubSpot, Gmail, Slack) in the credential fields, run a test, and turn it on.
Swap in your own tools. A few I'd start with for a high-ticket business:
- Lead follow-up: when a form is submitted, add the lead to the CRM, send a reply within a minute, and alert me if they don't open it in a day.
- No-show catch: when a call is marked no-show, send a reschedule email and a text an hour later.
- New client onboarding: when a payment comes in from Stripe, create the client folder in Google Drive, send the welcome email, and add the onboarding tasks to my project board.
Step 5: Check it, then change it
This is the part people skip. Before you turn it on:
- Run it once with test data. Open the workflow in n8n and run it manually with a fake lead. Check every step got what it expected.
- Look at the emails it sends. AI-written email copy inside the workflow still needs to sound like you.
- Tell it what to change. "Wait two hours before the reminder instead of one day." "Skip Slack if the company field is empty." It edits the same workflow, you don't start again.
You can also just open the workflow in n8n and edit it yourself. It's a normal n8n workflow.
Mistakes to avoid
- Don't let AI edit a live workflow that's making you money. The n8n-MCP docs say it plainly: never edit production workflows directly with AI. Have it make a copy, test the copy, then swap it in. Export a backup first.
- Don't skip the "don't guess" line. Default settings are the most common reason AI-built workflows fail when they run. Telling it to look up the real settings and validate fixes most of that.
- Keep your API key out of chats and shared files. It gives full access to your n8n account. If it leaks, delete it in n8n and make a new one.
Already on a recent n8n?
n8n now has its own built-in MCP connection too, which lets Claude Code search, run and build workflows in your account. Turn it on in Settings, then Instance-level MCP, and connect it with:
claude mcp add --transport http n8n https://your-n8n-domain/mcp-server/http
Then type /mcp in Claude Code, pick n8n and sign in. Building and editing workflows this way needs n8n 2.13 or newer, and you have to switch on each workflow you want it to see. You can use it alongside n8n-MCP: one connects to your account, the other gives Claude Code the full node docs.
Find 5 ways AI automation can make your business more money, ranked by revenue. Get your plan.

