n8n MCP Server
A complete Model Context Protocol server that enables Claude to create, manage, and execute n8n workflows through conversational AI.
README
<div align="center">
π€ n8n MCP Server
AI-Powered Workflow Automation for Claude
Transform natural language into powerful n8n workflows β A complete Model Context Protocol (MCP) server that enables Claude to create, manage, and execute n8n workflows through conversational AI.
Features β’ Quick Start β’ Installation β’ Documentation β’ Examples
</div>
π Table of Contents
- Overview
- Features
- Prerequisites
- Quick Start
- Installation
- Configuration
- Available Tools
- Usage Examples
- Architecture
- Development
- Troubleshooting
- Security
- Contributing
- License
π― Overview
n8n MCP Server is a production-ready Model Context Protocol server that bridges Claude AI with n8n workflow automation. It enables natural language workflow creation, intelligent template search, and complete workflow lifecycle management.
What is MCP?
The Model Context Protocol (MCP) is an open standard by Anthropic that enables AI assistants to securely interact with external tools and data sources.
Why This Project?
- π¨ Natural Language Workflows: Create complex automations by simply describing what you want
- π Smart Discovery: Search through 541 n8n nodes and 2700+ templates instantly
- β‘ Production Ready: Type-safe, tested, and containerized for easy deployment
- π§ AI-Powered: Automatically matches your requirements with the best nodes and templates
- π³ Docker Native: One-command deployment with full isolation
β¨ Features
π Core Capabilities
| Feature | Description |
|---|---|
| AI Workflow Creation | Describe workflows in plain English β Claude builds them automatically |
| Template Library | Instant access to 2700+ pre-built workflow templates |
| Node Explorer | Search and discover all 541 n8n nodes with full documentation |
| Full CRUD Operations | Create, read, update, delete workflows programmatically |
| Workflow Execution | Trigger and monitor workflow runs directly from Claude |
| Full-Text Search | SQLite FTS5-powered instant search across nodes and templates |
π οΈ Technical Features
- β TypeScript β Fully typed for reliability and maintainability
- β SQLite + FTS5 β Fast full-text search with minimal setup
- β Docker Support β Multi-stage builds with health checks
- β Zod Validation β Runtime input/output validation
- β Error Handling β Comprehensive error messages and recovery
- β Secure by Default β Non-root container, environment-based secrets
π Prerequisites
Before you begin, ensure you have:
-
n8n Instance (v1.0+)
- Self-hosted or n8n.cloud account
- API access enabled
- API key generated (How to get API key)
-
One of the following:
- Docker (recommended) β For containerized deployment
- Node.js 18+ β For local development
-
Claude Desktop β To use the MCP server
π Quick Start
Option 1: Docker (Recommended)
The fastest way to get started:
# 1. Clone the repository
git clone https://github.com/aurelienfagioli/n8n-mcp-aurelien.git
cd n8n-mcp-aurelien
# 2. Configure your n8n credentials
cp .env.example .env
nano .env # Edit with your n8n URL and API key
# 3. Initialize database
npm install
npm run db:init
# 4. Build Docker image
npm run docker:build
# 5. Configure Claude Desktop
# See Configuration section below
Option 2: One-Line Docker Run
If you already have the image built:
docker run -i --rm \
-e N8N_API_URL="https://your-n8n.hostinger.com" \
-e N8N_API_KEY="your_api_key_here" \
-v n8n-mcp-data:/app/data \
n8n-mcp-aurelien:latest
π¦ Installation
Choose your preferred installation method:
Option 1: Docker (Recommended)
Step 1: Clone and Configure
git clone https://github.com/aurelienfagioli/n8n-mcp-aurelien.git
cd n8n-mcp-aurelien
cp .env.example .env
Step 2: Edit .env file
N8N_API_URL=https://your-n8n-instance.com
N8N_API_KEY=n8n_api_xxxxxxxxxxxxxxxxxxxxx
DATABASE_PATH=/app/data/nodes.db
LOG_LEVEL=info
MCP_MODE=stdio
Step 3: Initialize Database
npm install
npm run db:init
Step 4: Build Image
docker build -t n8n-mcp-aurelien:latest -f docker/Dockerfile .
# or
npm run docker:build
Step 5: Test the Server
docker run -i --rm \
-e N8N_API_URL="$N8N_API_URL" \
-e N8N_API_KEY="$N8N_API_KEY" \
-v n8n-mcp-data:/app/data \
n8n-mcp-aurelien:latest
Option 2: Node.js (Local Installation)
Step 1: Clone and Install
git clone https://github.com/aurelienfagioli/n8n-mcp-aurelien.git
cd n8n-mcp-aurelien
npm install
Step 2: Configure
cp .env.example .env
nano .env # Edit with your credentials
Step 3: Build and Initialize
npm run build
npm run db:init
Step 4: Run
npm start
Option 3: Pull from GitHub Container Registry (Recommended)
π¦ Available Now: Pull the pre-built image directly from GHCR:
# Pull the latest image from GitHub Container Registry
docker pull ghcr.io/aurelienfagioli/n8n-mcp-aurelien:latest
# Run immediately
docker run -i --rm \
-e N8N_API_URL="https://your-n8n.com" \
-e N8N_API_KEY="your_key" \
-v n8n-mcp-data:/app/data \
ghcr.io/aurelienfagioli/n8n-mcp-aurelien:latest
β οΈ Important: The
-v n8n-mcp-data:/app/datavolume mount is required for the database!See DEPLOYMENT.md for more deployment options.
βοΈ Configuration
Configure Claude Desktop
Add the MCP server to Claude Desktop's configuration file:
File Locations:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json - Linux:
~/.config/Claude/claude_desktop_config.json
For Docker Deployment:
{
"mcpServers": {
"n8n": {
"command": "docker",
"args": [
"run", "-i", "--rm",
"-e", "N8N_API_URL=https://your-n8n-instance.com",
"-e", "N8N_API_KEY=your_api_key_here",
"-v", "n8n-mcp-data:/app/data",
"ghcr.io/aurelienfagioli/n8n-mcp-aurelien:latest"
]
}
}
}
For Local Node.js Installation:
{
"mcpServers": {
"n8n": {
"command": "node",
"args": [
"/absolute/path/to/n8n-mcp-aurelien/dist/index.js"
],
"env": {
"N8N_API_URL": "https://your-n8n-instance.com",
"N8N_API_KEY": "your_api_key_here",
"DATABASE_PATH": "/absolute/path/to/n8n-mcp-aurelien/data/nodes.db"
}
}
}
}
β οΈ Important: Replace your-n8n-instance.com and your_api_key_here with your actual credentials!
Restart Claude Desktop after saving the configuration.
π οΈ Available Tools
Once configured, Claude can use these 12 powerful tools:
π Workflow Management
| Tool | Description | Example |
|---|---|---|
create-workflow |
Create workflows from natural language | "Create a workflow that backs up my database daily" |
list-workflows |
List all workflows with filters | "Show me all active workflows" |
get-workflow |
Get detailed workflow information | "Show workflow details for ID abc123" |
update-workflow |
Modify existing workflows | "Change the schedule to run at 10am" |
delete-workflow |
Delete workflows (requires confirmation) | "Delete workflow abc123" |
execute-workflow |
Trigger workflow execution | "Run the 'Daily Backup' workflow now" |
π Node Explorer
| Tool | Description | Example |
|---|---|---|
search-nodes |
Search through 541 n8n nodes | "What nodes integrate with Notion?" |
get-node-documentation |
Get detailed node documentation | "Show me Gmail node documentation" |
list-node-categories |
List all available categories | "What categories of nodes exist?" |
π¦ Template Library
| Tool | Description | Example |
|---|---|---|
search-templates |
Search 2700+ workflow templates | "Find Slack automation templates" |
get-template |
Retrieve full template JSON | "Get template #42 details" |
get-database-stats |
Database statistics | "How many nodes are available?" |
π‘ Usage Examples
Example 1: Create an Email Reminder Workflow
You:
"Create a workflow that sends me an email every Monday at 9am reminding me to review weekly reports"
Claude (using MCP):
- β
Calls
create-workflowwith your description - π Searches database for schedule and email nodes
- π Finds relevant template or creates from scratch
- π Creates workflow in your n8n instance
- β¨ Returns: "Workflow created! ID: abc123, URL: https://your-n8n.com/workflow/abc123"
Example 2: Discover Integration Options
You:
"What nodes can I use to work with Google Sheets?"
Claude:
- π Calls
search-nodeswith query "google sheets" - π Returns available nodes: Google Sheets, Google Sheets Trigger, etc.
- π Shows capabilities and operations for each node
Example 3: Use a Pre-Built Template
You:
"Find me a template for syncing data between Notion and Airtable"
Claude:
- π¦ Calls
search-templateswith your query - π Shows top matching templates
- π¨ You can then ask: "Create a workflow from template #5"
- β Claude creates the workflow using that template
Example 4: Manage Existing Workflows
You:
"Show me all my workflows that are currently inactive"
Claude:
- π Calls
list-workflowswith filteractive: false - π Displays list of inactive workflows
- π‘ You can then activate or modify them
ποΈ Architecture
System Overview
βββββββββββββββ ββββββββββββββββ βββββββββββββββ
β Claude β ββMCPββΊ β n8n MCP β ββAPIββΊ β n8n β
β Desktop β β Server β β Instance β
βββββββββββββββ ββββββββββββββββ βββββββββββββββ
β
βΌ
βββββββββββββββ
β SQLite DB β
β (FTS5) β
βββββββββββββββ
Nodes + Templates
Project Structure
n8n-mcp-aurelien/
βββ π README.md # You are here
βββ π INSTALL.md # Installation guide
βββ π QUICKSTART.md # Quick start guide
βββ π CONTRIBUTING.md # Contribution guidelines
βββ π DEPLOYMENT.md # Docker Hub deployment
βββ π CHANGELOG.md # Version history
βββ π LICENSE # MIT License
β
βββ π¦ package.json # Dependencies & scripts
βββ π§ tsconfig.json # TypeScript config
βββ π .env.example # Environment template
βββ π« .gitignore # Git ignore rules
β
βββ π src/ # Source code
β βββ index.ts # Entry point
β βββ server.ts # MCP server setup
β β
β βββ π types/ # TypeScript interfaces
β β βββ index.ts # All type definitions
β β
β βββ π database/ # SQLite database
β β βββ db.ts # Database client
β β βββ schema.sql # DB schema with FTS5
β β
β βββ π n8n-api/ # n8n REST API client
β β βββ client.ts # Axios-based API wrapper
β β
β βββ π tools/ # MCP tool implementations
β βββ workflow-creator.ts # AI workflow creation
β βββ workflow-manager.ts # CRUD operations
β βββ node-explorer.ts # Node search & docs
β βββ template-search.ts # Template discovery
β
βββ π scripts/ # Utility scripts
β βββ init-db.ts # Database initialization
β βββ fetch-nodes.ts # Scrape n8n nodes
β βββ fetch-templates.ts # Scrape templates
β
βββ π docker/ # Docker configuration
β βββ Dockerfile # Multi-stage build
β βββ docker-compose.yml # Compose setup
β βββ healthcheck.sh # Container health check
β
βββ π data/ # Database storage
β βββ nodes.db # SQLite database
β βββ nodes-sample.json # Sample data
β
βββ π dist/ # Compiled JavaScript
βββ (auto-generated)
Technology Stack
| Layer | Technology | Purpose |
|---|---|---|
| Protocol | MCP SDK (@modelcontextprotocol/sdk) | Communication with Claude |
| Runtime | Node.js 18+ | JavaScript execution |
| Language | TypeScript | Type safety & DX |
| Database | SQLite + FTS5 | Fast full-text search |
| HTTP Client | Axios | n8n API communication |
| Validation | Zod | Input/output schemas |
| Container | Docker (Alpine Linux) | Isolation & deployment |
π§ Development
Development Mode
Run with auto-reload on file changes:
npm run dev
This uses tsx to watch TypeScript files and restart automatically.
Build
Compile TypeScript to JavaScript:
npm run build
Output goes to dist/ directory.
Database Management
Initialize/Reset Database:
# Warning: This deletes existing data!
rm -f data/nodes.db
npm run db:init
Fetch Real Node Data:
npm run fetch:nodes # Scrape n8n documentation for nodes
npm run fetch:templates # Scrape workflow templates
npm run db:seed # Fetch + initialize in one command
Testing
# Test database operations
node -e "
const { N8nDatabase } = require('./dist/database/db.js');
const db = new N8nDatabase('./data/nodes.db');
console.log(db.getStats());
"
# Test n8n API connection
curl -H "X-N8N-API-KEY: your_key" \
https://your-n8n.com/api/v1/workflows
π Troubleshooting
Common Issues
β "Failed to connect to n8n API"
Symptoms: MCP server can't reach n8n instance
Solutions:
- Verify
N8N_API_URLis correct and accessible - Check API key is valid: Settings β API β API Keys
- Test connection manually:
curl -H "X-N8N-API-KEY: your_key" \ https://your-n8n.com/api/v1/workflows - Ensure n8n API is enabled in settings
β "Database file not found"
Symptoms: ENOENT: no such file or directory
Solution:
npm run db:init
β "Claude Desktop doesn't see the server"
Symptoms: MCP tools not appearing in Claude
Solutions:
- Check config file path is correct for your OS
- Verify JSON syntax is valid (use JSONLint)
- Use absolute paths (not
~or./) - Completely quit Claude Desktop (not just close window)
- Check logs: Claude Desktop β Settings β Developer
β "Docker container exits immediately"
Symptoms: Container starts and stops
Solutions:
# Check logs
docker logs n8n-mcp-aurelien
# Verify environment variables
docker inspect n8n-mcp-aurelien
# Ensure database exists in volume
docker volume inspect n8n-mcp-data
β "Permission denied" on Docker
Symptoms: Can't run docker commands
Solutions:
# Linux/macOS: Add user to docker group
sudo usermod -aG docker $USER
# Log out and back in
# Or run with sudo (not recommended)
sudo docker run ...
Debug Mode
Enable verbose logging:
# In .env file
LOG_LEVEL=debug
# Or via environment variable
LOG_LEVEL=debug npm start
Getting Help
- π Check INSTALL.md for installation issues
- π Review QUICKSTART.md for setup guide
- π Open an issue on GitHub
- π Consult MCP Documentation
- π Review n8n API Docs
π Security
Best Practices
- β
Never commit
.envfiles or API keys to Git - β Use environment variables for all secrets
- β Run containers as non-root user (already configured)
- β
Regularly update dependencies:
npm audit fix - β Use HTTPS for n8n API endpoints
- β Rotate API keys periodically
Docker Security
The Dockerfile includes security best practices:
# Non-root user
RUN adduser -S n8nmcp && chown -R n8nmcp /app
USER n8nmcp
# Minimal base image
FROM node:20-alpine
# No unnecessary privileges
# Read-only filesystem where possible
Data Privacy
- π API keys stored in environment variables only
- π SQLite database contains only public n8n node/template data
- π No workflow data or user credentials stored locally
- π All API calls use secure HTTPS connections
π€ Contributing
We welcome contributions! See CONTRIBUTING.md for guidelines.
Quick Contribution Guide
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Commit your changes:
git commit -m 'feat: add amazing feature' - Push to the branch:
git push origin feature/amazing-feature - Open a Pull Request
Development Workflow
# Clone your fork
git clone https://github.com/aurelienfagioli/n8n-mcp-aurelien.git
cd n8n-mcp-aurelien
# Install dependencies
npm install
# Create feature branch
git checkout -b feature/my-feature
# Make changes, then test
npm run build
npm run dev
# Commit with conventional commits
git commit -m "feat: add new feature"
# Push and create PR
git push origin feature/my-feature
π License
This project is licensed under the MIT License - see the LICENSE file for details.
MIT License
Copyright (c) 2025 AurΓ©lien Fagioli
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software...
π Acknowledgments
This project wouldn't exist without:
- n8n β The amazing workflow automation platform
- Anthropic β For Claude and the Model Context Protocol
- czlonkowski/n8n-mcp β Inspiration and reference implementation
- The MCP Community β For building an incredible ecosystem
π Project Stats
- 541 n8n nodes with full documentation
- 2700+ workflow templates ready to use
- 12 MCP tools for complete automation
- 100% TypeScript for type safety
- 0 dependencies on proprietary services
πΊοΈ Roadmap
- [ ] π¦ Publish to Docker Hub for one-command installation
- [ ] π Add advanced template filtering (by popularity, rating, etc.)
- [ ] π¨ Web UI for browsing nodes and templates
- [ ] π Analytics dashboard for workflow usage
- [ ] π Auto-sync with n8n.io template library
- [ ] π§ͺ Comprehensive test suite with Vitest
- [ ] π Video tutorials and documentation
- [ ] π Multi-language support
π Contact & Support
- Author: AurΓ©lien Fagioli
- GitHub: @aurelienfagioli
- Issues: Report a bug
- Discussions: Ask questions
<div align="center">
β Star this repo if you find it useful!
Built with β€οΈ and β by AurΓ©lien Fagioli
π€ Powered by Claude Code β’ π§ n8n β’ π³ Docker
</div>
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.