@mseep/hyperbrowser-mcp
Version:
Hyperbrowser Model Context Protocol Server
32 lines (31 loc) • 1.03 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const dotenv_1 = require("dotenv");
(0, dotenv_1.config)();
const utils_js_1 = require("./utils.js");
const sse_js_1 = require("./transports/sse.js");
const stdio_js_1 = require("./transports/stdio.js");
const SSE_PORT = process.env.SSE_PORT || 3001;
// Start the server
async function main() {
// Check if SSE transport is requested via command line flag
const useSSE = process.argv.includes("--sse");
if (useSSE) {
await (0, sse_js_1.createSSEServer)().then((app) => app.listen(SSE_PORT, () => {
(0, utils_js_1.logWithTimestamp)({
data: `hyperbrowser MCP Server running on http://localhost:${SSE_PORT}`,
});
}));
}
else {
await (0, stdio_js_1.createStdioServer)();
}
}
main().catch((error) => {
(0, utils_js_1.logWithTimestamp)({
level: "error",
data: ["Fatal error in main():", error],
});
process.exit(1);
});