#!/usr/bin/env node
import dotenv from 'dotenv';
import { UmbrellaMcpServer } from './server.js';
// Load environment variables
dotenv.config();
async function main() {
const baseURL = process.env.UMBRELLA_API_BASE_URL || 'https://api.umbrellacost.io/api';
try {
const server = new UmbrellaMcpServer(baseURL);
await server.run();
} catch (error) {
console.error('Failed to start Umbrella MCP Server:', error);
process.exit(1);
}
}
// Handle process termination gracefully
process.on('SIGINT', () => {
console.error('\n👋 Umbrella MCP Server shutting down...');
process.exit(0);
});
process.on('SIGTERM', () => {
console.error('\n👋 Umbrella MCP Server shutting down...');
process.exit(0);
});
main().catch((error) => {
console.error('Unhandled error:', error);
process.exit(1);
});