Skip to main content
Glama

OpenBrowser

Open a web browser to a specific URL, enabling users to access web pages directly from the RushDB MCP server for data visualization or external resource integration.

Instructions

Open a web browser to a specific URL

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesThe URL to open

Implementation Reference

  • Core handler function that validates the input URL (only http/https), uses platform-specific commands (open/start/xdg-open) via execFile for security, and returns success status with message.
    export async function OpenBrowser(params: { url: string }) { const { url } = params; // Validate URL to prevent command injection let validatedUrl: string; try { // Validate URL format const parsedUrl = new URL(url); // Only allow http and https protocols if (!['http:', 'https:'].includes(parsedUrl.protocol)) { return { success: false, message: "Invalid URL protocol. Only http and https are supported.", }; } validatedUrl = parsedUrl.toString(); } catch (e) { return { success: false, message: `Invalid URL format: ${e instanceof Error ? e.message : String(e)}`, }; } // Determine the command based on platform const command = platform() === "darwin" ? "open" : platform() === "win32" ? "start" : "xdg-open"; return new Promise<{ success: boolean; message: string }>( (resolve) => { // Use execFile instead of exec to prevent command injection execFile(command, [validatedUrl], (error) => { if (error) { resolve({ success: false, message: `Failed to open browser: ${error.message}`, }); } else { resolve({ success: true, message: `Successfully opened ${validatedUrl} in default browser`, }); } }); } ); }
  • Tool metadata including name, description, and input schema definition for MCP tool listing and validation.
    { name: 'OpenBrowser', description: 'Open a web browser to a specific URL', inputSchema: { type: 'object', properties: { url: { type: 'string', description: 'The URL to open' } }, required: ['url'] } },
  • index.ts:318-329 (registration)
    Dispatcher registration in the MCP CallToolRequest handler switch statement that invokes the OpenBrowser handler and formats the response as MCP content.
    case 'OpenBrowser': const openBrowserResult = await OpenBrowser({ url: args.url as string }) return { content: [ { type: 'text', text: openBrowserResult.message } ] }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/1pxone/RushDB'

If you have feedback or need assistance with the MCP directory API, please join our Discord server