eekfonky/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 henry@mcphub.com.
The n8n MCP Server is a robust Model Context Protocol server that integrates AI models with n8n workflow automation, offering both ephemeral and persistent deployment options.
n8n MCP Server
A production-ready Model Context Protocol (MCP) server that provides AI models with comprehensive access to n8n workflow automation capabilities. Built with enterprise-grade TypeScript and designed for both ephemeral Docker deployment and persistent service modes.
๐ Features
- 15 Powerful Primitive Tools: Complete workflow automation through optimized building blocks
- Enterprise-Grade Architecture: 95/100 production readiness score with comprehensive error handling
- Advanced Workflow Management: Create, execute, monitor, debug, and optimize n8n workflows
- Intelligent Node Discovery: Automatically discover and interact with 500+ community nodes
- Real-time Monitoring: Track executions, performance metrics, and system health
- Batch Operations: Concurrent processing with proper memory management and concurrency control
- Template System: Create, apply, and manage workflow templates with variable substitution
- Data Export: Export workflows, executions, and reports in multiple formats (JSON, CSV, XML, YAML)
- Security First: Input validation, credential protection, and data sanitization
- Performance Optimized: Memory management, efficient cloning, and array optimization
๐ Prerequisites
- Docker Desktop with MCP Toolkit
- n8n instance with API access enabled
- n8n API Key with appropriate permissions
๐ ๏ธ Installation & Setup
Method 1: Docker MCP Toolkit (Recommended) โญ
The easiest way to install using Docker Desktop's built-in MCP Toolkit:
# One-command setup
curl -sSL https://raw.githubusercontent.com/eekfonky/n8n-mcp-server/main/scripts/setup-docker-mcp.sh | bash
Or clone and run locally:
git clone https://github.com/eekfonky/n8n-mcp-server.git
cd n8n-mcp-server
./scripts/setup-docker-mcp.sh
This will:
- Enable Docker MCP features
- Create the n8n MCP catalog
- Add n8n server to the catalog
- Configure your n8n connection
- Test the integration
Daily Usage:
# Start the MCP gateway
docker mcp gateway run
# Test n8n tools
docker mcp tools list | grep n8n_
docker mcp tools call n8n_discover type=health
Method 2: Manual Docker MCP Setup
# Create catalog and add n8n server
docker mcp catalog create n8n-mcp-catalog
docker mcp catalog add n8n-mcp-catalog n8n-server https://raw.githubusercontent.com/eekfonky/n8n-mcp-server/main/catalog/server-definition.yaml
# Configure secrets
docker mcp secret set n8n-server.base_url "https://your-n8n-instance.com"
docker mcp secret set n8n-server.api_key "your-api-key"
# Enable dynamic tools feature and run
docker mcp feature enable dynamic-tools
docker mcp gateway run
Method 3: Local Development
For local development and testing:
# Clone the repository
git clone https://github.com/eekfonky/n8n-mcp-server.git
cd n8n-mcp-server
# Install dependencies
npm install
# Copy environment configuration
cp .env.example .env
# Edit .env with your n8n configuration
# Build and run locally
npm run build
npm start
โ๏ธ Configuration
Docker MCP Secrets
The Docker MCP Toolkit manages configuration through secrets:
# Required secrets
docker mcp secret set n8n-server.base_url "https://your-n8n-instance.com"
docker mcp secret set n8n-server.api_key "your-api-key"
# View configured secrets
docker mcp secret list
Optional Configuration
Configure performance and behavior:
# Set custom log level (error, warn, info, debug)
docker mcp config set n8n-server.log_level "info"
# Set rate limiting (requests per minute)
docker mcp config set n8n-server.rate_limit "60"
# Set cache TTL (seconds)
docker mcp config set n8n-server.cache_ttl "300"
# Enable debug mode
docker mcp config set n8n-server.debug "false"
Getting n8n API Key
- Open your n8n instance
- Go to Settings โ API
- Generate a new API key
- Copy the key for configuration
๐ง Usage
Available Primitive Tools
The MCP server provides 15 powerful primitive tools that work as building blocks for any conceivable workflow automation:
Core Workflow Operations
n8n_discover
- Universal discovery of workflows, nodes, and community packagesn8n_create
- Create workflows, nodes, and configurations with validationn8n_execute
- Execute workflows with real-time monitoring and timeout handlingn8n_inspect
- Deep inspection of workflows, executions, and node configurationsn8n_remove
- Safe deletion of workflows, executions, and configurations
Advanced Management
n8n_modify
- Update and edit workflows, nodes, and settings with validationn8n_connect
- Manage connections between nodes and external servicesn8n_control
- Start, stop, activate, deactivate workflows and executionsn8n_search
- Unified search across workflows, nodes, executions, and documentationn8n_validate
- Comprehensive validation of workflows, nodes, and configurations
Professional Tools
n8n_monitor
- Real-time execution monitoring with performance metrics and health checksn8n_debug
- Workflow debugging, analysis, and issue detectionn8n_template
- Template management, creation, and pattern recognitionn8n_batch
- Bulk operations with concurrency control and progress trackingn8n_export
- Data export in multiple formats with anonymization options
Key Capabilities
Iterative Workflow Building
Build complex workflows step-by-step using primitive operations:
1. n8n_discover โ Find available nodes
2. n8n_create โ Create workflow structure
3. n8n_connect โ Link nodes together
4. n8n_validate โ Check configuration
5. n8n_execute โ Test and run
6. n8n_monitor โ Track performance
Enterprise Features
- Error Handling: Comprehensive validation with detailed error context
- Performance Monitoring: Execution metrics, memory usage, and timing analysis
- Security: Input sanitization, credential protection, and data anonymization
- Batch Processing: Handle hundreds of workflows with proper concurrency control
- Template System: Reusable workflow patterns with variable substitution
Ephemeral Docker MCP Pattern
With the ephemeral setup, each MCP request:
- Spins up a fresh Docker container
- Processes the request with clean state
- Returns the response
- Immediately shuts down the container
This ensures:
- โ No resource waste from long-running containers
- โ Clean execution environment per request
- โ Better security isolation
- โ Follows Docker MCP best practices
๐ MCP Docker Standards Compliance
This implementation fully adheres to MCP Docker standards for ephemeral containers:
โ Compliance Features
- Stdio Transport: Clean stdin/stdout communication for MCP protocol
- Silent Startup: No stdout contamination (logs only to stderr in debug mode)
- Fast Startup: < 3 seconds from container start to MCP ready
- Lazy Loading: Node discovery and validation only when needed
- Resource Optimized: 128MB memory limit, minimal Alpine base
- Security: Non-root user execution, isolated container environment
- Ephemeral Pattern:
docker run --rm
with immediate shutdown after request
๐งช Test Compliance
# Validate MCP Docker standards compliance
./scripts/test-mcp-compliance.sh
Available Resources
Access structured data through MCP resources:
n8n://workflows
- Complete workflows listn8n://workflow/{id}
- Individual workflow detailsn8n://nodes
- All available nodesn8n://nodes/category/{category}
- Nodes by categoryn8n://executions
- Execution historyn8n://stats
- Instance statistics
Example Usage with Claude Code
You: "Create a workflow that processes CSV data and sends emails"
Claude Code: [Uses n8n_discover, n8n_create, n8n_connect, n8n_validate]
You: "Execute all my data processing workflows and show performance metrics"
Claude Code: [Uses n8n_batch, n8n_monitor for comprehensive automation]
You: "Debug why my webhook workflow is failing"
Claude Code: [Uses n8n_debug, n8n_inspect for detailed analysis]
๐ณ Docker Deployment Options
Docker MCP Toolkit (Recommended)
The Docker MCP Toolkit provides ephemeral container execution automatically:
# Build and publish image (for development)
./scripts/build-and-publish.sh --build-only
# Or use published image
docker pull eekfonky/n8n-mcp-server:latest
# The Docker MCP gateway handles container lifecycle automatically
docker mcp gateway run
Local Development
# Build for local testing
docker build -t eekfonky/n8n-mcp-server:latest .
# Test manually
docker run --rm -i \
-e N8N_BASE_URL=http://localhost:5678 \
-e N8N_API_KEY=your-key \
eekfonky/n8n-mcp-server:latest
๐ AI Integration
Docker MCP Toolkit Integration
The Docker MCP Toolkit automatically handles server discovery and execution:
- Setup once using the installation methods above
- Start the gateway:
docker mcp gateway run
- AI tools automatically discover n8n capabilities
No additional configuration needed - the Docker MCP Toolkit handles:
- โ Ephemeral container execution per request
- โ Secret management for n8n API credentials
- โ Tool discovery and routing
- โ Container lifecycle and cleanup
Claude Code Integration (Alternative)
For direct Claude Code integration without Docker MCP Toolkit:
{
"name": "n8n",
"description": "n8n workflow automation MCP server",
"command": "docker",
"args": [
"run", "--rm", "-i",
"-e", "N8N_BASE_URL=http://localhost:5678",
"-e", "N8N_API_KEY=your-api-key-here",
"eekfonky/n8n-mcp-server:latest"
],
"transport": "stdio"
}
๐๏ธ Architecture
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
โ AI Client โโโโโโ Docker MCP โโโโโโ n8n Instance โ
โ (Claude, etc.) โ โ Gateway โ โ โ
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโโโโ
โ Ephemeral n8n โ
โ MCP Containers โ
โ (15 Tools) โ
โโโโโโโโโโโโโโโโโโโโ
Docker MCP Toolkit Benefits:
- ๐ Ephemeral Execution: Containers spin up per request, shut down immediately
- ๐ Security Isolation: Each request runs in a fresh, isolated environment
- ๐ฆ Automatic Discovery: Tools are automatically available to AI clients
- โก Performance: Fast startup (< 3 seconds) with optimized Alpine images
- ๐ง Zero Configuration: Works out-of-the-box after catalog setup
Enterprise-Grade Quality
- Type Safety: 98/100 - Comprehensive TypeScript interfaces (478 lines)
- Error Handling: 96/100 - Custom error classes with detailed context
- Performance: 94/100 - Optimized operations with memory management
- Security: 97/100 - Input validation and credential protection
- Maintainability: 93/100 - Clean architecture with separation of concerns
๐ Monitoring & Debugging
Watch Containers (Ephemeral Mode)
# Watch containers spin up/down
watch "docker ps -a | grep n8n-mcp-server"
# View recent container logs
docker logs $(docker ps -a -q --filter ancestor=eekfonky/n8n-mcp-server:latest | head -1)
Health Checks
# Check n8n connectivity
curl -H "X-N8N-API-KEY: your-key" http://localhost:5678/api/v1/workflows
# Test Docker MCP integration
./scripts/test-docker-mcp.sh
# Rebuild image if needed
./scripts/build-and-publish.sh --build-only
๐ Troubleshooting
Common Issues
Docker MCP Integration Issues
# Check catalog status
docker mcp catalog ls
docker mcp catalog show n8n-mcp-catalog
# Check image exists
docker images | grep n8n-mcp-server
# Rebuild if needed
./scripts/build-and-publish.sh --build-only
# Test the setup
./scripts/test-docker-mcp.sh
# Test image manually
docker run --rm -it -e DEBUG=true -e N8N_BASE_URL=http://localhost:5678 -e N8N_API_KEY=your-key eekfonky/n8n-mcp-server:latest
Tools Not Visible
# Check gateway status
pgrep -f "docker mcp gateway"
# Restart gateway
pkill -f "docker mcp gateway"
docker mcp gateway run
# Check tools after restart
docker mcp tools list | grep n8n_
Connection Issues
# Verify n8n accessibility from Docker
docker run --rm --network host curlimages/curl \
curl -H "X-N8N-API-KEY: your-key" http://localhost:5678/api/v1/workflows
๐ Development
Local Development
# Development mode with hot reload
npm run dev
# Build and test
npm run build
npm start
# Run type checking
npm run typecheck
Rebuilding
# Build and publish Docker image
./scripts/build-and-publish.sh
# Or just build locally
./scripts/build-and-publish.sh --build-only
# Or just rebuild TypeScript
npm run build
๐ Examples
Check the examples/
directory for:
- Sample workflow definitions
- Claude Code configurations
- Usage examples and patterns
- Integration guides
๐ค Contributing
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature
- Make your changes
- Test with Docker MCP Toolkit and local development
- Commit:
git commit -m 'Add amazing feature'
- Push:
git push origin feature/amazing-feature
- Open a Pull Request
GitHub Actions Setup
For automated Docker image publishing, maintainers need these GitHub repository secrets:
# Required secrets in GitHub repository settings:
DOCKERHUB_USERNAME # Your Docker Hub username
DOCKERHUB_TOKEN # Docker Hub access token (not password)
# GITHUB_TOKEN is automatically provided by GitHub Actions
Setting up Docker Hub token:
- Go to Docker Hub Account Settings
- Create a new access token with Read & Write permissions
- Add
DOCKERHUB_USERNAME
andDOCKERHUB_TOKEN
to your GitHub repository secrets
๐ License
This project is licensed under the MIT License - see the file for details.
Production-Ready for Claude Code! ๐โก
Enterprise-grade n8n automation with 15 powerful primitive tools, comprehensive error handling, and optimized performance for any workflow automation need.