docs/RAILWAY_DEPLOYMENT.md
Deploy n8n-MCP to Railway's cloud platform with zero configuration and connect it to Claude Desktop from anywhere.
Deploy n8n-MCP with one click:
Railway deployment provides:
IMPORTANT: The deployment includes a default AUTH_TOKEN for instant functionality, but you MUST change it:
AUTH_TOKEN# Generate secure token locally:
openssl rand -base64 32
⚠️ Security Warning: The server displays warnings every 5 minutes until you change the default token!
https://your-app-name.up.railway.app
Add to your Claude Desktop configuration:
{
"mcpServers": {
"n8n-railway": {
"command": "npx",
"args": [
"-y",
"mcp-remote",
"https://your-app-name.up.railway.app/mcp",
"--header",
"Authorization: Bearer YOUR_SECURE_TOKEN_HERE"
]
}
}
}
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 saving the configuration.
These are automatically set by the Railway template:
| Variable | Default Value | Description |
|---|---|---|
AUTH_TOKEN | REPLACE_THIS... | ⚠️ CHANGE IMMEDIATELY |
MCP_MODE | http | Required for cloud deployment |
NODE_ENV | production | Production optimizations |
LOG_LEVEL | info | Balanced logging |
TRUST_PROXY | 1 | Railway runs behind proxy |
CORS_ORIGIN | * | Allow any origin |
HOST | 0.0.0.0 | Listen on all interfaces |
PORT | (Railway provides) | Don't set manually |
AUTH_RATE_LIMIT_WINDOW | 900000 (15 min) | Rate limit window (v2.16.3+) |
AUTH_RATE_LIMIT_MAX | 20 | Max auth attempts (v2.16.3+) |
WEBHOOK_SECURITY_MODE | strict | SSRF protection mode (v2.16.3+) |
| Variable | Default Value | Description |
|---|---|---|
N8N_MODE | false | Enable n8n integration mode for MCP Client Tool |
N8N_API_URL | - | URL of your n8n instance (for workflow management) |
N8N_API_KEY | - | API key from n8n Settings → API |
To use n8n-MCP with n8n's MCP Client Tool node:
N8N_MODE: Set to true to enable n8n integration modeTo enable workflow management features:
N8N_API_URL: Your n8n instance URL (e.g., https://n8n.example.com)N8N_API_KEY: API key from n8n Settings → APIClaude Desktop → mcp-remote → Railway (HTTPS) → n8n-MCP Server
mcp-remote as a bridgeImportant: The n8n-MCP HTTP server is designed for single n8n instance deployment:
"Invalid URL" error in Claude Desktop:
/mcp"Unauthorized" error:
Authorization: Bearer TOKEN"Cannot connect to server":
https://Windows: "The filename, directory name, or volume label syntax is incorrect" or npx command not found:
This is a common Windows issue with spaces in Node.js installation paths. The error occurs because Claude Desktop can't properly execute npx.
Solution 1: Use node directly (Recommended)
{
"mcpServers": {
"n8n-railway": {
"command": "node",
"args": [
"C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npx-cli.js",
"-y",
"mcp-remote",
"https://your-app-name.up.railway.app/mcp",
"--header",
"Authorization: Bearer YOUR_SECURE_TOKEN_HERE"
]
}
}
}
Solution 2: Use cmd wrapper
{
"mcpServers": {
"n8n-railway": {
"command": "cmd",
"args": [
"/C",
"\"C:\\Program Files\\nodejs\\npx\" -y mcp-remote https://your-app-name.up.railway.app/mcp --header \"Authorization: Bearer YOUR_SECURE_TOKEN_HERE\""
]
}
}
}
To find your exact npx path, open Command Prompt and run: where npx
Build failures:
Environment variable issues:
Domain not working:
Railway provides metrics for:
Since the Railway template uses a specific Docker image tag, updates are manual:
You could use the latest tag, but this may cause unexpected breaking changes.
Railway deployments include enhanced security features:
AUTH_RATE_LIMIT_WINDOW and AUTH_RATE_LIMIT_MAXmoderate mode only if connecting to local n8n instanceSecurity Configuration:
# In Railway Variables tab:
WEBHOOK_SECURITY_MODE=strict # Production (recommended)
# or
WEBHOOK_SECURITY_MODE=moderate # If using local n8n with port forwarding
# Rate limiting (defaults are good for most use cases)
AUTH_RATE_LIMIT_WINDOW=900000 # 15 minutes
AUTH_RATE_LIMIT_MAX=20 # 20 attempts per IP
Once connected, you can use all n8n-MCP features from Claude Desktop:
The cloud deployment means you can access your n8n knowledge base from any computer with Claude Desktop installed!