Shravan1610/n8n-mcp-server
If you are the rightful owner of n8n-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.
The n8n MCP Server allows users to control their n8n workflows using Claude AI through natural language conversation, leveraging the Model Context Protocol (MCP) for seamless integration.
🤖 n8n MCP Server - Control n8n with Claude AI
Give Claude AI full control over your n8n workflows through natural conversation
🎯 What This Does (In Plain English)
Instead of clicking through n8n's web interface, you can now talk to Claude and have it manage your workflows:
You say: "Show me all my workflows" Claude does: Lists all your n8n workflows with their status
You say: "Activate my Daily Report workflow" Claude does: Turns on that workflow for you
You say: "What workflows failed today?" Claude does: Shows you failed executions with error details
It's like having an AI assistant that knows how to use n8n for you.
✨ What You'll Be Able To Do
Once set up, you can ask Claude to:
📋 Workflow Management
- ✅ List all your workflows
- ✅ Create new workflows
- ✅ Activate/deactivate workflows
- ✅ Update workflow settings
- ✅ Delete workflows
- ✅ Organize workflows with tags
⚡ Execution Monitoring
- ✅ See which workflows ran successfully
- ✅ Find failed executions
- ✅ Retry failed workflows
- ✅ Get detailed error information
- ✅ Track execution history
🔧 Advanced Features
- ✅ Manage environment variables
- ✅ Handle credentials securely
- ✅ Manage users and projects
- ✅ Generate security audits
- ✅ Health check your n8n instance
Total: 42 different operations - all through natural conversation with Claude.
🤔 Before You Start: What Are These Things?
What is MCP (Model Context Protocol)?
Think of it as a "universal connector" that lets Claude AI talk to other software. It's like teaching Claude how to use n8n by giving it a specialized plugin.
Official docs: https://modelcontextprotocol.io/
What is n8n?
n8n is a workflow automation tool (like Zapier, but self-hosted). It connects different apps and automates tasks. For example: "When I get an email, save it to Google Sheets and notify me on Slack."
n8n website: https://n8n.io/
What is Docker?
Docker packages software so it runs the same way on any computer. Think of it as a "container" for software - it includes everything needed to run, so you don't have to install dependencies manually.
Docker website: https://www.docker.com/
📋 Prerequisites (What You Need First)
Before starting, make sure you have:
1. Docker Desktop (Required)
- Download: https://www.docker.com/products/docker-desktop
- Install it and make sure it's running (you'll see the Docker icon in your system tray)
- Test it works: Open terminal/command prompt and type:
You should see something like:
docker --versionDocker version 24.0.0
2. n8n Instance with API Access (Required)
You need:
- ✅ A running n8n instance (self-hosted or cloud)
- ✅ The URL to your n8n (e.g.,
https://your-n8n.com) - ✅ An API key from n8n
How to get your n8n API key:
- Log into your n8n instance
- Click your profile icon (top right)
- Go to "Settings" → "API"
- Click "Create API Key"
- Copy the key (starts with
eyJ...) - you'll need this later
3. Claude Desktop (Required)
- Download: https://claude.ai/download
- Install the desktop app (not just the web version)
4. Docker MCP Gateway (Required)
This is the "bridge" between Claude and Docker containers.
Install it:
# On macOS/Linux
curl -fsSL https://raw.githubusercontent.com/docker/mcp-gateway/main/install.sh | sh
# On Windows (PowerShell as Administrator)
irm https://raw.githubusercontent.com/docker/mcp-gateway/main/install.ps1 | iex
Verify it installed:
docker mcp --version
Official docs: https://github.com/docker/mcp-gateway
5. Basic Terminal Knowledge (Helpful but not required)
You'll need to copy-paste commands into a terminal. Don't worry - we'll guide you through each one.
🚀 Installation Guide (Step-by-Step)
Follow these steps exactly in order. Each step has a "✅ Success Check" so you know it worked.
Step 0: Enable Docker MCP Toolkit (IMPORTANT!)
Before anything else, you need to enable MCP support in Docker Desktop:
- Open Docker Desktop
- Click the Settings icon (gear icon, top right)
- Go to Beta features (in the left sidebar)
- Find "Enable Docker MCP Toolkit"
- Check the box to enable it
- Click "Apply & Restart"
- Wait for Docker Desktop to restart
✅ Success Check: After restart, open terminal and run:
docker mcp --version
You should see version information (not an error).
Step 1: Download This Project
Option A: Using Git (if you have it)
cd ~/Desktop
git clone https://github.com/Shravan1610/n8n-mcp-server.git
cd n8n-mcp-server
Option B: Download ZIP
- Go to https://github.com/Shravan1610/n8n-mcp-server
- Click the green "Code" button
- Click "Download ZIP"
- Unzip it to your Desktop
- Open terminal and navigate to it:
cd ~/Desktop/n8n-mcp-server-main
✅ Success Check: Run ls - you should see files like README.md, package.json, Dockerfile
Step 2: Configure Your n8n Connection
Create your environment file:
cp .env.example .env
Edit the .env file:
-
On Mac/Linux:
nano .env -
On Windows:
notepad .env -
Fill in your n8n details:
N8N_API_KEY=paste_your_actual_n8n_api_key_here N8N_BASE_URL=https://your-n8n-instance.com/api/v1Important notes:
- Replace
paste_your_actual_n8n_api_key_herewith the API key you got from n8n - Replace
https://your-n8n-instance.comwith your actual n8n URL - DO NOT add a trailing slash at the end of the URL
- Keep
/api/v1at the end
- Replace
-
Save the file:
- In nano: Press
Ctrl+O, thenEnter, thenCtrl+X - In notepad: File → Save
- In nano: Press
Example .env file (with YOUR actual values):
N8N_API_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.your_actual_key_here
N8N_BASE_URL=https://your-actual-n8n-url.com/api/v1
✅ Success Check: Run cat .env (Mac/Linux) or type .env (Windows) - you should see your API key and URL (not the placeholder text)
Step 3: Build the Docker Container
This packages everything needed to run the MCP server.
Run the build script:
On Mac/Linux:
chmod +x build.sh
./build.sh
On Windows:
docker build -t n8n-mcp-server:latest .
This will take 2-3 minutes. You'll see lots of output - that's normal.
✅ Success Check: Run docker images | grep n8n-mcp-server - you should see the image listed with "latest" tag
Step 4: Test the Server (Optional but Recommended)
Let's make sure it can connect to your n8n instance.
Run the test:
On Mac/Linux:
chmod +x test.sh
./test.sh
On Windows:
docker run --rm -i --env-file .env n8n-mcp-server:latest
Then paste this and press Enter:
{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"test","version":"1.0.0"}}}
Press Ctrl+C to exit.
✅ Success Check: You should see a JSON response (not an error). If you see "Unexpected token" or connection errors, check your .env file.
Step 5: Set Up Docker MCP Gateway
Now we tell Docker MCP Gateway about our n8n server.
Initialize the gateway (first time only):
docker mcp catalog init
Add the n8n server configuration:
-
Edit the Docker MCP config file:
On Mac/Linux:
nano ~/.docker/mcp/docker-mcp.yamlOn Windows:
notepad %USERPROFILE%\.docker\mcp\docker-mcp.yaml -
Add this configuration at the end:
n8n-server: image: n8n-mcp-server:latest environment: N8N_API_KEY: paste_your_actual_n8n_api_key_here N8N_BASE_URL: https://your-n8n-instance.com/api/v1 description: "n8n workflow automation MCP server" -
Replace the placeholder values:
- Use the same API key from your
.envfile - Use the same n8n URL from your
.envfile
- Use the same API key from your
-
Save the file
Enable the server:
docker mcp server enable n8n-server
✅ Success Check: Run docker mcp server list - you should see n8n-server with status "enabled"
Step 6: Connect to Claude Desktop
Option A: Automatic (Docker MCP Gateway handles it)
The Docker MCP Gateway should automatically configure Claude Desktop. Just completely quit and restart Claude Desktop.
Option B: Manual Configuration (if automatic doesn't work)
-
Find your Claude Desktop config file:
- Mac:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
- Mac:
-
Edit the file:
On Mac:
nano ~/Library/Application\ Support/Claude/claude_desktop_config.jsonOn Windows:
notepad %APPDATA%\Claude\claude_desktop_config.json -
Add or update the configuration:
{ "mcpServers": { "docker-mcp-gateway": { "command": "docker", "args": ["run", "-i", "--rm", "docker-mcp-gateway"] } } } -
Save the file
Restart Claude Desktop:
- Don't just close the window - fully quit the app:
- Mac: Claude Desktop → Quit Claude Desktop (or Cmd+Q)
- Windows: Right-click the system tray icon → Exit
- Start Claude Desktop again
✅ Success Check: Open Claude Desktop and start a new conversation. Type "What n8n tools do you have?" - Claude should list the 42 available tools. If not, see troubleshooting below.
🎉 You're Done! Now What?
Try asking Claude these things:
Basic Commands
"List all my n8n workflows"
"Show me the details of workflow [name]"
"What's the health status of my n8n instance?"
Workflow Management
"Activate my [workflow name] workflow"
"Deactivate the [workflow name] workflow"
"Show me all inactive workflows"
Execution Monitoring
"Show me all failed executions from today"
"What went wrong with execution [id]?"
"Retry execution [id]"
Advanced Operations
"List all environment variables"
"Create a variable named API_URL with value https://api.example.com"
"Show me all users in my n8n instance"
🆘 Troubleshooting (Common Issues)
Issue 1: "Docker MCP command not found"
Symptoms: docker mcp: command not found
Solution:
-
Make sure Docker MCP Toolkit is enabled:
- Open Docker Desktop
- Settings → Beta Features → Enable Docker MCP Toolkit
- Apply & Restart
-
Reinstall Docker MCP Gateway:
curl -fsSL https://raw.githubusercontent.com/docker/mcp-gateway/main/install.sh | sh
Issue 2: "Tools not showing in Claude"
Symptoms: Claude says it doesn't have n8n tools available
Solutions:
-
Verify Docker MCP Gateway is running:
docker mcp server listMake sure
n8n-servershows as "enabled" -
Enable the server if it's disabled:
docker mcp server enable n8n-server -
Completely restart Claude Desktop:
- Quit (don't just close)
- Wait 5 seconds
- Start again
-
Check Docker is running:
- Look for Docker icon in system tray
- Should show "Docker Desktop is running"
Issue 3: "Cannot connect to n8n" or "401 Unauthorized"
Symptoms: Claude says it can't reach your n8n instance or authentication fails
Solutions:
-
Verify your API key works:
curl -H "X-N8N-API-KEY: your_api_key" "https://your-n8n.com/api/v1/workflows?limit=1"Replace with your actual values. You should get JSON response, not an error.
-
Check your
.envfile:cat .envMake sure:
- API key is correct (starts with
eyJ) - URL has no trailing slash
- URL ends with
/api/v1
- API key is correct (starts with
-
Check the Docker MCP config:
cat ~/.docker/mcp/docker-mcp.yamlMake sure the values match your
.envfile -
Rebuild the server:
./build.sh docker mcp server disable n8n-server docker mcp server enable n8n-server
Issue 4: "Unexpected non-whitespace character" Error
Symptoms: JSON parsing errors when testing
This should be fixed in this version. If you still see it:
-
Make sure you're using the latest code:
git pull origin main ./build.sh -
Verify the image was rebuilt:
docker images | grep n8n-mcp-serverCheck the "CREATED" date - should be recent
Issue 5: "Permission Denied" Errors
On Mac/Linux:
chmod +x build.sh test.sh
./build.sh
On Windows: Run PowerShell as Administrator
🤔 Common Mistakes (Learn from Others!)
❌ Mistake 1: Forgetting to Enable Docker MCP Toolkit
The #1 issue! You MUST enable this in Docker Desktop Settings → Beta Features before anything will work.
❌ Mistake 2: Adding Trailing Slash to URL
Wrong:
N8N_BASE_URL=https://n8n.example.com/api/v1/
Correct:
N8N_BASE_URL=https://n8n.example.com/api/v1
❌ Mistake 3: Forgetting to Quit Claude Desktop
Closing the window isn't enough - you must fully quit the app for config changes to take effect.
❌ Mistake 4: Using Wrong API Key
Make sure you're using an n8n API key, not your login password. Get it from: n8n Settings → API → Create API Key
❌ Mistake 5: Docker Not Running
The Docker icon must be in your system tray and show "running" status. If Docker isn't running, nothing will work.
❌ Mistake 6: Not Enabling the Server
After editing docker-mcp.yaml, you must run:
docker mcp server enable n8n-server
🎓 How It Works (For the Curious)
Here's what happens behind the scenes:
- You talk to Claude in natural language
- Claude understands what you want to do with n8n
- Claude calls the Docker MCP Gateway
- The Gateway launches your n8n MCP server container
- The MCP server makes API calls to your n8n instance
- n8n responds with the data
- The response flows back through Gateway → Claude → You
It's like having a translator that speaks "Human" on one side and "n8n API" on the other.
📚 Available Tools (All 42 of Them)
Click to expand the complete list
Workflow Management (10 tools)
n8n_list_workflows- List all workflows with paginationn8n_get_workflow- Get detailed workflow informationn8n_create_workflow- Create new workflowsn8n_update_workflow- Modify existing workflowsn8n_delete_workflow- Delete workflowsn8n_activate_workflow- Enable workflowsn8n_deactivate_workflow- Disable workflowsn8n_transfer_workflow- Transfer workflows between projectsn8n_get_workflow_tags- Get workflow tagsn8n_update_workflow_tags- Update workflow tags
Execution Management (4 tools)
n8n_list_executions- List executions with filteringn8n_get_execution- Get detailed execution informationn8n_delete_execution- Delete execution recordsn8n_retry_execution- Retry failed executions
Credentials Management (4 tools)
n8n_create_credential- Create new credentialsn8n_delete_credential- Delete credentialsn8n_get_credential_schema- Get credential schemasn8n_transfer_credential- Transfer credentials
Variables Management (4 tools)
n8n_list_variables- List environment variablesn8n_create_variable- Create new variablesn8n_update_variable- Update existing variablesn8n_delete_variable- Delete variables
Tags Management (5 tools)
n8n_list_tags- List all tagsn8n_create_tag- Create new tagsn8n_get_tag- Get tag detailsn8n_update_tag- Update tag namesn8n_delete_tag- Delete tags
Users Management (5 tools)
n8n_list_users- List all usersn8n_create_user- Create new usersn8n_get_user- Get user detailsn8n_delete_user- Delete usersn8n_update_user_role- Update user roles
Projects Management (7 tools)
n8n_list_projects- List all projectsn8n_create_project- Create new projectsn8n_update_project- Update project detailsn8n_delete_project- Delete projectsn8n_add_user_to_project- Add users to projectsn8n_remove_user_from_project- Remove usersn8n_update_user_in_project- Update user roles
Audit & Monitoring (3 tools)
n8n_generate_audit- Generate security auditsn8n_pull_source_control- Pull from source controln8n_health_check- Check instance health
🔒 Security & Privacy
What data does this share?
- Only the data you ask Claude to fetch from n8n
- Your n8n API key stays on your computer (in
.envfile) - No data is sent to third parties
Best practices:
- ✅ Never commit
.envfile to Git (it's in.gitignore) - ✅ Use read-only API keys if possible
- ✅ Rotate your API keys periodically
- ✅ Don't share your
.envfile with anyone
Docker security:
- ✅ Runs as non-root user
- ✅ No privileged access required
- ✅ Isolated container environment
💡 Pro Tips
Tip 1: Create Shortcuts
Save common commands as Claude conversations for quick access.
Tip 2: Combine Operations
You can ask Claude to do multiple things at once: "Show me all failed workflows from today, then retry each one"
Tip 3: Use Descriptive Workflow Names
Claude works better when your workflows have clear names like "Daily Email Report" instead of "Workflow 1"
Tip 4: Ask for Explanations
Claude can explain what workflows do: "Explain what my 'Customer Onboarding' workflow does"
Tip 5: Monitor in Real-Time
Ask Claude to check execution status while workflows are running
🚀 Next Steps
Now that you have it working:
- ⭐ Star this repo if it helped you!
- 🔁 Share with other n8n users
- 💬 Give feedback - what features do you want added?
- 🐛 Report bugs via GitHub Issues
- 🤝 Contribute - PRs welcome!
📞 Need Help?
- GitHub Issues: https://github.com/Shravan1610/n8n-mcp-server/issues
- n8n API Docs: https://docs.n8n.io/api/
- MCP Documentation: https://modelcontextprotocol.io/
- Docker MCP Gateway: https://github.com/docker/mcp-gateway
🙏 Acknowledgments
Built with:
🎯 About This Project
This is Day 1 of my 30-day challenge to build useful AI integrations.
Built in one session. Open sourced for the community.
More projects coming! Follow for daily updates.
⭐ If this saved you time, drop a star on GitHub!
Built with Model Context Protocol | 42 Tools | Production Ready