docs/SELF_HOSTING.md
Prefer to run n8n-MCP yourself? Choose your deployment method:
Get n8n-MCP running in minutes:
Prerequisites: Node.js installed on your system
# Run directly with npx (no installation needed!)
npx n8n-mcp
Add to Claude Desktop config:
⚠️ Important: The
MCP_MODE: "stdio"environment variable is required for Claude Desktop. Without it, you will see JSON parsing errors like"Unexpected token..."in the UI. This variable ensures that only JSON-RPC messages are sent to stdout, preventing debug logs from interfering with the protocol.
Basic configuration (documentation tools only):
{
"mcpServers": {
"n8n-mcp": {
"command": "npx",
"args": ["n8n-mcp"],
"env": {
"MCP_MODE": "stdio",
"LOG_LEVEL": "error",
"DISABLE_CONSOLE_OUTPUT": "true"
}
}
}
}
Full configuration (with n8n management tools):
{
"mcpServers": {
"n8n-mcp": {
"command": "npx",
"args": ["n8n-mcp"],
"env": {
"MCP_MODE": "stdio",
"LOG_LEVEL": "error",
"DISABLE_CONSOLE_OUTPUT": "true",
"N8N_API_URL": "https://your-n8n-instance.com",
"N8N_API_KEY": "your-api-key"
}
}
}
}
Note: npx will download and run the latest version automatically. The package includes a pre-built database with all n8n node information.
Configuration file locations:
~/Library/Application Support/Claude/claude_desktop_config.json%APPDATA%\Claude\claude_desktop_config.json~/.config/Claude/claude_desktop_config.jsonRestart Claude Desktop after updating configuration - That's it! 🎉
Prerequisites: Docker installed on your system
<details> <summary><strong>📦 Install Docker</strong> (click to expand)</summary>macOS:
# Using Homebrew
brew install --cask docker
# Or download from https://www.docker.com/products/docker-desktop/
Linux (Ubuntu/Debian):
# Update package index
sudo apt-get update
# Install Docker
sudo apt-get install docker.io
# Start Docker service
sudo systemctl start docker
sudo systemctl enable docker
# Add your user to docker group (optional, to run without sudo)
sudo usermod -aG docker $USER
# Log out and back in for this to take effect
Windows:
# Option 1: Using winget (Windows Package Manager)
winget install Docker.DockerDesktop
# Option 2: Using Chocolatey
choco install docker-desktop
# Option 3: Download installer from https://www.docker.com/products/docker-desktop/
Verify installation:
docker --version
# Pull the Docker image (~280MB, no n8n dependencies!)
docker pull ghcr.io/czlonkowski/n8n-mcp:latest
⚡ Ultra-optimized: Our Docker image is 82% smaller than typical n8n images because it contains NO n8n dependencies - just the runtime MCP server with a pre-built database!
Add to Claude Desktop config:
Basic configuration (documentation tools only):
{
"mcpServers": {
"n8n-mcp": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"--init",
"-e", "MCP_MODE=stdio",
"-e", "LOG_LEVEL=error",
"-e", "DISABLE_CONSOLE_OUTPUT=true",
"ghcr.io/czlonkowski/n8n-mcp:latest"
]
}
}
}
Full configuration (with n8n management tools):
{
"mcpServers": {
"n8n-mcp": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"--init",
"-e", "MCP_MODE=stdio",
"-e", "LOG_LEVEL=error",
"-e", "DISABLE_CONSOLE_OUTPUT=true",
"-e", "N8N_API_URL=https://your-n8n-instance.com",
"-e", "N8N_API_KEY=your-api-key",
"ghcr.io/czlonkowski/n8n-mcp:latest"
]
}
}
}
💡 Tip: If you're running n8n locally on the same machine (e.g., via Docker), use http://host.docker.internal:5678 as the N8N_API_URL.
Note: The n8n API credentials are optional. Without them, you'll have access to all documentation and validation tools. With them, you'll additionally get workflow management capabilities (create, update, execute workflows).
If you're running n8n locally (e.g., http://localhost:5678 or Docker), you need to allow localhost in the SSRF gate. This applies to both webhook triggers and the n8n API client (N8N_API_URL):
{
"mcpServers": {
"n8n-mcp": {
"command": "docker",
"args": [
"run", "-i", "--rm", "--init",
"-e", "MCP_MODE=stdio",
"-e", "LOG_LEVEL=error",
"-e", "DISABLE_CONSOLE_OUTPUT=true",
"-e", "N8N_API_URL=http://host.docker.internal:5678",
"-e", "N8N_API_KEY=your-api-key",
"-e", "WEBHOOK_SECURITY_MODE=moderate",
"ghcr.io/czlonkowski/n8n-mcp:latest"
]
}
}
}
⚠️ Important: Set
WEBHOOK_SECURITY_MODE=moderatewheneverN8N_API_URLpoints at localhost orhost.docker.internal. The same SSRF gate covers webhook triggers and the n8n API client; defaultstrictmode rejects loopback addresses for both.moderateallows localhost while still blocking RFC1918 private networks and cloud metadata.
Important: The -i flag is required for MCP stdio communication.
🔧 If you encounter any issues with Docker, check our Docker Troubleshooting Guide.
Configuration file locations:
~/Library/Application Support/Claude/claude_desktop_config.json%APPDATA%\Claude\claude_desktop_config.json~/.config/Claude/claude_desktop_config.jsonRestart Claude Desktop after updating configuration - That's it! 🎉
Prerequisites: Node.js installed on your system
# 1. Clone and setup
git clone https://github.com/czlonkowski/n8n-mcp.git
cd n8n-mcp
npm install
npm run build
npm run rebuild
# 2. Test it works
npm start
Add to Claude Desktop config:
Basic configuration (documentation tools only):
{
"mcpServers": {
"n8n-mcp": {
"command": "node",
"args": ["/absolute/path/to/n8n-mcp/dist/mcp/index.js"],
"env": {
"MCP_MODE": "stdio",
"LOG_LEVEL": "error",
"DISABLE_CONSOLE_OUTPUT": "true"
}
}
}
}
Full configuration (with n8n management tools):
{
"mcpServers": {
"n8n-mcp": {
"command": "node",
"args": ["/absolute/path/to/n8n-mcp/dist/mcp/index.js"],
"env": {
"MCP_MODE": "stdio",
"LOG_LEVEL": "error",
"DISABLE_CONSOLE_OUTPUT": "true",
"N8N_API_URL": "https://your-n8n-instance.com",
"N8N_API_KEY": "your-api-key"
}
}
}
}
Note: The n8n API credentials can be configured either in a
.envfile (create from.env.example) or directly in the Claude config as shown above.
💡 Tip: If you're running n8n locally on the same machine (e.g., via Docker), use http://host.docker.internal:5678 as the N8N_API_URL.
Prerequisites: Railway account (free tier available)
Deploy n8n-MCP to Railway's cloud platform with zero configuration:
Benefits:
Quick Setup:
📚 For detailed setup instructions, troubleshooting, and configuration examples, see our Railway Deployment Guide
Configuration file locations:
~/Library/Application Support/Claude/claude_desktop_config.json%APPDATA%\Claude\claude_desktop_config.json~/.config/Claude/claude_desktop_config.jsonRestart Claude Desktop after updating configuration - That's it! 🎉