Production-ready MCP IMAP server for hosted N8N workflows. Changes: - SSE transport using create_sse_app() for N8N compatibility - API key authentication middleware for multi-tenant access - Systemd service file for auto-restart on Hetzner - Nginx reverse proxy config with TLS and rate limiting - Complete deployment guide (DEPLOY.md) - Removed REST API bridge (api_server.py) - N8N uses MCP protocol Deployment: - SSE endpoint: https://imap.maxtheweb.ai/mcp/sse - Messages endpoint: https://imap.maxtheweb.ai/mcp/messages - Authentication: Bearer token in Authorization header Stack: FastMCP 2.13 + uvicorn + nginx + systemd
26 lines
600 B
Desktop File
26 lines
600 B
Desktop File
[Unit]
|
|
Description=MCP IMAP Agent - Email automation server for N8N
|
|
After=network.target
|
|
|
|
[Service]
|
|
Type=simple
|
|
User=www-data
|
|
WorkingDirectory=/opt/mcp-imap-agent/backend
|
|
Environment="PATH=/opt/mcp-imap-agent/backend/venv/bin"
|
|
EnvironmentFile=/opt/mcp-imap-agent/backend/.env
|
|
ExecStart=/opt/mcp-imap-agent/backend/venv/bin/python src/mcp_server.py
|
|
Restart=always
|
|
RestartSec=10
|
|
StandardOutput=journal
|
|
StandardError=journal
|
|
|
|
# Security hardening
|
|
NoNewPrivileges=true
|
|
PrivateTmp=true
|
|
ProtectSystem=strict
|
|
ProtectHome=true
|
|
ReadWritePaths=/opt/mcp-imap-agent/backend
|
|
|
|
[Install]
|
|
WantedBy=multi-user.target
|