#!/bin/bash set -e # Setup script for Ross Ultrix MCP Server development echo "Setting up Ross Ultrix MCP Server development environment..." # Check if Node.js is installed if ! command -v node &> /dev/null; then echo "Error: Node.js is not installed. Please install Node.js 18+ and try again." exit 1 fi # Check Node.js version NODE_VERSION=$(node --version | cut -d'v' -f2 | cut -d'.' -f1) if [ "$NODE_VERSION" -lt "18" ]; then echo "Error: Node.js version 18 or higher is required. Current version: $(node --version)" exit 1 fi echo "✓ Node.js version $(node --version) detected" # Install dependencies echo "Installing npm dependencies..." npm install echo "✓ Dependencies installed" # Build TypeScript echo "Building TypeScript..." npm run build echo "✓ TypeScript compiled successfully" # Create necessary directories echo "Creating directories..." mkdir -p logs mkdir -p config echo "✓ Directories created" # Copy environment file if it doesn't exist if [ ! -f ".env" ]; then echo "Creating .env file from example..." cp .env.example .env echo "✓ .env file created. Please edit it with your Ross Ultrix connection details." else echo "✓ .env file already exists" fi # Check if Docker is available if command -v docker &> /dev/null; then echo "✓ Docker detected - you can use 'npm run docker:build' to build the container" else echo "⚠ Docker not detected - container operations will not be available" fi echo "" echo "Setup complete! Next steps:" echo "1. Edit .env file with your Ross Ultrix connection details" echo "2. Run 'npm run dev' to start development server" echo "3. Or run 'npm run docker:build && npm run docker:run' to test with Docker" echo ""