#!/usr/bin/env node
/**
 * Basecamp MCP Server Entry Point
 */

import { BasecampServer } from './server.js';

// Configuration from environment variables
const accountId = process.env.BASECAMP_ACCOUNT_ID;
const accessToken = process.env.BASECAMP_ACCESS_TOKEN;
const userAgent = process.env.BASECAMP_USER_AGENT;

if (!accountId) {
  console.error('Error: BASECAMP_ACCOUNT_ID environment variable is required');
  process.exit(1);
}

if (!accessToken) {
  console.error('Error: BASECAMP_ACCESS_TOKEN environment variable is required');
  process.exit(1);
}

const server = new BasecampServer({
  accountId,
  accessToken,
  userAgent,
});

server.run().catch((error) => {
  console.error('Failed to start server:', error);
  process.exit(1);
});
