Overview
Railway provides instant cloud hosting for n8n-MCP with:- ☁️ Instant cloud hosting - No server setup required
- 🔒 Secure by default - HTTPS included, auth token warnings
- 🌐 Global access - Connect from any Claude Desktop
- ⚡ Auto-scaling - Railway handles the infrastructure
- 📊 Built-in monitoring - Logs and metrics included
One-Click Deploy
Step-by-Step Deployment
1. Deploy to Railway
- Click the “Deploy on Railway” button above
- Sign in to Railway (or create a free account)
- Configure your deployment:
- Project name (optional)
- Environment (leave as “production”)
- Region (choose closest to you)
- Click “Deploy” and wait ~2-3 minutes
2. Configure Security
- Go to your Railway dashboard
- Click on your n8n-mcp service
- Navigate to “Variables” tab
- Find
AUTH_TOKEN - Replace with a secure token:
- Railway will automatically redeploy with the new token
The server displays warnings every 5 minutes until you change the default token.
3. Get Your Service URL
- In Railway dashboard, click on your service
- Go to “Settings” tab
- Under “Domains”, copy your URL:
- Add
/mcpto the end for your MCP endpoint:
4. Connect Claude Desktop
Add to your Claude Desktop configuration:- macOS
- Windows
- Linux
Environment Variables
Pre-configured Variables
These are automatically set by the Railway template:| Variable | Default | 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) | Automatically configured |
AUTH_RATE_LIMIT_WINDOW | 900000 (15 min) | Rate limit window |
AUTH_RATE_LIMIT_MAX | 20 | Max auth attempts per IP |
WEBHOOK_SECURITY_MODE | strict | SSRF protection |
Optional Variables
For n8n MCP Client Tool Integration
SetN8N_MODE to enable n8n integration mode:
- Go to Railway dashboard → Your service → Variables
- Add variable:
N8N_MODE=true - Save changes - Railway will redeploy automatically
For n8n API Integration (Workflow Management)
Enable workflow management features:- Go to Railway dashboard → Your service → Variables
- Add variables:
N8N_API_URL: Your n8n instance URL (e.g.,https://n8n.example.com)N8N_API_KEY: API key from n8n Settings → API
- Save changes - Railway will redeploy automatically
Architecture
- Claude Desktop uses
mcp-remoteas a bridge - mcp-remote converts stdio to HTTP requests
- Railway provides HTTPS endpoint and infrastructure
- n8n-MCP runs in HTTP mode on Railway
Single-Instance Design
The n8n-MCP HTTP server is designed for single n8n instance deployment. All clients connecting to the server share the same n8n instance. For multi-tenant usage, deploy separate Railway instances.
Security Features
Rate Limiting
- Automatic brute force protection - 20 attempts per 15 minutes per IP
- Configurable limits via environment variables
- Standard rate limit headers for client awareness
SSRF Protection
- Default strict mode blocks localhost, private IPs, and cloud metadata
- Cloud metadata always blocked (169.254.169.254, metadata.google.internal, etc.)
- Use
moderatemode only if connecting to local n8n instance
Monitoring & Logs
View Logs
- Go to Railway dashboard
- Click on your n8n-mcp service
- Click on “Logs” tab
- View real-time logs including:
- Server startup messages
- Authentication attempts
- API requests (without sensitive data)
- Errors and warnings
Monitor Usage
Railway provides metrics for:- Memory usage (typically ~100-200MB)
- CPU usage (minimal when idle)
- Network traffic
- Response times
Pricing
Railway Free Tier
- $5 free credit monthly
- 500 hours of runtime
- Sufficient for personal use of n8n-MCP
Estimated Costs
- n8n-MCP typically uses: ~0.1 GB RAM
- Monthly cost: ~$2-3 for 24/7 operation
- Well within free tier for most users
Troubleshooting
Connection Issues
“Invalid URL” error in Claude Desktop:- Ensure you’re using the exact configuration format shown above
- The URL should end with
/mcp - Use full HTTPS URL
- Check that your AUTH_TOKEN matches exactly (no extra spaces)
- Ensure the Authorization header format is correct:
Authorization: Bearer TOKEN
- Verify your Railway deployment is running (check Railway dashboard)
- Ensure the URL is correct and includes
https:// - Check Railway logs for any errors
Windows: npx Command Not Found
This is a common Windows issue with spaces in Node.js installation paths. Solution 1: Use node directly (Recommended)where npx
Railway-Specific Issues
Build failures:- Railway uses AMD64 architecture - the template is configured for this
- Check build logs in Railway dashboard for specific errors
- Variables are case-sensitive
- Don’t include quotes in the Railway dashboard (only in JSON config)
- Railway automatically restarts when you change variables
Updates
Since the Railway template uses a specific Docker image tag, updates are manual:- Check for updates on GitHub
- Update image tag in Railway:
- Go to Settings → Deploy → Docker Image
- Change tag from current to new version
- Click “Redeploy”
Next Steps
Quickstart Guide
Learn how to use n8n-MCP with Claude
Docker Deployment
Deploy using Docker containers