#!/usr/bin/env node /** * Coolify MCP Server - SSE Transport. * * Entry point for running the MCP server with SSE transport. * This is useful for web integrations and testing. * * @module */ import { createServer } from "node:http"; const PORT = process.env.PORT || 3000; const httpServer = createServer((req, res) => { // Set CORS headers res.setHeader("Access-Control-Allow-Origin", "*"); res.setHeader("Access-Control-Allow-Methods", "GET, POST, OPTIONS"); res.setHeader("Access-Control-Allow-Headers", "Content-Type"); if (req.method === "OPTIONS") { res.writeHead(200); res.end(); return; } // Health check endpoint if (req.url === "/health") { res.writeHead(200, { "Content-Type": "application/json" }); res.end(JSON.stringify({ status: "healthy", server: "coolify-mcp" })); return; } // SSE endpoint - Note: This is a placeholder for future SSE support if (req.url === "/sse") { res.writeHead(200, { "Content-Type": "application/json" }); res.end( JSON.stringify({ message: "SSE not yet implemented. Use stdio transport.", }), ); return; } // 404 res.writeHead(404, { "Content-Type": "application/json" }); res.end(JSON.stringify({ error: "Not found" })); }); httpServer.listen(PORT, () => { console.warn( `Coolify MCP Server (SSE placeholder) listening on port ${PORT}`, ); console.warn(`Health check: http://localhost:${PORT}/health`); console.warn( `Note: SSE transport not yet implemented. Use stdio for Claude Desktop.`, ); });