n8n-mcp
Allows AI models to manage n8n automation workflows, credentials, nodes, templates, and monitor executions through a standardized protocol.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@n8n-mcpshow me my workflows"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
n8n-mcp: Model Context Protocol Server for n8n
A production-ready MCP (Model Context Protocol) server that provides comprehensive access to n8n automation platform. Enables AI models to manage workflows, credentials, nodes, templates, and monitor executions through a standardized protocol.
📋 Table of Contents
Related MCP server: n8n MCP Server
What is n8n-mcp?
n8n-mcp is a Model Context Protocol (MCP) server that acts as a bridge between AI models and n8n automation platform. It exposes n8n's API capabilities through standardized tools that AI models can call directly.
Why use n8n-mcp?
Direct AI Integration: AI models can create, modify, and manage n8n workflows without manual intervention
Comprehensive API Access: Full access to n8n's REST API through typed tools
Dual Transport: Supports both stdio (for Claude Desktop) and HTTP (for cloud deployment)
Validation: Runtime input validation with Zod ensures data integrity
Production Ready: Built following MCP best practices with proper error handling
Use Cases
🤖 AI Workflow Generation: Let AI models create and optimize n8n workflows
🔧 Workflow Management: CRUD operations on workflows with validation
🔐 Credential Management: Secure credential creation and updates
📊 Execution Monitoring: Track workflow executions and debug issues
🏗️ Template Deployment: Deploy workflow templates from a library
🏷️ Tag Management: Organize workflows with tags
🔍 Node Discovery: Search and validate n8n node types
📝 Auditing: Generate comprehensive audit reports
Features
Core Capabilities
Feature | Description |
Workflow CRUD | Create, read, update, delete workflows with validation |
Partial Updates | Incremental workflow updates with diff operations |
Workflow Validation | Validate structure, nodes, connections, expressions |
Autofix | Automatically fix common workflow errors |
Version Control | Manage workflow version history, rollback, prune |
Execution Management | List, get details, delete workflow executions |
Trigger Workflows | Test workflows via webhook/form/chat triggers |
Credential Management | Create, update, delete, transfer credentials |
Tag Management | Organize workflows with tags |
User Management | List and get user information |
Node Discovery | Search n8n nodes, get node details, validate nodes |
Template Deployment | Deploy workflow templates from library |
Health Checks | Monitor n8n instance health and API connectivity |
Audit Reports | Generate comprehensive audit reports |
Technical Features
✅ TypeScript: Full type safety with comprehensive type definitions
✅ Zod Validation: Runtime input validation for all tools
✅ Dual Transport: Stdio (Claude Desktop) + HTTP (cloud/SSE)
✅ Tool Descriptions: High-signal, low-token descriptions per MCP standard
✅ Error Handling: Comprehensive error handling with actionable messages
✅ Pagination: Built-in support for paginated API responses
✅ Version-Aware: Handles different n8n API versions
✅ Docker Ready: Containerized deployment with health checks
Architecture
Project Structure
n8n-mcp/
├── src/
│ ├── index.ts # Entry point - server initialization
│ ├── server.ts # MCP server implementation with dual transport
│ ├── types/ # TypeScript type definitions
│ │ ├── tools.ts # Tool and handler types
│ │ ├── n8n-api.ts # n8n API types
│ │ └── index.ts
│ ├── validation/ # Zod validation schemas by category
│ │ ├── base.ts # Base schemas and utilities
│ │ ├── workflows.ts # Workflow validation schemas
│ │ ├── credentials.ts # Credential validation schemas
│ │ ├── tags.ts # Tag validation schemas
│ │ ├── users.ts # User validation schemas
│ │ ├── nodes.ts # Node validation schemas
│ │ ├── templates.ts # Template validation schemas
│ │ ├── audit.ts # Audit validation schemas
│ │ └── index.ts
│ ├── tools/ # Tool definitions organized by category
│ │ ├── workflows.ts # Workflow management tools
│ │ ├── credentials.ts # Credential management tools
│ │ ├── tags.ts # Tag management tools
│ │ ├── users.ts # User management tools
│ │ ├── nodes.ts # Node discovery tools
│ │ ├── templates.ts # Template deployment tools
│ │ ├── audit.ts # Audit tools
│ │ ├── documentation.ts # Documentation tools
│ │ └── index.ts
│ ├── handlers/ # Tool implementations with validation
│ │ ├── workflows.ts # Workflow handlers
│ │ ├── credentials.ts # Credential handlers
│ │ ├── tags.ts # Tag handlers
│ │ ├── users.ts # User handlers
│ │ ├── nodes.ts # Node handlers
│ │ ├── templates.ts # Template handlers
│ │ ├── audit.ts # Audit handlers
│ │ ├── documentation.ts # Documentation handlers
│ │ └── index.ts
│ └── services/ # Business logic and API clients
│ └── n8n-api-client.ts # n8n API client
├── dist/ # Compiled JavaScript (generated by build)
├── package.json
├── tsconfig.json
├── Dockerfile
└── README.mdMCP Protocol Flow
┌─────────────┐ ┌─────────────┐ ┌─────────────┐
│ AI Model │ │ MCP Client │ │ n8n-mcp │
│ │ │ (Claude) │ │ (Server) │
└─────┬─────┘ └──────┬──────┘ └──────┬──────┘
│ │ │
│ 1. Lists Tools │ │
│<---------------------------------┘ │
│ │ │
│ 2. Request Tool │ 3. Call Tool (JSON) │
│<---------------------------------┘<-----------------------------------┘
│ │ │
│ 5. Tool Result │ 4. n8n API Call │
│<---------------------------------┘<---------------------------------┘
│ │ │
│ │ │
│ │
└────────────────┬─────────────────────────┘
│
│
│
┌────────┴────────┐
│ n8n Instance │
└─────────────────┘Quick Start
Prerequisites
Node.js: v18.0.0 or higher
n8n Instance: Self-hosted or n8n Cloud
n8n API Key: Generated from n8n settings
MCP Client: Claude Desktop or any MCP-compatible client
⚠️ REQUIRED: n8n-nodes-mcp Node - This MCP server requires the n8n community nodes to be installed in your n8n instance. Without these community nodes, the MCP server will not function properly as it relies on their availability for certain operations.
How to Install n8n-nodes-mcp:
For Self-Hosted n8n:
Go to your n8n instance's settings
Navigate to Community Nodes
Search for "n8n-nodes-mcp" or go to the package repository
Install the package by providing the repository URL or uploading the package file
For Docker n8n:
# Run n8n container docker run -it --rm \ -v n8n_data:/data \ -e N8N_BASIC_AUTH_USER=admin \ -e N8N_BASIC_AUTH_PASSWORD=password \ -e N8N_HOST=http://n8n:5678 \ n8nio/n8n:latest # Then install via CLI docker exec -it n8n npm install n8n-nodes-mcpFor n8n Cloud:
Community nodes can only be installed in self-hosted instances
You will need to migrate to a self-hosted setup if using n8n Cloud
Verification:
After installation, verify the nodes are available in n8n
Check that nodes like "AI Agent", "MCP Tools", "Workflow Assistant" are visible in the node palette
Why This is Required:
The MCP server is designed to work with these specific community nodes
Many tools validate against node schemas and parameters
Without these nodes, certain operations may fail or return unexpected errors
5-Minute Setup
Clone and Install
git clone https://github.com/your-org/n8n-mcp.git cd n8n-mcp npm installConfigure Environment
# Create .env file cat > .env << EOF N8N_API_URL=https://your-n8n-instance.com N8N_API_KEY=n8n_api_xxxxxxxxxxxxxxxx EOFBuild and Run
npm run build npm startConfigure Claude Desktop Add to Claude Desktop config:
{ "mcpServers": { "n8n-mcp": { "command": "node", "args": ["/path/to/n8n-mcp/dist/index.js"] } } }Test In Claude: "List all workflows in n8n"
Installation
Local Development
1. Clone Repository
git clone https://github.com/your-org/n8n-mcp.git
cd n8n-mcp2. Install Dependencies
npm install3. Build Project
npm run build4. Run Server (Stdio Mode)
# With environment variables
N8N_API_URL=https://your-n8n.com N8N_API_KEY=xxx npm start
# Or with .env file
npm start5. Run Server (HTTP Mode)
# With environment variables
N8N_API_URL=https://your-n8n.com N8N_API_KEY=xxx npm run start:http
# Optional: Set API key for HTTP authentication
MCP_TRANSPORT=http MCP_API_KEY=your-secret-key npm run start:httpAvailable Scripts
Script | Description |
| Compile TypeScript to JavaScript |
| Watch mode for development |
| Start server in stdio mode |
| Start server in HTTP mode |
| Start server in stdio mode (explicit) |
| Run TypeScript type checking |
| Clean dist directory |
Docker Deployment
Dockerfile
A Dockerfile is included in the project for containerized deployment.
# Dockerfile for n8n-mcp
FROM node:20-alpine
# Set working directory
WORKDIR /app
# Copy package files
COPY package*.json ./
# Install dependencies
RUN npm ci --only=production
# Copy source and compiled files
COPY dist ./dist
# Create non-root user
RUN addgroup -g 1000 -S nodejs && \
adduser -S -u 1000 -G nodejs nodejs
# Change ownership
RUN chown -R nodejs:nodejs /app
# Switch to non-root user
USER nodejs
# Expose port for HTTP mode
EXPOSE 3000
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD node -e "require('http').get('http://localhost:3000/health', (r) => { process.exit(r.statusCode === 200 ? 0 : 1) })"
# Default command (stdio mode)
CMD ["node", "dist/index.js"]Build Docker Image
docker build -t n8n-mcp:latest .Run Docker Container
Stdio Mode (Claude Desktop)
docker run --rm \
-v /path/to/n8n-mcp/dist:/app/dist \
-e N8N_API_URL=https://your-n8n.com \
-e N8N_API_KEY=your-api-key \
n8n-mcp:latestHTTP Mode (Cloud)
docker run -d \
--name n8n-mcp \
-p 3000:3000 \
-v /path/to/n8n-mcp/dist:/app/dist \
-e N8N_API_URL=https://your-n8n.com \
-e N8N_API_KEY=your-api-key \
-e MCP_TRANSPORT=http \
-e MCP_API_KEY=your-http-secret-key \
n8n-mcp:latestDocker Compose
# docker-compose.yml
version: "3.8"
services:
n8n-mcp:
build: .
container_name: n8n-mcp
restart: unless-stopped
ports:
- "3000:3000"
environment:
- N8N_API_URL=https://your-n8n-instance.com
- N8N_API_KEY=${N8N_API_KEY}
- MCP_TRANSPORT=http
- MCP_API_KEY=${MCP_API_KEY}
- PORT=3000
volumes:
- ./dist:/app/dist
healthcheck:
test:
[
"CMD",
"node",
"-e",
"require('http').get('http://localhost:3000/health', (r) => { process.exit(r.statusCode === 200 ? 0 : 1) })",
]
interval: 30s
timeout: 10s
retries: 3
start_period: 5s# Start with docker-compose
docker-compose up -d
# View logs
docker-compose logs -f
# Stop
docker-compose downLinux Server Deployment
Option 1: Direct Deployment with PM2
1. Prepare Server
SSH into your Linux server:
# Update system
sudo apt update && sudo apt upgrade -y
# Install Node.js (if not installed)
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt-get install -y nodejs
# Install PM2 (process manager)
sudo npm install -g pm2
# Create application directory
sudo mkdir -p /opt/n8n-mcp
sudo chown $USER:$USER /opt/n8n-mcp
cd /opt/n8n-mcp2. Deploy Application
# Clone repository
git clone https://github.com/your-org/n8n-mcp.git .
# Install dependencies
npm install --production
# Build application
npm run build
# Create .env file
cat > .env << EOF
N8N_API_URL=https://your-n8n-instance.com
N8N_API_KEY=your-api-key
MCP_TRANSPORT=http
PORT=3000
MCP_API_KEY=your-secret-http-key
EOF
# Protect .env file
chmod 600 .env3. Start with PM2
# Start application (HTTP mode)
pm2 start dist/index.js --name n8n-mcp -- --env-file .env
# Save PM2 configuration
pm2 save
# Setup PM2 to start on boot
pm2 startup systemd -u $USER --hp /opt/n8n-mcp4. Configure Firewall (UFW)
# Allow traffic on port 3000
sudo ufw allow 3000/tcp
# Enable firewall
sudo ufw enable
# Check status
sudo ufw status5. Configure Nginx Reverse Proxy (Optional)
sudo apt install -y nginx
# Create Nginx config
sudo nano /etc/nginx/sites-available/n8n-mcp# /etc/nginx/sites-available/n8n-mcp
server {
listen 80;
server_name your-domain.com;
# Redirect to HTTPS
return 301 https://$server_name$request_uri;
}
server {
listen 443 ssl http2;
server_name your-domain.com;
ssl_certificate /path/to/ssl/cert.pem;
ssl_certificate_key /path/to/ssl/key.pem;
location / {
proxy_pass http://localhost:3000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
# WebSocket support for SSE
proxy_read_timeout 86400s;
proxy_send_timeout 86400s;
}
}# Enable site
sudo ln -s /etc/nginx/sites-available/n8n-mcp /etc/nginx/sites-enabled/
# Test configuration
sudo nginx -t
# Reload Nginx
sudo systemctl reload nginxOption 2: Docker Deployment on Linux Server
# Install Docker
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
# Install Docker Compose
sudo curl -L "https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
# Create directory
mkdir -p ~/n8n-mcp
cd ~/n8n-mcp
# Clone repository
git clone https://github.com/your-org/n8n-mcp.git .
# Create .env file
cat > .env << EOF
N8N_API_URL=https://your-n8n-instance.com
N8N_API_KEY=your-api-key
MCP_TRANSPORT=http
PORT=3000
MCP_API_KEY=your-secret-http-key
EOF
chmod 600 .env
# Start with Docker Compose
docker-compose up -d
# Check logs
docker-compose logs -fMonitoring with PM2
# View application status
pm2 status
# View logs
pm2 logs n8n-mcp
# Restart application
pm2 restart n8n-mcp
# Stop application
pm2 stop n8n-mcp
# Monitor resources
pm2 monitConfiguration
Environment Variables
Variable | Required | Default | Description |
| Yes | - | Base URL of your n8n instance (e.g., |
| Yes | - | n8n API key for authentication |
| No |
| Transport mode: |
| No |
| Port for HTTP mode |
| No | - | Optional API key for HTTP mode authentication |
| No | - | Deprecated: Use |
| No | - | Deprecated: Use |
Configuration Methods
There are two ways to configure environment variables for n8n-mcp:
Method 1: .env File (Recommended for local development)
Create a .env file in the project root:
cat > .env << EOF
N8N_API_URL=https://n8n.your-domain.com
N8N_API_KEY=n8n_api_xxxxxxxxxxxxxxxx
MCP_TRANSPORT=http
PORT=3000
MCP_API_KEY=your-secret-http-key
EOFPros:
Easy to manage for local development
Supports version control (use .env.example as template)
Can be shared with team (excluding actual secrets)
Cons:
Requires file in project directory
Not ideal for production deployments
Method 2: Direct Configuration (Recommended for Claude Desktop)
Pass environment variables directly in the MCP server configuration. This is the recommended approach for Claude Desktop as it keeps all configuration in one place without requiring additional files.
Example for Claude Desktop (claude_desktop_config.json):
{
"mcpServers": {
"n8n-mcp": {
"command": "node",
"args": ["/absolute/path/to/n8n-mcp/dist/index.js"],
"env": {
"N8N_API_URL": "https://xxxxx.es",
"N8N_API_KEY": "xxx.xxx.xx",
"MCP_TRANSPORT": "stdio"
},
"disabled": false
}
}
}Additional Configuration Options (all optional):
{
"mcpServers": {
"n8n-mcp": {
"command": "node",
"args": ["/absolute/path/to/n8n-mcp/dist/index.js"],
"env": {
"N8N_API_URL": "https://your-n8n-instance.com",
"N8N_API_KEY": "your-api-key",
// Optional: HTTP mode configuration
"MCP_TRANSPORT": "http",
"PORT": "3000",
"MCP_API_KEY": "your-secret-http-key",
// Optional: Node environment
"NODE_ENV": "production"
},
"disabled": false
}
}
}Pros:
All configuration in one file
No need for .env file
Ideal for production and Claude Desktop
Can be version controlled (with placeholders)
Cons:
Secrets in config file (use secure storage for production)
Requires restart of Claude Desktop to reload configuration
Choosing the Right Method
Scenario | Recommended Method | Why |
Claude Desktop (local development) | Method 2 (Direct Config) | Single config file, no .env needed |
Claude Desktop (production) | Method 2 (Direct Config) | Centralized configuration, easier to manage |
Docker deployment | Method 1 (.env) + docker-compose | Docker best practice, secrets management |
Linux server deployment | Method 1 (.env) or systemd environment | Easier service configuration |
Development testing | Method 1 (.env) | Quick changes, easier debugging |
Getting n8n API Key
n8n Self-Hosted:
Go to Settings → API
Click "Create API Key"
Copy the key
n8n Cloud:
Click "Create API Key"
Copy the key
.env File Example
# n8n Configuration
N8N_API_URL=https://n8n.your-domain.com
N8N_API_KEY=n8n_api_xxxxxxxxxxxxxxxx
# MCP Server Configuration
MCP_TRANSPORT=http
PORT=3000
MCP_API_KEY=your-secret-http-key
# Optional: Override for backward compatibility
# N8N_HOST=https://n8n.your-domain.com
# N8N_KEY=n8n_api_xxxxxxxxxxxxxxxxMCP Client Setup
Claude Desktop
Locate Config File:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.jsonLinux:
~/.config/Claude/claude_desktop_config.json
Add n8n-mcp Server:
{ "mcpServers": { "n8n-mcp": { "command": "node", "args": ["/absolute/path/to/n8n-mcp/dist/index.js"], "env": { "N8N_API_URL": "https://your-n8n-instance.com", "N8N_API_KEY": "your-api-key" } } } }💡 Tip: Environment variables can be passed directly in the
envsection as shown above, without needing a separate.envfile. This is the recommended approach for Claude Desktop as it keeps all configuration in one place.Restart Claude Desktop
Verify Connection: In Claude, ask "What n8n workflows are available?"
HTTP Client Usage
If running in HTTP mode (cloud deployment), you can use the HTTP endpoints:
Health Check
curl http://localhost:3000/healthList Tools
curl -H "x-api-key: your-http-secret" \
http://localhost:3000/mcp/toolsCall Tool (POST)
curl -X POST \
-H "Content-Type: application/json" \
-H "x-api-key: your-http-secret" \
-d '{
"name": "n8n_list_workflows",
"arguments": {"limit": 10}
}' \
http://localhost:3000/mcp/callSSE Connection (HTTP Mode)
// Connect via Server-Sent Events
const eventSource = new EventSource("http://localhost:3000/mcp");
eventSource.onmessage = (event) => {
const data = JSON.parse(event.data);
console.log("MCP Event:", data);
};
eventSource.onerror = (error) => {
console.error("SSE Error:", error);
};Available Tools
Workflow Management (10 tools)
Tool | Purpose | Input | Output |
| Create new workflow | name, nodes[], connections{}, settings{} | workflowId, name |
| Get workflow details | id, mode(full/details/structure/minimal) | workflow data |
| Replace entire workflow | id, nodes[], connections{}, settings{} | workflowId, name |
| Incremental update | id, operations[] | applied, failed |
| Delete workflow | id | success, workflowId |
| List workflows | limit, cursor, active, tags | data[], nextCursor |
| Validate workflow | id, options | valid, errors, warnings |
| Auto-fix errors | id, applyFixes, fixTypes | fixesFound, fixesApplied |
| Test/trigger workflow | workflowId, triggerType, data | triggerInfo |
| Manage executions | action, id, mode, etc. | execution data |
| Version control | mode, workflowId, versionId | versions/details |
| Health check | mode, verbose | status, version, features |
Credential Management (5 tools)
Tool | Purpose | Input | Output |
| Create credential | name, type, data | id, name |
| Update credential | id, name, type, data | id, name |
| Delete credential | id | success |
| Get schema | credentialTypeName | schema data |
| Transfer credential | id, destinationProjectId | success |
Tag Management (4 tools)
Tool | Purpose | Input | Output |
| List tags | limit, cursor | data[], nextCursor |
| Create tag | name | id, name |
| Update tag | id, name | id, name |
| Delete tag | id | success |
User Management (2 tools)
Tool | Purpose | Input | Output |
| List users | limit, cursor | data[], nextCursor |
| Get user | id | user data |
Node Discovery (3 tools)
Tool | Purpose | Input | Output |
| Search nodes | query, limit, category | nodes[] |
| Get node details | name, includeParameters | node data |
| Validate node | nodeType, parameters | valid, errors |
Template Management (3 tools)
Tool | Purpose | Input | Output |
| Get template | id | template data |
| Search templates | query, category, limit | templates[] |
| Deploy template | templateId, name, customizations | workflowId |
Audit Tools (1 tool)
Tool | Purpose | Input | Output |
| Generate audit | scope, filters, includeDetails | audit report |
Documentation (1 tool)
Tool | Purpose | Input | Output |
| Get tool docs | toolName, mode | documentation |
Total Tools: 29
Usage Examples
Example 1: Create a Simple Workflow
// In Claude, ask:
"Create a workflow named 'Hello World' with a webhook trigger and a HTTP request node that sends a GET request to https://api.example.com";The AI will call:
n8n_create_workflow({
name: "Hello World",
nodes: [
{
id: "webhook_1",
name: "Webhook",
type: "n8n-nodes-base.webhook",
typeVersion: 1,
position: [250, 300],
parameters: {
httpMethod: "POST",
path: "hello",
},
},
{
id: "http_1",
name: "HTTP Request",
type: "n8n-nodes-base.httpRequest",
typeVersion: 4.1,
position: [450, 300],
parameters: {
method: "GET",
url: "https://api.example.com",
},
},
],
connections: {
Webhook: {
main: [[{ node: "HTTP Request", type: "main", index: 0 }]],
},
},
});Example 2: List All Workflows
// In Claude, ask:
"List all workflows in n8n";Response:
{
"data": [
{
"id": "abc123",
"name": "Daily Sales Report",
"active": true,
"tags": ["reports", "sales"],
"createdAt": "2024-01-15T10:00:00Z",
"updatedAt": "2024-01-20T15:30:00Z"
}
],
"nextCursor": null
}Example 3: Get Workflow Structure
// In Claude, ask:
"Show me the structure of workflow 'abc123' with just nodes and connections";Response:
{
"id": "abc123",
"name": "Daily Sales Report",
"nodes": [
{
"id": "node_1",
"name": "Webhook",
"type": "n8n-nodes-base.webhook",
"position": [250, 300],
"disabled": false
}
],
"connections": {
"Webhook": {
"main": [[{ "node": "HTTP Request", "type": "main", "index": 0 }]]
}
}
}Example 4: Validate Workflow
// In Claude, ask:
"Validate workflow 'abc123' and check for errors";Response:
{
"valid": false,
"summary": {
"totalNodes": 5,
"enabledNodes": 5,
"triggerNodes": 1,
"errorCount": 2,
"warningCount": 1
},
"errors": [
{
"node": "HTTP Request",
"message": "Missing node ID"
},
{
"node": "Webhook",
"message": "Missing webhook path"
}
],
"warnings": [
{
"node": "Function",
"message": "Node has no connections"
}
]
}Example 5: Incremental Update
// In Claude, ask:
"Disable node 'Function' in workflow 'abc123'";Response:
{
"success": true,
"workflowId": "abc123",
"applied": 1,
"failed": 0,
"operations": [
{
"index": 0,
"type": "disableNode",
"nodeName": "Function"
}
],
"message": "Applied 1 operations to workflow"
}Example 6: Health Check
// In Claude, ask:
"Check n8n instance health";Response:
{
"status": "healthy",
"n8nVersion": "1.120.0",
"instanceId": "abc123-def456",
"features": {
"sourceControl": true,
"externalHooks": true,
"workers": false
},
"performance": {
"responseTimeMs": 150,
"cacheHitRate": "85%"
},
"nextSteps": ["Instance is healthy", "n8n version is up to date"]
}Example 7: Generate Audit Report
// In Claude, ask:
"Generate an audit report of all workflows";Response:
{
"summary": {
"totalWorkflows": 25,
"activeWorkflows": 18,
"inactiveWorkflows": 7,
"credentials": 12,
"tags": 8
},
"workflows": [
{
"id": "abc123",
"name": "Daily Sales Report",
"status": "active",
"lastExecution": "2024-01-30T10:00:00Z",
"executionsLastWeek": 7
}
],
"recommendations": [
"Consider enabling error workflows",
"Review inactive workflows for cleanup"
]
}Development
Setup Development Environment
# Clone repository
git clone https://github.com/your-org/n8n-mcp.git
cd n8n-mcp
# Install dependencies
npm install
# Run in watch mode
npm run devRunning Tests
# Run TypeScript compiler check
npm run lint
# Build for production
npm run build
# Test with MCP Inspector
npm run inspectorProject Structure for Contributors
Add new tool: Add definition in
src/tools/{category}.tsand handler insrc/handlers/{category}.tsAdd validation schema: Add Zod schema in
src/validation/{category}.tsUpdate types: Add types in
src/types/if neededFollow naming: Use
n8n_prefix for all tool names
Best Practices
✅ Use Zod schemas for validation
✅ Follow MCP tool description standard
✅ Handle errors gracefully with actionable messages
✅ Return structured responses
✅ Use TypeScript strict mode
✅ Add JSDoc comments
✅ Test with MCP Inspector before committing
Troubleshooting
Common Issues
Issue: "Error: Missing n8n API URL configuration"
Solution:
# Set N8N_API_URL environment variable
export N8N_API_URL=https://your-n8n-instance.com
# Or create .env file
echo "N8N_API_URL=https://your-n8n-instance.com" > .envIssue: "Error: Missing n8n API key"
Solution:
# Generate API key in n8n Settings → API
# Then set environment variable
export N8N_API_KEY=n8n_api_xxxxxxxxxxxxxxxx
# Or add to .env
echo "N8N_API_KEY=n8n_api_xxxxxxxxxxxxxxxx" >> .envIssue: Claude Desktop doesn't recognize the MCP server
Solution:
Check config file path is correct
Verify absolute path to
dist/index.jsCheck environment variables are set in config
Restart Claude Desktop completely
Issue: Docker container exits immediately
Solution:
# Check logs
docker logs n8n-mcp
# Common causes:
# - Missing environment variables
# - Invalid N8N_API_URL or N8N_API_KEY
# - Network connectivity issuesIssue: "401 Unauthorized" errors
Solution:
Verify API key is correct
Check API key hasn't expired
Ensure IP is whitelisted (if applicable)
Verify
N8N_API_URLis correct (no typos)
Issue: "n8n-nodes-mcp node not found"
Solution:
⚠️ CRITICAL: This MCP server REQUIRES the n8n community node
n8n-nodes-mcpto be installed in your n8n instanceInstall via n8n UI:
Go to Settings → Community Nodes
Search for "n8n-nodes-mcp" or "AI Agent"
Click Install on the found package
Restart n8n instance
Install via CLI (Docker):
# Run n8n container docker run -it --rm \ -v n8n_data:/data \ -v n8n_home:/home/node/.n8n \ -e N8N_BASIC_AUTH_USER=admin \ -e N8N_BASIC_AUTH_PASSWORD=password \ -e N8N_HOST=http://n8n:5678 \ n8nio/n8n:latest # Then install the package docker exec -it n8n npm install n8n-nodes-mcpVerify Installation:
After installation, check node palette
Look for nodes like "AI Agent", "MCP Tools", "Workflow Assistant"
These nodes should now be available
Common Problems:
Package not found: Check n8n version compatibility
Node not visible: Try refreshing n8n browser page
Installation fails: Check n8n logs for errors
Why This is Required:
Many MCP tools validate against these specific node schemas
Without them, tools may return validation errors
Some features depend on these nodes being available
Issue: Build errors with TypeScript
Solution:
# Clean and rebuild
npm run clean
npm run build
# Check TypeScript version
npm list typescript
# Reinstall dependencies
rm -rf node_modules package-lock.json
npm installDebug Mode
Enable verbose logging:
# Set verbose mode
export DEBUG=n8n-mcp:*
# Or in .env
echo "DEBUG=n8n-mcp:*" >> .envHealth Check
Always run health check before using other tools:
# Via HTTP endpoint
curl http://localhost:3000/health
# Via MCP tool
n8n_health_check({ mode: "diagnostic", verbose: true })Getting Help
GitHub Issues: https://github.com/your-org/n8n-mcp/issues
n8n Community: https://community.n8n.io/
MCP Documentation: https://modelcontextprotocol.io/
License
MIT License - see LICENSE file for details.
Contributing
Contributions are welcome! Please see CONTRIBUTING.md for guidelines.
Acknowledgments
Built on Model Context Protocol
Inspired by n8n-nodes-mcp
Uses n8n REST API
Version: 2.0.0
Last Updated: 2026-01-31
MCP Protocol Version: 2024-11-05
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/SocietyCamarai/n8n-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server