browser_install
Install the required browser for accessibility scans with the MCP Accessibility Scanner. Use this tool to resolve errors when the browser is missing, ensuring uninterrupted WCAG compliance checks.
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
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/install.ts:34-53 (handler)Handler function that installs the browser by forking Playwright CLI for the specified channel and handles output/errors.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(); },
- src/tools/install.ts:26-32 (schema)Schema definition for the 'browser_install' tool, with no input parameters and marked 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', },
- src/tools.ts:38-56 (registration)Registration of all tools including the 'install' module (which exports the browser_install tool) into the allTools array used by the browser server backend.export const allTools: Tool<any>[] = [ ...common, ...console, ...dialogs, ...evaluate, ...files, ...form, ...install, ...keyboard, ...navigate, ...network, ...mouse, ...pdf, ...screenshot, ...snapshot, ...tabs, ...wait, ...verify, ];