#!/usr/bin/env node
import { fileURLToPath } from "url";
import { dirname, join } from "path";
import { spawn } from "child_process";
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
const serverPath = join(__dirname, "..", "index.js");
console.log("Iniciando servidor MCP TabNews...");
const serverProcess = spawn("node", [serverPath], {
stdio: "inherit",
});
serverProcess.on("error", (error) => {
console.error("Erro ao iniciar o servidor:", error);
process.exit(1);
});
process.on("SIGINT", () => {
console.log("\nEncerrando servidor...");
serverProcess.kill();
process.exit();
});
process.on("SIGTERM", () => {
console.log("\nEncerrando servidor...");
serverProcess.kill();
process.exit();
});