browser_disconnect
Release the Chrome DevTools Protocol connection after completing accessibility testing tasks, freeing up browser resources without terminating Chrome.
Instructions
Close the CDP connection to Chrome. Does NOT kill the Chrome process. Call this when you are done to release the connection.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/browserDisconnect.ts:6-26 (handler)The browserDisconnectHandler function that executes the browser_disconnect tool logic. It checks if a browser connection exists, disconnects via browserManager.disconnect(), and returns a success message or appropriate response if already disconnected.export async function browserDisconnectHandler( _args: Record<string, never> ): Promise<ReturnType<typeof toolSuccess | typeof toolError>> { try { if (!browserManager.isConnected()) { return toolSuccess({ disconnected: true, message: 'Already disconnected (no active connection).', }); } await browserManager.disconnect(); return toolSuccess({ disconnected: true, message: 'Disconnected from Chrome (browser process is still running).', }); } catch (error) { return toolError(error); } }
- src/tools/browserDisconnect.ts:4-4 (schema)The browserDisconnectSchema definition - an empty object indicating the tool requires no input parameters.export const browserDisconnectSchema = {};
- src/index.ts:48-58 (registration)Registration of the browser_disconnect tool with the MCP server, including title, description, input schema reference, and handler function reference.server.registerTool( 'browser_disconnect', { title: 'Disconnect from Chrome', description: 'Close the CDP connection to Chrome. Does NOT kill the Chrome process. ' + 'Call this when you are done to release the connection.', inputSchema: browserDisconnectSchema, }, browserDisconnectHandler );