Setting Up n8n MCP: Connect Claude to Your Workflow Engine in 5 Minutes
Step-by-step tutorial for setting up n8n MCP server with Docker or npm, connecting it to Claude Desktop, and building AI-generated workflows.
π οΈ Setting Up n8n MCP: Connect Claude to Your Workflow Engine
I'll show you how to set up n8n MCP so you can start building workflows using natural language. This guide is written for Claude Desktop (the most common use case), but the same steps work for Claude Code, Windsurf, and Cursor.
π Want to deploy n8n MCP yourself?
Docker configs, system requirements, installation guides β all on one page.
View n8n MCP Tool Page βπ Prerequisites
Before we start, make sure you have:
- An n8n instance running (self-hosted or cloud)
- An n8n API key (Settings β API β Create)
- Your n8n instance URL (e.g.,
https://your-n8n.com) - Docker (for the easiest setup)
π‘ Don't have n8n yet? Grab it on Run This Ai: it's one of our published tools with full Docker setup guides.
π³ Option A: Docker (Recommended)
Quickest setup, works everywhere:
docker run -d --name n8n-mcp-server \
-p 3000:3000 \
-e N8N_HOST=https://your-n8n.com \
-e N8N_API_KEY=your-api-key-here \
infopuls/n8n-mcp:latest
β±οΈ Time: Image is ~150MB (Node.js Alpine). Pulls in 20 seconds.
β οΈ My mistake: I used localhost as the N8N_HOST when running n8n in another container. Those containers can't see each other by default. Use Docker's internal DNS: http://n8n-container:5678
π¦ Option B: npm (Lightweight)
If you don't want Docker, it's an npm package:
npm install -g n8n-mcp
n8n-mcp --n8n-host https://your-n8n.com --n8n-api-key ***
I prefer the npm version when running locally β no Docker overhead, starts in under a second. For production servers, Docker is cleaner.
π Step 3: Connect to Claude Desktop
Add the MCP server to Claude's configuration:
# ~/.claude/settings.json or claude_desktop_config.json
{
"mcpServers": {
"n8n-mcp": {
"command": "docker",
"args": ["run", "-i", "--rm",
"-e", "N8N_HOST=https://your-n8n.com",
"-e", "N8N_API_KEY=***",
"infopuls/n8n-mcp:latest"
]
}
}
}
β οΈ Path matters: On macOS/Linux, the config file is at ~/.claude/settings.json. On Windows, it's %APPDATA%\Claude\settings.json. I wasted 10 minutes putting it in the wrong folder.
π§ͺ Step 4: Test It
Restart Claude Desktop. Look for the n8n icon in the tools panel. If it's there, you're connected. Now try:
"List all my n8n workflows and show me which ones have run in the last 24 hours."
If Claude can see and describe your workflows, everything is working. If you get an error, check the container logs: docker logs n8n-mcp-server
π Step 5: Build Your First AI-Generated Workflow
Now for the fun part. Try this prompt:
"Create a workflow that: every hour, checks a RSS feed for new articles, filters by keyword 'AI', extracts the title and URL, and posts them to a Discord channel."
Watch Claude configure RSS Feed trigger, Item Lists (filter), Set (format), and Discord nodes β all connected with proper error handling. When it's done, it'll ask you to review and activate. Click confirm and your workflow is live.
βοΈ Configuration Reference
| Variable | Required | Description |
|---|---|---|
| N8N_HOST | β | Your n8n instance URL |
| N8N_API_KEY | β | n8n API authentication token |
| N8N_PORT | β | Custom port (default: 3000) |
π Performance
n8n MCP is lightweight. The npm package adds ~50MB to your system. Docker image is ~150MB. RAM usage is ~60MB at idle, ~120MB during workflow building. Response times are instant for list/read operations, and workflow creation takes 2-5 seconds depending on complexity.
π― Final Thoughts
n8n MCP is one of those rare tools that makes you go "why didn't this exist before?" The combination of an MCP-savvy AI agent + n8n's workflow engine is genuinely powerful. If you already use n8n (or have been meaning to try it), this integration will change how you build automations.
π Explore n8n MCP on Run This Ai
Docker Compose configs, system requirements, installation guides, and more β all in one place.
View n8n MCP Tool Page β