How I Connected Claude Code to My n8n Automations (And Why It Changed Everything)
A step-by-step journey from “I want this to work” to actually working
Here’s where it started. I typed this into Claude:
“I want to set up Claude Code to work on my n8n workflows hosted in Digital Ocean. I also have MCP working in Claude desktop with n8n. I also want to load n8n Claude Skills.”
That was it. That one prompt kicked off a several hour rabbit hole of configuration files, API keys, terminal commands, and a few “why isn’t this working” moments. But I got there. And now I have Claude talking directly to my automation platform.
If you’ve been thinking about doing something similar—or you’re just curious what this AI + automation setup actually looks like—this is the full rundown.
One important note: This is my setup. Yours might be different. Maybe you’re using a different hosting provider, or you’re on Windows instead of Mac, or your n8n is set up differently. That’s fine. The concepts are the same, but the specific commands might vary. When in doubt, tell Claude what you’re working with and ask it to help you figure out your version.
The Best Advice I Can Give You
Before I get into the technical stuff: start by telling Claude what you want.
I know a bit of code and infrastructure, but I’m not a developer. I know enough to be dangerous, but I’m not writing code from scratch. What I’ve learned is that the best way to get this stuff working is to describe what you’re trying to accomplish, then work through it step by step with Claude. This used to be Stack Overflow for me. Now, this is much better.
That first prompt I shared? Claude walked me through everything from there. When something broke, I told it what happened. When I got confused, I asked it to explain. When I needed to know what command to run next, I just asked.
You don’t need to know all this going in. You need to be willing to iterate. If a step below doesn’t work for you, paste the error message into Claude and say “this didn’t work, here’s what happened.” It’ll help you troubleshoot.
Some Terms You’ll See
Let me explain a few things before we dive in, because you’ll need to know these to get started:
n8n — An automation platform. Think of it like Zapier or Make, but you can host it yourself. I use it to build workflows that do things like post to LinkedIn automatically, send Slack notifications, or manage scheduling. The hosted version is the way to go (see Digital Ocean below).
Digital Ocean — A cloud hosting company. I rent a small server (they call it a “droplet”) for about $12-24/month. My n8n runs on that server, which means it’s always on and I control it completely.
Docker — A way to run software in isolated containers. My n8n runs inside a Docker container on my Digital Ocean server. This makes it easier to manage and update.
API — Application Programming Interface. It’s how different software talks to each other. When Claude needs to read or modify my n8n workflows, it uses n8n’s API to do that.
MCP — Model Context Protocol. This is Anthropic’s system for letting Claude connect to external tools. It’s what makes it possible for Claude to actually interact with n8n instead of just talking about it.
Claude Code — A version of Claude that runs in your terminal (the command line on your computer). It can read files, write code, run commands, and interact with tools like GitHub. It’s different from the Claude you chat with in the browser. It may seem strange at first but, trust me, you want the terminal version.
Terminal / Command Line — The text-based interface on your computer where you type commands. On Mac, it’s called Terminal. On Windows, it’s PowerShell or Command Prompt.
GitHub — A place to store and track changes to code and files. I use it to keep version history of my n8n workflows so I can see what changed and roll back if something breaks.
My Setup
Here’s what I’m working with. Yours might be different, and that’s okay:
n8n: Self-hosted on a Digital Ocean droplet ($12-24/month)
Claude: Pro subscription for the web interface, plus API credits for Claude Code
Mac: Where I do my development (I also got this working on Windows, which I’ll cover)
GitHub: For version control (I have an organization called
mightyandtrue)
The goal: Get Claude Code talking directly to my n8n instance so I can build workflows conversationally.
Part 1: Enabling the n8n API
What we’re doing: n8n has a built-in API, but it’s turned off by default. We need to turn it on so Claude can connect to it.
Why this matters: Without the API enabled, Claude has no way to see or modify your workflows. It’s like having a door that’s locked from the inside.
Step 1: Connect to your server
I need to get into my Digital Ocean server to make changes. I do this with SSH, which is a secure way to connect to a remote computer.
ssh root@your-droplet-ipReplace your-droplet-ip with your actual server’s IP address (something like 64.225.34.155).
If your setup is different: Maybe you’re using a different hosting provider, or you access your server a different way. Tell Claude what you’re using and it can help you figure out the equivalent.
Step 2: Find your n8n container
Since my n8n runs in Docker, I need to see what containers are running:
docker psThis shows a list of running containers. Look for the one that says n8n in the name.
Step 3: Stop and recreate the container
To add the API setting, I need to stop the current container and start a new one with the right configuration:
docker stop n8n
docker rm n8nDon’t panic — your workflows aren’t deleted. They’re stored in a separate folder (called a “volume”) that persists even when the container is removed. Mine is in /root/n8n-data.
Step 4: Start n8n with the API enabled
Now I recreate the container with one key addition — the environment variable that enables the API:
docker run -d \
--name n8n \
--restart unless-stopped \
-p 5678:5678 \
-v /root/n8n-data:/home/node/.n8n \
-e N8N_PUBLIC_API_ENABLED=true \
n8nio/n8nWhat this does:
docker run -d— starts a new container in the background--name n8n— names it “n8n” so we can reference it easily--restart unless-stopped— automatically restarts if it crashes-p 5678:5678— makes it accessible on port 5678 (I have since used a secure port so I dropped the :5678)-v /root/n8n-data:/home/node/.n8n— connects the data folder so your workflows persist-e N8N_PUBLIC_API_ENABLED=true— this is the key part — enables the APIn8nio/n8n— the official n8n Docker image
If your setup is different: Your data folder might be in a different location. Your port might be different. Check with Claude if you’re not sure what values to use.
Step 5: Generate an API key
Now that the API is enabled, you need a key to access it:
Open n8n in your browser (mine is at
n8n.mightyandtrue.com)Go to Settings → API
Click Create API Key
Copy it somewhere safe — you’ll need this in the next section
Part 2: Installing the n8n MCP Server
What we’re doing: Installing a small program on your computer that acts as a translator between Claude and n8n.
Why this matters: Claude doesn’t know how to talk to n8n directly. The MCP server handles that translation — Claude tells the MCP server what it wants, and the MCP server talks to n8n’s API.
Install it on your Mac (or Windows):
Open Terminal and run:
npm install -g @leonardsellem/n8n-mcp-serverWhat this does:
npmis Node Package Manager — a tool for installing JavaScript programsinstall -gmeans install it globally (available everywhere on your computer)@leonardsellem/n8n-mcp-serveris the specific package we’re installing
If you don’t have npm: You’ll need to install Node.js first. Go to nodejs.org and download the LTS version. That includes npm.
Part 3: Configuring Claude Desktop
What we’re doing: Telling Claude Desktop where to find the MCP server and how to connect to your n8n instance.
Why this matters: Claude Desktop needs a configuration file that says “here’s how to connect to n8n.” Without it, Claude doesn’t know the MCP server exists.
Find (or create) the config file:
Mac location:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows location:
%APPDATA%\Claude\claude_desktop_config.jsonHow to get there on Mac:
Open Finder
Click “Go” in the menu bar
Hold Option and click “Library” (it’s hidden by default)
Navigate to Application Support → Claude
Create or edit
claude_desktop_config.json
Add the n8n MCP server config:
Open the file in a text editor and add this:
{
"mcpServers": {
"n8n": {
"command": "npx",
"args": [
"-y",
"@leonardsellem/n8n-mcp-server"
],
"env": {
"N8N_API_URL": "http://your-n8n-domain.com:5678/api/v1",
"N8N_API_KEY": "your-api-key-here"
}
}
}
}What to change:
Replace
your-n8n-domain.comwith your actual n8n URLReplace
your-api-key-herewith the API key you generated earlier
Restart Claude Desktop
Completely quit Claude Desktop (not just close the window — actually quit the app) and reopen it. The MCP server should now be active.
How to verify it’s working: In Claude Desktop, you should see n8n listed as an available tool. Try asking Claude “Can you list my n8n workflows?” — if it works, you’re connected.
Part 4: The Windows Detour
I also wanted this working on my PC. Windows had some quirks. If you’re on Mac only, skip this section.
Problem 1: PowerShell blocks scripts by default
Windows doesn’t let you run scripts without permission. Fix it by opening PowerShell as Administrator and running:
Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSignedThis tells Windows “I’m allowed to run scripts I download, as long as they’re signed.”
Problem 2: Windows couldn’t find npx
The config file needs the full path to npx on Windows:
{
"mcpServers": {
"n8n": {
"command": "C:\\Program Files\\nodejs\\npx.cmd",
"args": [
"-y",
"@leonardsellem/n8n-mcp-server"
],
"env": {
"N8N_API_URL": "http://your-n8n-domain.com:5678/api/v1",
"N8N_API_KEY": "your-api-key-here"
}
}
}
}Notice the double backslashes (\\) — that’s how you write file paths in JSON on Windows.
Problem 3: Notepad added .txt to my filename
When saving the config file in Notepad, it kept saving as claude_desktop_config.json.txt. The fix: change “Save as type” to “All Files (.)” before saving.
Part 5: Setting Up Claude Code (Terminal)
What we’re doing: Installing Claude Code, which is a more powerful version of Claude that runs in your terminal and can actually do things — edit files, run commands, interact with GitHub.
Why this matters: Claude Desktop with MCP is useful for asking questions about your workflows. Claude Code can actually build workflows, commit them to GitHub, and manage your whole development process.
Install Claude Code:
On Mac, using Homebrew (a package manager for Mac):
brew install claude-codeIf you don’t have Homebrew: Install it first by running this in Terminal:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"Install GitHub CLI:
You’ll want this for version control:
brew install gh
gh auth loginThe second command opens a browser window where you log into GitHub. Follow the prompts.
Set up Anthropic API access:
Claude Code needs its own API key (separate from your Claude Pro subscription):
Go to console.anthropic.com
Create an account if you don’t have one
Go to API Keys and create a new key
Run
claudein your terminal and enter the key when prompted
Cost note: Claude Code charges by usage. In my experience, it’s about $5-15/month for moderate use. You can also use your Claude Pro subscription instead of API credits if you prefer.
Install the n8n skills (optional but helpful):
There’s a skill pack that gives Claude Code specific knowledge about n8n patterns and best practices:
cd ~
git clone https://github.com/czlonkowski/n8n-skills.gitPart 6: Connecting Claude Code to n8n
What we’re doing: Setting up Claude Code’s MCP connection (separate from Claude Desktop’s connection).
Why this matters: Claude Code has its own configuration. Just because Claude Desktop can talk to n8n doesn’t mean Claude Code can.
Claude Code’s MCP setup is a bit different. When you’re in Claude Code, you can configure it to connect to your n8n instance using your API key and URL.
One thing that tripped me up: Use HTTPS if your n8n instance supports it, not HTTP. I had connection issues until I switched to the secure URL.
Check with Claude along the way. If something isn’t working, describe what you’re seeing. Claude Code has good diagnostic tools and can help you troubleshoot.
Part 7: Setting Up Version Control
What we’re doing: Creating a place to store your workflow files with full history of every change.
Why this matters: Without version control, if you break a workflow, you’re stuck. With GitHub, you can see exactly what changed and roll back to a working version.
Create a repo structure:
I landed on this organization:
mightyandtrue/n8n-automations/
├── README.md
├── .gitignore
├── alex-scheduling/
│ ├── workflows/
│ │ └── 01-email-activation.json
│ ├── docs/
│ └── README.md
├── lulu-asana-bot/
│ ├── workflows/
│ └── README.md
├── linkedin-daily-posts/
│ ├── workflows/
│ └── README.md
└── launchpod/
├── workflows/
└── README.md
Each project gets its own folder with a workflows subfolder for the actual n8n JSON files.
The workflow management process:
Edit in n8n (the visual editor) or via Claude Code
Test until it works
Export the workflow JSON from n8n
Commit to GitHub with a meaningful message
Push so the changes are saved to GitHub
Claude Code handles steps 3-5 for me. I just say “export the Alex workflow and commit it” and it does the rest.
What I Can Do Now
With everything connected, here’s what a typical session looks like:
Me: “I want to work on the Alex scheduling workflow. The feature we need: when there are multiple people in an email thread, let me specify who to schedule with by saying ‘@alex schedule with John’”
Claude Code: pulls the workflow, shows me the relevant nodes, explains what needs to change, makes the edits, tests the logic, commits to GitHub
No screenshots. No copy-paste. No context-switching.
I can also:
Ask Claude Code to list all my workflows
Have it explain how a complex workflow works
Debug issues by having it look at execution logs
Export and version control everything automatically
The Costs
Here’s what this setup actually costs me:
Item Monthly Cost Digital Ocean droplet (n8n) $12-24 Claude Pro (web interface) $20 Claude Code API usage $5-15 (varies by usage) GitHub Free Total ~$40-60/month
For an automation setup that would cost 10x more with enterprise tools? That’s a good deal.
Tips for Getting Started
Start by asking Claude what you want — describe your goal, then iterate from there
Your setup will be different — these are my specific commands and paths. If something doesn’t match, tell Claude what you’re working with and ask for help.
Test incrementally — get Claude Desktop working first, then move to Claude Code
When something breaks, share the error — paste the exact error message into Claude and ask what’s wrong
Use HTTPS — if your n8n instance has SSL, use it
Version control from day one — set up GitHub before you have too many workflows to organize
Ask Claude to explain itself — when it makes changes to workflows, ask it to walk you through what it did
What’s Next
I’m setting up my son to collaborate on these automations. He’ll have his own n8n account (free—it’s my server), his own GitHub access, and his own Claude Code setup. We can work on the same workflows, push and pull changes, and build together.
That’s the real unlock here: this isn’t just about me building faster. It’s about creating a development environment where anyone on my team can contribute to our automation library.
If You Need Help With This
This is exactly the kind of work we do at Mighty & True.
We’re a marketing agency that helps tech brands and CMOs build better growth strategies—and increasingly, that means AI and automation. We find the gaps in your marketing programs, build systems that actually perform, and help mature your AI infrastructure along the way.
If you’re a mid-market tech company trying to figure out how to use AI and automation strategically (not just experimentally), that’s our sweet spot. We can help you build the programs, run optimized marketing programs and set up the systems.
Reach out if you want to talk through what you’re working on.
Quick Reference: The Complete Setup Checklist
[ ] n8n running (self-hosted or cloud)
[ ] n8n API enabled (
N8N_PUBLIC_API_ENABLED=true)[ ] n8n API key generated
[ ] Node.js installed on your machine
[ ] n8n MCP server installed (
npm install -g @leonardsellem/n8n-mcp-server)[ ] Claude Desktop config file created with n8n MCP settings
[ ] Claude Desktop restarted and MCP connection verified
[ ] GitHub CLI installed and authenticated (
brew install gh && gh auth login)[ ] Claude Code installed (
brew install claude-code)[ ] Anthropic API key created and configured
[ ] GitHub repo created for your workflows
[ ] First workflow exported and committed
Have questions? Find me on LinkedIn or leave a comment. And remember — if you get stuck, just tell Claude what’s happening. That’s how I got through all of this.



