#!/bin/bash
# Float MCP Setup Script
echo "π Setting up Float MCP Server..."
# Check if Node.js is installed
if ! command -v node &> /dev/null; then
echo "β Node.js is not installed. Please install Node.js 22.x or later."
exit 1
fi
# Check Node.js version
NODE_VERSION=$(node -v | cut -d'v' -f2 | cut -d'.' -f1)
if [ "$NODE_VERSION" -lt 22 ]; then
echo "β Node.js version 22 or later is required. Current version: $(node -v)"
exit 1
fi
echo "β Node.js $(node -v) detected"
# Install dependencies
echo "π¦ Installing dependencies..."
npm install
# Create .env file if it doesn't exist
if [ ! -f .env ]; then
echo "π Creating .env file..."
cp .env.example .env
echo "β οΈ Please edit .env and add your Float.com API key!"
else
echo "β .env file already exists"
fi
# Build the project
echo "π¨ Building project..."
npm run build
# Check if FLOAT_API_KEY is set
if grep -q "your_float_api_key_here" .env; then
echo ""
echo "β οΈ SETUP INCOMPLETE β οΈ"
echo "Please edit .env and replace 'your_float_api_key_here' with your actual Float.com API key."
echo ""
echo "To get your API key:"
echo "1. Log into Float.com"
echo "2. Go to Settings β API"
echo "3. Generate a new API key"
echo "4. Copy it to your .env file"
echo ""
echo "Then run: npm start"
else
echo ""
echo "π Setup complete!"
echo "You can now:"
echo " β’ Test the server: npm start"
echo " β’ Run in development: npm run dev"
echo " β’ Add to Claude Desktop (see README.md)"
fi
echo ""
echo "π For Claude Desktop integration instructions, see README.md"