/** * Acai Code MCP Server - Entry Point * * This is the main entry point for the MCP server. * All functionality is modularized in separate files for better maintainability. */ // Load configuration first import { loadLocalConfigProfile, applyProfileToEnv } from "./config/index.js"; // Load and apply config profile (backward compatibility) const selectedProfile = loadLocalConfigProfile(); applyProfileToEnv(selectedProfile); console.error("[MCP] Server starting in SSE mode. Credentials will be provided per-session via HTTP headers."); // Import core modules import { createMcpServer, createRequestMonitor, toolHandlers } from "./server.js"; import { startHttpServer } from "./httpServer.js"; import { startMonitorServer } from "./monitor.js"; // Import registration functions import { registerPrompts } from "./prompts/index.js"; import { registerTools } from "./tools/index.js"; // Create and configure MCP server const server = createMcpServer(); // Create request monitor const requestMonitor = createRequestMonitor(server); // Register all prompts registerPrompts(server); // Register all tools registerTools(server); // Start HTTP server for SSE transport startHttpServer(server); // Start monitor server (if not disabled) startMonitorServer(requestMonitor, toolHandlers);