@echo off REM Monta Partner API MCP Server Launcher for Claude Desktop (Windows) REM This script can be copied anywhere and runs standalone without requiring the source code REM Enable delayed expansion for variables setlocal enabledelayedexpansion REM Check for Node.js where node >nul 2>nul if %errorlevel% neq 0 ( echo [ERROR] Node.js is not installed. echo Please install Node.js 18+ from https://nodejs.org/ exit /b 1 ) REM Check Node version for /f "tokens=1" %%i in ('node -v') do set NODE_VERSION=%%i set NODE_VERSION=%NODE_VERSION:v=% for /f "tokens=1 delims=." %%i in ("%NODE_VERSION%") do set NODE_MAJOR=%%i if %NODE_MAJOR% LSS 18 ( echo [ERROR] Node.js 18+ required - you have %NODE_VERSION% exit /b 1 ) REM Check authentication if "%MONTA_CLIENT_ID%"=="" if "%MONTA_BEARER_TOKEN%"=="" ( echo [ERROR] No authentication configured. echo Please set in Claude Desktop config: echo - MONTA_CLIENT_ID and MONTA_CLIENT_SECRET, or echo - MONTA_BEARER_TOKEN exit /b 1 ) echo [INFO] Starting Monta Partner API MCP server... REM Get the directory where this script is located cd /d "%~dp0" REM Download the MCP adapter bundle set ADAPTER_FILE=monta-mcp-adapter.js set ADAPTER_URL=https://partner-api-mcp.monta.app/mcp/bundle.js REM Check if file exists if exist "%ADAPTER_FILE%" ( REM Check file age (simplified - always update if older than today) echo [INFO] Checking for updates... curl -s -o "%ADAPTER_FILE%.tmp" "%ADAPTER_URL%" if %errorlevel% equ 0 ( move /y "%ADAPTER_FILE%.tmp" "%ADAPTER_FILE%" >nul ) else ( echo [WARNING] Failed to update adapter, using cached version del "%ADAPTER_FILE%.tmp" >nul 2>&1 ) ) else ( echo [INFO] Downloading MCP adapter... curl -s -o "%ADAPTER_FILE%" "%ADAPTER_URL%" if %errorlevel% neq 0 ( echo [ERROR] Failed to download MCP adapter exit /b 1 ) ) REM Run the adapter node "%ADAPTER_FILE%"