#!/usr/bin/env node /** * Simple HTTP server starter with console output */ import express from 'express'; import cors from 'cors'; const app = express(); const port = process.env.MCP_SERVER_PORT || 3000; const host = process.env.MCP_SERVER_HOST || '0.0.0.0'; // Basic middleware app.use(cors()); app.use(express.json()); // Simple health endpoint app.get('/health', (req, res) => { res.json({ status: 'healthy', timestamp: new Date().toISOString(), server: 'Laravel Healthcare MCP Server', port: port }); }); // Simple tools endpoint app.get('/tools', (req, res) => { res.json({ message: 'Laravel Healthcare MCP Server Tools', total: 26, note: 'Use the full server for complete tool functionality' }); }); // Start server const server = app.listen(port, host, () => { const serverUrl = `http://${host === '0.0.0.0' ? 'localhost' : host}:${port}`; // Startup banner console.log('\n' + '='.repeat(60)); console.log('šŸš€ LARAVEL HEALTHCARE MCP SERVER - HTTP MODE'); console.log('='.repeat(60)); console.log(`šŸ“” Server URL: ${serverUrl}`); console.log(`🌐 Host: ${host}`); console.log(`šŸ”Œ Port: ${port}`); console.log('='.repeat(60)); console.log('šŸ“‹ Available Endpoints:'); console.log(` • Health Check: ${serverUrl}/health`); console.log(` • Tools List: ${serverUrl}/tools`); console.log('='.repeat(60)); console.log('šŸ“Š Server Status: READY'); console.log(`ā° Started at: ${new Date().toLocaleString()}`); console.log('='.repeat(60)); console.log('šŸ’” Press Ctrl+C to stop the server'); console.log(''); }); // Graceful shutdown process.on('SIGINT', () => { console.log('\nšŸ›‘ Shutting down HTTP server...'); server.close(() => { console.log('āœ… HTTP server stopped'); process.exit(0); }); }); process.on('SIGTERM', () => { console.log('\nšŸ›‘ Shutting down HTTP server...'); server.close(() => { console.log('āœ… HTTP server stopped'); process.exit(0); }); });