close_browser
Terminates the Chromium browser instance to free system resources on ARM64 devices after completing automation tasks or web testing workflows.
Instructions
Close the browser instance
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- index.js:1083-1109 (handler)Core implementation of the close_browser MCP tool. Closes WebSocket connection, terminates Chromium process with graceful shutdown handling, resets globals, and returns success response.async closeBrowser() { if (wsConnection) { wsConnection.close(); wsConnection = null; } if (chromiumProcess && chromiumProcess.exitCode === null) { chromiumProcess.kill('SIGTERM'); // Wait for graceful shutdown await new Promise(resolve => { chromiumProcess.on('exit', resolve); setTimeout(() => { chromiumProcess.kill('SIGKILL'); resolve(); }, 5000); }); chromiumProcess = null; } currentTabId = null; return { content: [{ type: 'text', text: 'Browser closed successfully' }], }; }
- index.js:336-342 (registration)Registers the close_browser tool in the ListTools response, including its name, description, and empty input schema.name: 'close_browser', description: 'Close the browser instance', inputSchema: { type: 'object', properties: {}, }, },
- index-browser-only.js:395-411 (handler)Implementation of close_browser in the browser-only MCP server variant. Closes connection and process, resets state.async closeBrowser() { if (wsConnection) { wsConnection.close(); wsConnection = null; } if (chromiumProcess) { chromiumProcess.kill('SIGTERM'); chromiumProcess = null; } currentTabId = null; return { content: [{ type: 'text', text: 'Browser closed successfully' }], }; }
- index-browser-only.js:162-169 (registration)Tool registration for close_browser in the browser-only server, with schema definition.{ name: 'close_browser', description: 'Close the browser instance', inputSchema: { type: 'object', properties: {}, }, },