- Add Railway-specific Docker image build to CI/CD workflow - Builds n8n-mcp-railway image alongside standard image - Railway image optimized for AMD64 architecture - Automatically published to ghcr.io on main branch pushes - Create comprehensive Railway deployment documentation - Step-by-step deployment guide with security best practices - Claude Desktop connection instructions via mcp-remote - Troubleshooting guide for common issues - Architecture details and single-instance design explanation - Update README with Railway documentation link - Removed inline Railway content to keep README focused - Added link to dedicated Railway deployment guide This enables zero-configuration cloud deployment of n8n-mcp with automatic HTTPS, global access, and built-in monitoring. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
7.6 KiB
Railway Deployment Guide for n8n-MCP
Deploy n8n-MCP to Railway's cloud platform with zero configuration and connect it to Claude Desktop from anywhere.
🚀 Quick Deploy
Deploy n8n-MCP with one click:
📋 Overview
Railway deployment provides:
- ☁️ 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
🎯 Step-by-Step Deployment
1. Deploy to Railway
- Click the Deploy button above
- Sign in to Railway (or create 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
IMPORTANT: The deployment includes a default AUTH_TOKEN for instant functionality, but you MUST change it:
- Go to your Railway dashboard
- Click on your n8n-mcp service
- Navigate to "Variables" tab
- Find
AUTH_TOKEN - Replace with secure token:
# Generate secure token locally: openssl rand -base64 32 - Railway will automatically redeploy with the new token
⚠️ Security Warning: 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", you'll see your URL:
https://your-app-name.up.railway.app - Copy this URL for Claude Desktop configuration
4. Connect Claude Desktop
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:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json - Linux:
~/.config/Claude/claude_desktop_config.json
Restart Claude Desktop after saving the configuration.
🔧 Environment Variables
Default Variables (Pre-configured)
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 |
USE_FIXED_HTTP |
true |
Stable HTTP implementation |
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 |
Optional: n8n API Integration
To enable workflow management features:
- Go to Railway dashboard → Your service → Variables
- Add these 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 Details
How It Works
Claude Desktop → mcp-remote → Railway (HTTPS) → n8n-MCP Server
- 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
Important: The n8n-MCP HTTP server is designed for single n8n instance deployment:
- n8n API credentials are configured server-side via environment variables
- All clients connecting to the server share the same n8n instance
- For multi-tenant usage, deploy separate Railway instances
Security Model
- Bearer Token Authentication: All requests require the AUTH_TOKEN
- HTTPS by Default: Railway provides SSL certificates
- Environment Isolation: Each deployment is isolated
- No State Storage: Server is stateless (database is read-only)
🚨 Troubleshooting
Connection Issues
"Invalid URL" error in Claude Desktop:
- Ensure you're using the exact configuration format shown above
- Don't add "connect" or other arguments before the URL
- The URL should end with
/mcp
"Unauthorized" error:
- Check that your AUTH_TOKEN matches exactly (no extra spaces)
- Ensure the Authorization header format is correct:
Authorization: Bearer TOKEN
"Cannot connect to server":
- Verify your Railway deployment is running (check Railway dashboard)
- Ensure the URL is correct and includes
https:// - Check Railway logs for any errors
Railway-Specific Issues
Build failures:
- Railway uses AMD64 architecture - the template is configured for this
- Check build logs in Railway dashboard for specific errors
Environment variable issues:
- Variables are case-sensitive
- Don't include quotes in the Railway dashboard (only in JSON config)
- Railway automatically restarts when you change variables
Domain not working:
- It may take 1-2 minutes for the domain to become active
- Check the "Deployments" tab to ensure the latest deployment succeeded
📊 Monitoring & Logs
View Logs
- Go to Railway dashboard
- Click on your n8n-mcp service
- Click on "Logs" tab
- You'll see real-time logs including:
- Server startup messages
- Authentication attempts
- API requests (without sensitive data)
- Any errors or warnings
Monitor Usage
Railway provides metrics for:
- Memory usage (typically ~100-200MB)
- CPU usage (minimal when idle)
- Network traffic
- Response times
💰 Pricing & Limits
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
🔄 Updates & Maintenance
Manual 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"
Automatic Updates (Not Recommended)
You could use the latest tag, but this may cause unexpected breaking changes.
📝 Best Practices
- Always change the default AUTH_TOKEN immediately
- Use strong, unique tokens (32+ characters)
- Monitor logs for unauthorized access attempts
- Keep credentials secure - never commit them to git
- Use environment variables for all sensitive data
- Regular updates - check for new versions monthly
🆘 Getting Help
- Railway Documentation: docs.railway.app
- n8n-MCP Issues: GitHub Issues
- Railway Community: Discord
🎉 Success!
Once connected, you can use all n8n-MCP features from Claude Desktop:
- Search and explore 500+ n8n nodes
- Get node configurations and examples
- Validate workflows before deployment
- Manage n8n workflows (if API configured)
The cloud deployment means you can access your n8n knowledge base from any computer with Claude Desktop installed!