Skip to main content
Glama

browser_install

Install the browser specified in the configuration to resolve errors when the browser is not found, ensuring smooth operation with the Playwright MCP server.

Instructions

Install the browser specified in the config. Call this if you get an error about the browser not being installed.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for the 'browser_install' tool. It installs the browser (default 'chrome') specified in the config by forking the Playwright CLI 'install' command, streams output, awaits completion, and sets tabs on response.
    handle: async (context, params, response) => { const channel = context.config.browser?.launchOptions?.channel ?? context.config.browser?.browserName ?? 'chrome'; const cliUrl = import.meta.resolve('playwright/package.json'); const cliPath = path.join(fileURLToPath(cliUrl), '..', 'cli.js'); const child = fork(cliPath, ['install', channel], { stdio: 'pipe', }); const output: string[] = []; child.stdout?.on('data', data => output.push(data.toString())); child.stderr?.on('data', data => output.push(data.toString())); await new Promise<void>((resolve, reject) => { child.on('close', code => { if (code === 0) resolve(); else reject(new Error(`Failed to install browser: ${output.join('')}`)); }); }); response.setIncludeTabs(); },
  • Schema for the 'browser_install' tool, defining its name, title, description, empty input schema (no parameters), and marking it as destructive.
    schema: { name: 'browser_install', title: 'Install the browser specified in the config', description: 'Install the browser specified in the config. Call this if you get an error about the browser not being installed.', inputSchema: z.object({}), type: 'destructive', },
  • Exports the defined 'install' tool (which includes 'browser_install') as a default array for inclusion in the main tools list.
    export default [ install, ];
  • src/tools.ts:36-52 (registration)
    Registers all tools including the 'browser_install' from './tools/install.js' by spreading the import into the 'allTools' array, which is exported for use.
    export const allTools: Tool<any>[] = [ ...common, ...console, ...dialogs, ...evaluate, ...files, ...install, ...keyboard, ...navigate, ...network, ...mouse, ...pdf, ...screenshot, ...snapshot, ...tabs, ...wait, ];

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/maywzh/playwright-mcp'

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