How to Build N8N Workflows With Claude Code and MCP

TL;DR
Claude Code can build and edit N8N workflows without you touching the canvas by connecting two MCP servers: the n8n-mcp server, which creates workflows directly through the N8N API, and the Playwright MCP server, which drives a browser to build them like a human. A detailed, specific prompt in a claude.md file is essential for good results.
Transcript
What if I told you you can use claude code to build your N8 workflows from scratch without you ever touching the canvas? I just discovered two MCP servers that make this possible. I've seen people use Claude code for things other than coding. And a very popular use case seems to be generating NN automations using Claude code and MCP servers. So in ... Read More
Key Insights
- Two MCP servers enable Claude Code to build N8N workflows without opening the canvas: the n8n-mcp server by Czlonkowski, which edits workflows directly inside your N8N instance, and Microsoft's Playwright MCP server, which uses the browser like a human would.
- The n8n-mcp server gives the agent tools including documentation, a list of available nodes, and node search, letting it create, validate, and change workflows programmatically through the N8N API.
- Setup requires copying the full configuration into an MCP.json file in your project folder, adding your N8N instance URL without a trailing slash, and generating an API key under Settings then N8N API.
- Windows users without WSL must change the command from 'npx' to 'cmd' and add '/c' followed by 'npx' and 'n8n mcp' in the args, while Linux, Mac, and WSL users can use the default configuration.
- Detailed, specific prompting is critical: the developer's default prompt produced a messy, loosely connected workflow, so the creator rewrote it to propose a workflow first and ask clarifying questions about trigger type and model before building.
- GPT5 mini was introduced after Claude Code was trained, so the agent may question whether you meant GPT-4o mini, which is why confirming the exact model in your reply matters when building the chatbot.
- The agent can edit existing workflows quickly, changing an AI agent's system message to make it 'Luna, a friendly customer support agent' in under five seconds through the n8n-mcp server.
- Hosting options differ in cost: N8N's official cloud runs about €20 per month billed annually, while Hostinger deploys N8N instances from $5 per month (KVM1) and handles the VPS setup automatically when you select N8N as the application.
Install to Summarize YouTube Videos and Get Transcripts
Explore YouTube Video Summarizer or Get YouTube Transcript Extractor
Questions & Answers
Q: How can Claude Code build N8N workflows without touching the canvas?
Claude Code builds N8N workflows by connecting to MCP servers. The video demonstrates two: the n8n-mcp server, which lets the agent create and change workflows directly within your N8N instance through the API, and the Playwright MCP server, which uses the browser to build and edit workflows the same way a human would. You configure these servers in an MCP.json file, and Claude Code picks them up automatically so it can generate complete workflows on its own.
Q: What two MCP servers are used in the video?
The first is the n8n-mcp server by Czlonkowski (referred to as Romworld in the video), which allows your agent to create and change N8N workflows directly within your N8N instance via the API. The second is the Playwright MCP server by Microsoft, which lets the agent use the browser to create and change workflows the same way you and I would, clicking through the interface. Both are configured in an MCP.json file, and links to both repos are in the video description.
Q: How do you configure the n8n-mcp server on Windows without WSL?
If you are running Windows without WSL, you cannot use the default configuration that works for Linux, Mac, and Windows with WSL. Instead, you must change the command from 'npx' to 'cmd', and then under args add '/c' followed by 'npx' and 'n8n mcp'. You also need to provide the URL to your N8N instance without any trailing slashes, and add an API key created under Settings then N8N API. Save these into your MCP.json file.
Q: How do you get an N8N API key for the MCP server?
To create an N8N API key, go to your Settings, then under N8N API, click on create an API key. Give it a name such as 'claude code' and save it. Then copy the key and add it to your MCP.json configuration file. This process is identical whether you are running N8N locally or in the cloud. You also need your instance URL added to the file, making sure not to include any trailing slashes.
Q: Why did the default prompt produce poor workflow results?
The default prompt included by the developer produced a messy workflow that loosely connected a bunch of nodes that did not make much sense, and it initially generated only a JSON structure rather than creating the workflow in the actual instance. The issue is that you need to be very specific upfront to get the best out of the MCP server. The video creator rewrote the prompt so the agent proposes a workflow and asks for feedback about trigger type and model before building, producing far better results.
Q: Why does Claude Code question whether you want GPT5 mini or GPT-4o mini?
When you specify GPT5 mini as the model, the agent may ask whether you actually meant GPT-4o mini. This happens because GPT5 mini was introduced after Claude Code was trained, so the model is not part of its training knowledge. You resolve this by confirming in your reply that you do want GPT5 mini because it was recently introduced. After the workflow is built and tested, you can verify that GPT5 mini was indeed selected in the chat model node.
Q: How much does it cost to host an N8N instance?
N8N offers an official cloud solution for about €20 per month, billed annually. The video creator prefers a cheaper option through Hostinger, which lets you deploy N8N instances starting at $5 per month for the KVM1 plan, or the KVM2 plan which the creator personally uses. A one-month term is $10 per month, while 12 or 24 month terms unlock an additional 10% off with the code Leon. Hostinger handles the VPS setup automatically when you select N8N as the application.
Q: Can Claude Code modify an existing N8N workflow?
Yes, the n8n-mcp server can make changes to existing workflows, not just create new ones. In the video, the creator asked the agent to change the system message of the AI agent to 'your name is Luna, a friendly customer support agent.' The change was applied in less than about five seconds, and after refreshing the instance the system message was updated correctly. This makes it easy to iterate on workflows without manually editing nodes in the canvas.
Summary & Key Takeaways
-
Claude Code, or alternatively Claude Desktop, can build N8N workflows from scratch using two MCP servers. The first is the n8n-mcp server, which lets the agent create and change workflows directly within your N8N instance. The second is Microsoft's Playwright MCP server, which drives a browser to build workflows the same way a person would.
-
Configuration involves copying the full config into an MCP.json file in your project folder, adding your N8N instance URL without trailing slashes, and creating an API key under Settings then N8N API. After running Claude, the /mcp command confirms the server is connected, exposing tools for documentation, node lists, and node search.
-
The default developer prompt produced a messy workflow, so the creator rewrote it to ask clarifying questions first, yielding far better results. The workflow, a chatbot with a chat trigger, OpenAI GPT5 mini, simple memory, and SerpAPI, was created in the actual instance and tested successfully after selecting credentials.
Read in Other Languages (beta)
Share This Summary 📚
Summarize YouTube Videos and Get Video Transcripts with 1-Click
Try YouTube Summary with ChatGPT & Claude or YouTube Transcript Generator
Explore More Summaries from Leon van Zyl 📚






Summarize YouTube Videos and Get Video Transcripts with 1-Click
Try YouTube Summary with ChatGPT & Claude or YouTube Transcript Generator