UNPKG

rabbit-browser

Version:

Browser automation tool for detecting interactive elements on web pages

47 lines (46 loc) 1.41 kB
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"; import { SSEServerTransport } from "@modelcontextprotocol/sdk/server/sse.js"; import { Response } from "express"; /** * Creates and configures an MCP server for RabbitBrowser */ export declare class RabbitBrowserMcpServer { private browser; private server; /** * Creates a new RabbitBrowser MCP server * @param options Options to pass to RabbitBrowser */ constructor(options?: any); /** * Register resources with the MCP server */ private registerResources; /** * Refreshes the browser state to ensure we get the latest elements and context * This will be called after any navigation or interaction */ private refreshState; /** * Register tools with the MCP server */ private registerTools; /** * Register prompts with the MCP server */ private registerPrompts; /** * Start the MCP server with stdio transport */ startWithStdio(): Promise<StdioServerTransport>; /** * Start the MCP server with SSE (Server-Sent Events) transport * @param res Express response object * @param postUrl URL for clients to post messages to */ startWithSSE(res: Response, postUrl: string): Promise<SSEServerTransport>; /** * Close the browser */ close(): Promise<void>; }