rabbit-browser
Version:
Browser automation tool for detecting interactive elements on web pages
46 lines • 1.72 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const server_1 = require("./server");
/**
* Main entry point for the RabbitBrowser MCP server CLI
*/
async function main() {
try {
// Use console.error for logging to send output to stderr instead of stdout
console.error("Starting RabbitBrowser MCP server...");
// Create the server with default options
const server = new server_1.RabbitBrowserMcpServer({
headless: true,
waitTime: 5000,
logDetails: true,
});
console.error("RabbitBrowser MCP server ready");
console.error("Capabilities:");
console.error("- Resources: webpage, elements, textblocks, pagecontext");
console.error("- Tools: navigate, click-by-text, fill-input, submit-form, get-current-url, take-screenshot");
console.error("- Prompts: analyze-webpage, fill-form");
// Start the server with stdio transport
await server.startWithStdio();
// Handle process termination
process.on("SIGINT", async () => {
console.error("Shutting down RabbitBrowser MCP server...");
await server.close();
process.exit(0);
});
process.on("SIGTERM", async () => {
console.error("Shutting down RabbitBrowser MCP server...");
await server.close();
process.exit(0);
});
}
catch (error) {
console.error("Error starting RabbitBrowser MCP server:", error);
process.exit(1);
}
}
// Run the main function
main().catch((error) => {
console.error("Unhandled error:", error);
process.exit(1);
});
//# sourceMappingURL=cli.js.map