#!/bin/bash
# Script to start the MCP server with HTTPS and Cloudflare tunnel for development
echo "🚀 Starting Umbrella MCP Server with HTTPS (Development Mode)"
echo "============================================================"
# Check if cloudflared is installed
if ! command -v cloudflared &> /dev/null; then
echo "❌ Error: cloudflared is not installed"
echo "Please install it first: brew install cloudflared"
exit 1
fi
# Update config to use HTTPS transport and enable tunnel
echo "📝 Updating configuration for HTTPS mode..."
node -e "
const fs = require('fs');
const config = JSON.parse(fs.readFileSync('config.json', 'utf8'));
config.server.transport = 'https';
config.server.debug = true;
config.server.production = false;
config.cloudflare.enabled = true;
fs.writeFileSync('config.json', JSON.stringify(config, null, 2));
console.log('✅ Configuration updated');
"
# Build the project
echo "🔨 Building TypeScript..."
npm run build
# Start the server
echo "🌐 Starting HTTPS server with OAuth..."
npm run start:https