@drballs/n8n-mcp-server
v0.1.14
Published
Comprehensive n8n MCP server providing full access to n8n's workflow automation capabilities (Production Build)
Maintainers
Readme
n8n MCP Server
A comprehensive MCP (Model Context Protocol) server providing full access to n8n's workflow automation capabilities through Claude Desktop.
🚀 Features
- 49 Powerful Tools covering workflow management, execution control, credentials, monitoring, debugging, and more
- Real-time Monitoring with WebSocket, SSE, and polling support
- Enterprise Security with API key management, RBAC, rate limiting, and audit logging
- Advanced Operations including batch processing, version control, and workflow visualization
- Intelligent Caching with multi-tier cache management for optimal performance
📋 Requirements
- Node.js 20+
- n8n instance (cloud or self-hosted)
- n8n API access (requires paid n8n plan)
- Claude Desktop application
🔧 Installation & Configuration
Step 1: Find Your Claude Desktop Config File
The config file location depends on your operating system:
- Windows:
%APPDATA%\Claude\claude_desktop_config.json - macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Linux:
~/.config/Claude/claude_desktop_config.json
Step 2: Add MCP Server Configuration
Add this to your claude_desktop_config.json:
{
"mcpServers": {
"n8n-mcp-server": {
"command": "npx",
"args": ["@drballs/[email protected]"],
"env": {
"N8N_API_KEY": "your-n8n-api-key-here",
"N8N_BASE_URL": "https://your-n8n-instance.com"
}
}
}
}Step 3: Get Your n8n Credentials
Get Your n8n API Key:
n8n Cloud:
- Go to your n8n dashboard
- Navigate to Settings → API Keys
- Create a new API key
- Copy the key (requires paid plan)
Self-hosted n8n:
- Access your n8n instance
- Go to Settings → API
- Generate API key
- Ensure API access is enabled
2. Configure Claude Desktop
Add to your Claude Desktop configuration file:
Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"n8n": {
"command": "npx",
"args": ["@drballs/n8n-mcp-server"],
"env": {
"N8N_API_KEY": "your_n8n_api_key_here",
"N8N_BASE_URL": "https://your-n8n-instance.com"
}
}
}
}macOS/Linux: ~/.config/claude/claude_desktop_config.json
{
"mcpServers": {
"n8n": {
"command": "npx",
"args": ["@drballs/n8n-mcp-server"],
"env": {
"N8N_API_KEY": "your_n8n_api_key_here",
"N8N_BASE_URL": "https://your-n8n-instance.com"
}
}
}
}Step 4: Restart Claude Desktop
After saving the configuration:
- Completely quit Claude Desktop (don't just close the window)
- Start Claude Desktop again
- The n8n tools should now appear and work with your credentials
🚨 Authentication Troubleshooting
If you see "authentication error" even though tools are visible:
Verify your API key format:
- n8n Cloud:
n8n_api_1234567890abcdef - Self-hosted: May vary, check your n8n settings
- n8n Cloud:
Check your base URL:
- Include protocol: ✅
https://n8n.example.com - No trailing slash: ✅
https://n8n.example.com(nothttps://n8n.example.com/) - Local instances: ✅
http://localhost:5678
- Include protocol: ✅
Test your credentials manually:
curl -X GET "YOUR_BASE_URL/api/v1/workflows" \ -H "X-N8N-API-KEY: YOUR_API_KEY"Common issues:
- API access requires a paid n8n plan
- API must be enabled in n8n settings
- Check for IP restrictions in n8n
Need more help? See the full configuration guide: N8N_CONFIGURATION_GUIDE.md
Hostinger Compatibility (v0.1.10+)
If your n8n instance is hosted on Hostinger or another provider that blocks PATCH requests, v0.1.10+ includes automatic workarounds:
- Workflow activation/deactivation: Now uses dedicated
/activateand/deactivateendpoints (POST method) - Other PATCH operations: Automatically retries with POST +
X-HTTP-Method-Overrideheader when PATCH is blocked
This ensures full compatibility with restrictive hosting environments while maintaining the same API interface.
🛠️ Available Tools
Workflow Management (10 tools)
list_workflows- List all workflows with filtering optionscreate_workflow- Create new workflows from JSONget_workflow- Get workflow details by IDupdate_workflow- Update existing workflowsdelete_workflow- Delete workflowsactivate_workflow- Activate workflows for executiondeactivate_workflow- Deactivate running workflowsworkflow_map- Generate visual workflow mapstest_node_isolated- Test nodes in isolation before applying changesauto_fix_node- Automatically fix problematic nodes
Execution Control (8 tools)
trigger_execution- Trigger workflow execution with dataget_execution- Get execution details and resultslist_executions- List workflow executions with filtersstop_execution- Stop running executionsmonitor_execution- Real-time execution monitoringreplay_execution- Replay failed executionsanalyze_execution_failure- Deep analysis of failed executionsget_node_execution_data- Access node input/output data
Credential Management (6 tools)
create_credential- Create new credentialsupdate_credential- Update existing credentialsdelete_credential- Delete credentialslist_credentials- List all credentialstest_credential- Test credential connectionsget_credential- Get credential details
Monitoring & Analytics (8 tools)
realtime_execution_monitor- Monitor executions in real-timeworkflow_metrics_monitor- Track workflow performance metricsmetrics_query- Query performance metricshealth_status- System health checksanalytics_query- Query analytics dataalert_status- Manage alerts and notificationsslo_status- SLO monitoring and compliancemonitoring_overview- Comprehensive monitoring dashboard
Debug Tools (11 tools)
start_debug_session- Start debugging workflowsstep_debug- Step through workflow executioninspect_debug- Inspect variables and statebreakpoint_debug- Manage breakpointswatch_debug- Watch variable changespause_debug- Pause executionresume_debug- Resume executionstop_debug- Stop debug sessionstatus_debug- Get debug session statushistory_debug- View execution historytimeline_debug- Timeline visualization
Batch Operations (6 tools)
batch_workflows_create- Create multiple workflowsbatch_workflows_update- Update multiple workflowsbatch_workflows_delete- Delete multiple workflowsbatch_workflows_activate- Activate multiple workflowsbatch_workflows_deactivate- Deactivate multiple workflowsbatch_operation_status- Track batch operation progress
Version Control (6 tools)
create_version- Create workflow versionscreate_branch- Create workflow brancheslist_versions- List version historymerge_branch- Merge workflow branchesrollback_version- Rollback to previous versionscompare_versions- Compare workflow versions
Visualization (3 tools)
mermaid_diagram- Generate Mermaid diagramsdependency_graph- Visualize workflow dependenciesworkflow_map- Create workflow topology maps
System Tools (2 tools)
server_health- Check MCP server healthtest_connection- Test n8n API connection
📖 Usage Examples
Basic Workflow Operations
// List all active workflows
User: List all my active workflows
// Create a new workflow
User: Create a workflow that sends an email every morning at 9 AM
// Monitor workflow execution
User: Monitor the execution of workflow ID wf_123 in real-timeAdvanced Operations
// Batch operations
User: Deactivate all workflows with the tag "test"
// Version control
User: Create a backup version of my production workflow before making changes
// Debugging
User: Start a debug session for workflow wf_456 and set a breakpoint at the HTTP Request nodeError Analysis & Troubleshooting
// Analyze failed execution
User: Analyze why execution 12345 failed and suggest fixes
// Get node execution data
User: Show me the input and output data for the "Transform Data" node in execution 12345
// Test node fixes
User: Test the HTTP Request node with sample data before applying changes to the workflow
// Auto-fix problematic nodes
User: Automatically fix the authentication issues in the Slack nodeMonitoring & Analytics
// Performance metrics
User: Show me the performance metrics for my most active workflows
// Health monitoring
User: Check the health status of all integrations
// Alert management
User: List all active alerts and their severity levels🔒 Security Features
- API Key Management: Secure API key storage and rotation
- RBAC: Role-based access control with granular permissions
- Rate Limiting: Configurable rate limits per tool and user
- Audit Logging: Complete audit trail of all operations
- Encryption: Secure credential storage and transmission
🚨 Troubleshooting
Connection Issues
# Test n8n connection
npx @drballs/n8n-mcp-server test-connection
# Check environment variables
echo $N8N_API_KEY
echo $N8N_BASE_URLCommon Errors
"Authentication failed"
- Verify your API key is correct
- Ensure API access is enabled in n8n
- Check if your n8n plan includes API access
"Rate limit exceeded"
- Reduce request frequency
- Check rate limit configuration
- Consider upgrading your n8n plan
"Tool not available"
- Ensure n8n API client is configured
- Check if required features are enabled
- Verify n8n version compatibility
🔧 Advanced Configuration
Environment Variables
# Required
N8N_API_KEY=your_api_key
N8N_BASE_URL=https://your-instance.com
# Optional
N8N_TIMEOUT=30000 # Request timeout (ms)
N8N_RETRY_MAX=3 # Max retry attempts
N8N_RATE_LIMIT=10 # Requests per second
N8N_CACHE_TTL=300000 # Cache TTL (ms)
N8N_WEBHOOK_URL=https://... # Webhook endpointSecurity Configuration
{
"security": {
"enableAudit": true,
"enableRateLimit": true,
"rateLimits": {
"global": { "requests": 100, "window": 60 },
"perTool": { "requests": 10, "window": 60 }
}
}
}Monitoring Configuration
{
"monitoring": {
"protocol": "websocket",
"wsUrl": "wss://your-n8n-instance.com/ws",
"updateInterval": 5000
}
}📊 Performance Optimization
- Caching: Multi-tier caching reduces API calls by up to 80%
- Batch Operations: Process multiple workflows 10x faster
- Connection Pooling: Optimized connection management
- Async Processing: Non-blocking operations for better performance
🤝 Contributing
Contributions are welcome! Please see our Contributing Guide for details.
📄 License
MIT License - see LICENSE file for details.
🔗 Links
💡 Support
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- NPM Package: npmjs.com/package/@drballs/n8n-mcp-server
- n8n Community: n8n Community Forum
Built with ❤️ by the Retro Development Team
