Install
$ agentstack add mcp-tysoncung-n8n-mcp-demo ✓ scanned · ✓ verified — works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ● Network access Used
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ● Environment & secrets Used
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
About
n8n-MCP Integration Demo
> A cross-platform demonstration of n8n workflow automation integrated with Model Context Protocol (MCP) using Docker containerization.
[](https://www.docker.com/) [](https://n8n.io/) [](https://www.python.org/) [](https://fastapi.tiangolo.com/) [](LICENSE) [](https://github.com/tysoncung/n8n-mcp-demo/stargazers) [](https://github.com/tysoncung/n8n-mcp-demo/network/members) [](https://github.com/tysoncung/n8n-mcp-demo/issues) [](https://github.com/tysoncung/n8n-mcp-demo/commits/master) [](https://docs.docker.com/compose/) [](http://makeapullrequest.com) [](https://github.com/tysoncung/n8n-mcp-demo/graphs/commit-activity)
📋 Overview
This repository contains a complete, production-ready demonstration of integrating n8n (workflow automation platform) with MCP (Model Context Protocol). The entire stack runs in Docker containers, ensuring consistent behavior across Windows and macOS environments.
Key Features
- ✅ Cross-platform compatibility - Identical behavior on Windows and Mac
- ✅ Containerized deployment - Zero dependency installation required
- ✅ Pre-configured workflow - Ready-to-use n8n-MCP integration example
- ✅ Simulated MCP server - Demonstrates protocol integration patterns
- ✅ Production-ready architecture - Following infrastructure best practices
- ✅ Comprehensive documentation - Setup, troubleshooting, and architecture guides
🏗️ Architecture
┌─────────────────────────────────────────────────────────────┐
│ Docker Network │
│ │
│ ┌──────────────┐ ┌──────────────────┐ │
│ │ │ │ │ │
│ │ n8n │◄──────HTTP────────►│ MCP Server │ │
│ │ (Port 5678)│ │ (Port 8080) │ │
│ │ │ │ │ │
│ └──────┬───────┘ └──────────────────┘ │
│ │ │
│ │ │
└─────────┼───────────────────────────────────────────────────┘
│
│ Webhook
▼
External Client
(curl, Postman, etc.)
Components
- n8n Container: Workflow automation engine with pre-loaded MCP integration workflow
- MCP Server Container: FastAPI-based simulation of Model Context Protocol endpoints
- Docker Network: Private network enabling secure inter-container communication
- Persistent Volume: Stores n8n data, workflows, and configuration
🚀 Quick Start
Prerequisites
- Docker Desktop 20.10+ (Windows | Mac)
- Git for cloning the repository
- 8GB RAM minimum (16GB recommended)
- Ports available: 5678 (n8n), 8080 (MCP server)
Installation
- Clone the repository
``bash git clone https://github.com/yourusername/n8n-mcp-demo.git cd n8n-mcp-demo ``
- Configure environment
``bash cp .env.example .env # Edit .env to customize credentials (optional) ``
- Start the stack
``bash docker-compose up -d ``
- Verify services
``bash docker-compose ps # Both containers should show "Up" status ``
- Access n8n and create owner account
- Open browser to http://localhost:5678
- On first run, create an owner account with:
- Email: your-email@example.com
- First/Last name: Your Name
- Password: (choose a secure password)
- Login with your created credentials
📖 Usage
Testing the MCP Integration
- Import the workflow
- In n8n UI, click "Workflows" in left sidebar
- Click "+" or "Add Workflow"
- Click "⋮" (three dots) menu → "Import from file"
- Select
workflows/mcp-integration-demo.jsonfrom the project directory - The workflow will open in the editor
- Activate the workflow
- Click "Activate" toggle in top right (should turn green/blue)
- Workflow is now ready to receive webhook requests
- Test via Webhook
``bash curl -X POST http://localhost:5678/webhook/mcp-demo \ -H "Content-Type: application/json" \ -d '{ "query": "What is the current context?", "user_id": "demo-user" }' ``
- Expected Response
``json { "success": true, "context": [ { "source": "knowledge_base", "content": "This is simulated context from MCP", "relevance": 0.95 } ], "action_result": { "success": true, "message": "Action process_context executed successfully" }, "timestamp": "2025-10-23T..." } ``
Workflow Components
The demo workflow demonstrates:
- Webhook Trigger - Receives HTTP POST requests
- MCP Context Request - Fetches context from MCP server
- Context Validation - Checks if valid context was returned
- Action Execution - Processes context via MCP
- Response Formatting - Returns structured JSON response
🔧 Configuration
Environment Variables
| Variable | Default | Description | |----------|---------|-------------| | N8N_BASIC_AUTH_USER | admin | n8n login username | | N8N_BASIC_AUTH_PASSWORD | admin | n8n login password | | N8N_HOST | localhost | n8n host address | | MCP_SERVER_URL | http://mcp-server:8080 | MCP server endpoint | | MCP_API_KEY | demo-key | API key for MCP authentication | | GENERIC_TIMEZONE | America/New_York | Timezone for n8n |
Customizing the MCP Server
The MCP server is a simple FastAPI application embedded in the docker-compose.yml. To customize:
- Edit the Python code in
docker-compose.ymlundermcp-serverservice - Restart the containers:
docker-compose restart mcp-server
Supported endpoints:
GET /health- Health checkPOST /api/context- Retrieve context for a queryPOST /api/execute- Execute an action with parameters
🛠️ Troubleshooting
Common Issues
Containers won't start
# Check port conflicts
docker-compose down
lsof -i :5678 # Mac
netstat -an | findstr 5678 # Windows
# Remove conflicting containers
docker-compose down -v
docker-compose up -d
n8n shows "unauthorized"
- Verify credentials in
.envfile - Restart containers after changing
.env:
``bash docker-compose restart ``
MCP server connection fails
# Check MCP server logs
docker logs mcp-server-demo
# Test MCP server directly
curl http://localhost:8080/health
Workflow won't activate
- Ensure both containers are running
- Check n8n logs:
docker logs n8n-mcp-demo - Verify MCPSERVERURL uses container name (
mcp-server), notlocalhost
Platform-Specific Notes
Windows (WSL2)
- Ensure WSL2 is enabled and Docker Desktop uses WSL2 backend
- File paths in docker-compose use Unix-style slashes
- Run commands in PowerShell or WSL2 terminal
macOS
- Docker Desktop must be running before
docker-compose up - For M1/M2 Macs, containers use ARM64 architecture (fully supported)
📊 Performance & Scaling
Resource Usage
- n8n container: ~200MB RAM, <5% CPU (idle)
- MCP server: ~100MB RAM, <2% CPU (idle)
- Total disk: ~500MB (including Docker images)
Scaling Recommendations
For production use:
- Replace simulated MCP server with actual MCP implementation
- Add reverse proxy (Nginx/Traefik) for HTTPS
- Configure external database (PostgreSQL) for n8n
- Implement proper secret management (HashiCorp Vault, AWS Secrets Manager)
- Add monitoring (Prometheus + Grafana)
📁 Project Structure
n8n-mcp-demo/
├── .github/
│ └── workflows/ # CI/CD pipelines (optional)
├── config/ # n8n configuration files
├── docs/
│ ├── ARCHITECTURE.md # Detailed architecture documentation
│ ├── PRESENTATION.md # Technical presentation slides
│ └── TROUBLESHOOTING.md # Extended troubleshooting guide
├── workflows/
│ └── mcp-integration-demo.json # Pre-configured workflow
├── .env.example # Environment template
├── .gitignore # Git ignore rules
├── docker-compose.yml # Docker orchestration config
├── LICENSE # MIT License
└── README.md # This file
🔒 Security Considerations
- ⚠️ Change default credentials before production deployment
- ⚠️ Use HTTPS in production (not HTTP)
- ⚠️ Rotate API keys regularly
- ⚠️ Network isolation - MCP server not exposed to public internet
- ⚠️ Volume permissions - Ensure proper file ownership in Docker volumes
🤝 Contributing
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit changes (
git commit -m 'Add amazing feature') - Push to branch (
git push origin feature/amazing-feature) - Open a Pull Request
📄 License
This project is licensed under the MIT License - see [LICENSE](LICENSE) file for details.
🙏 Acknowledgments
- n8n - Workflow automation platform
- FastAPI - MCP server framework
- Docker - Containerization platform
📞 Support
- Documentation: See
/docsfolder - Issues: GitHub Issues
- Discussions: GitHub Discussions
Built with ❤️ for Platform Engineers
Source & license
This open-source MCP server is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: tysoncung
- Source: tysoncung/n8n-mcp-demo
- License: MIT
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet — be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.