How to Connect Claude Code to n8n with MCP: The Short Version
Real talk - the reason most people's n8n automations break is that the AI building them is guessing. It half-remembers what a node does, wires the wrong field, and you spend an hour fixing the thing that was supposed to save you an hour. The n8n MCP server kills that problem. It hands Claude Code real, structured knowledge of n8n's 1,851 nodes (822 core plus 1,029 community), so it builds from the actual node docs instead of vibes. 🎯
The project is czlonkowski/n8n-mcp on GitHub, sitting north of 20,000 stars (https://github.com/czlonkowski/n8n-mcp). It is a Model Context Protocol server, which is the open standard Claude Code uses to reach outside tools. If you have never set one up, start with our explainer on what MCP servers are and why they matter (/blog/what-are-mcp-servers-and-why-they-matter), then come back here and wire your first real one.
Two levels to this. Without an n8n API key, Claude Code gets the documentation and validation tools - it can look up any node and check a workflow before you paste it in. Add your n8n API URL and key and it gets the management tools too - it can create, update, test and deploy workflows directly into your instance. We will set up both.
Install the n8n MCP Server
The fastest way to try it is npx - no install, no clone. You point Claude Code at the package and it pulls and runs the server the first time you use it. If you would rather self-host, the repo documents Docker, Railway and a local build (git clone, npm install, npm run build, npm run rebuild, npm start), but do not start there. Start with npx and earn the complexity later.
For the documentation-only tier you need nothing but Node installed. For the full tier, grab two things from your n8n instance: your API URL (looks like https://your-instance.app.n8n.cloud) and an API key from Settings, n8n API. Keep them handy - they go into the MCP server's environment as N8N_API_URL and N8N_API_KEY.
Wire It Into Claude Code
From your terminal, register the server with the Claude Code MCP command. The documentation-only setup is one line pointing at the npx package. For full access you pass the same command plus the two environment variables. Here is the order that works:
- Run claude mcp add to register the n8n MCP server, pointing at the npx package.
- For full access, add N8N_API_URL and N8N_API_KEY as environment variables on that server.
- Restart Claude Code and run /mcp to confirm the n8n server shows as connected.
- Ask Claude to list a few n8n nodes - if it answers with real node names and fields, the docs layer is live.
That /mcp check is the step people skip and then wonder why nothing works. If the server is not listed, it is almost always a Node version issue or a typo in the package name. Fix that before you try to build anything.
Docs-Only vs Full API Mode
What you get with and without an n8n API key
| Capability | Docs only | Full API mode |
|---|---|---|
| Look up any of the 1,851 nodes | Yes | Yes |
| Validate a workflow before you run it | Yes | Yes |
| Create a workflow in your instance | No | Yes - n8n_create_workflow |
| Make targeted edits to a live workflow | No | Yes - n8n_update_partial_workflow |
| Run a workflow to test it | No | Yes - n8n_test_workflow |
Have Claude Code Build the Workflow
Now the fun part. With full mode on, you describe the automation in plain English and Claude Code does the build loop itself. The tools it reaches for are n8n_create_workflow to deploy, n8n_validate_workflow to check the result, n8n_update_partial_workflow to make targeted edits without rewriting the whole thing, and n8n_test_workflow to run it.
The rhythm that works is the same one that works for any Claude Code build: one tight slice at a time. Do not ask for a full CRM sync with enrichment and Slack alerts in one prompt. Ask for the trigger and one action, watch it validate, then add the next node. Because Claude is reading the real node properties through MCP, the validation step actually catches the field mismatches before they hit your instance. ⚡
Quick example of the payoff. A daily outreach workflow - pull five rows from a Google Sheet, research each contact, draft a personalized email, log the result - is the kind of thing that used to take a careful afternoon of clicking through n8n's UI. With the MCP server wired in, you describe it, Claude builds and validates it node by node, and you are testing a live version inside an hour. That is the whole difference. No cap.
What to Build First (and Bill For)
Do not start with the flashy agent demo. Start with the boring workflows businesses actually pay for, because those are the ones with an obvious dollar value attached:
- Lead reactivation - re-engage a database of old leads on a schedule. The revenue is already paid for; you are just collecting it.
- Internal reporting - pull numbers from a few tools each morning and drop one clean summary in Slack. Fixes the visibility gap that slows every decision.
- Outreach and research - the daily five-rows-at-a-time system above, personalized and logged.
Each of those is a fixed-scope deliverable, not an hourly grind. Build it once with Claude Code and the n8n MCP server, validate it, hand it over. If you are turning this into client work, the pricing logic matters as much as the build - we walked through exactly how to charge for it in our guide on Claude Code workflows that get you paid (/blog/5-claude-code-workflows-that-get-you-paid), and you can see more of what I am building on my author page (/author/david-iya). 💎
The bigger point: connecting Claude Code to n8n is the moment the tool stops being a code assistant and starts being an automation engineer that lives in your real stack. Wire it up this week, build one boring workflow, and ship it. 🔥
Frequently asked questions
What is the n8n MCP server?
It is a Model Context Protocol server, czlonkowski/n8n-mcp on GitHub, that gives Claude Code structured access to all 1,851 n8n nodes - 822 core and 1,029 community. With it connected, Claude builds n8n workflows from the real node documentation instead of guessing at fields and operations.
Do I need an n8n API key to use it?
Not for the basics. Without a key you get the documentation and validation tools, so Claude can look up nodes and check a workflow. Add your N8N_API_URL and N8N_API_KEY and Claude can also create, update, test and deploy workflows straight into your instance.
What is the fastest way to install it?
The npx method - no clone, no install. You register the package as an MCP server in Claude Code and it runs on demand. Docker, Railway and a local build are documented in the repo if you want to self-host later, but npx is the right starting point.
How do I confirm it connected?
Restart Claude Code and run /mcp. The n8n server should show as connected. Then ask Claude to list a few n8n nodes - if it returns real node names and fields, the documentation layer is working. If the server is missing, it is usually a Node version problem or a typo in the package name.
Is it safe to give Claude Code my n8n API key?
Treat it like a password. The key lets the server create and run workflows on your instance, which means access to the credentials those workflows use. Never paste it into a chat, set it only as an environment variable on the MCP server, and scope it down if your n8n version supports limited keys.
What should I build first?
Start with a boring, high-value workflow rather than a flashy agent: lead reactivation, internal reporting, or daily outreach. Each one has a clear dollar value and makes a clean fixed-scope deliverable. Build it one node at a time and validate as you go.
Last reviewed by David Iya on June 8, 2026


