close_browser
Terminate the active browser instance on the chromium-arm64 MCP server, ensuring clean shutdown during browser automation 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 handler for close_browser tool in the full Chromium MCP server. Closes WebSocket connection, gracefully terminates the Chromium process (with SIGTERM then SIGKILL timeout), resets globals, and returns success message.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-browser-only.js:395-411 (handler)Core handler for close_browser tool in the browser-only MCP server. Closes WebSocket and kills Chromium process with SIGTERM, resets globals, returns success.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.js:336-342 (registration)Tool registration in ListToolsResponse for the full server, defining name, description, and empty input schema.name: 'close_browser', description: 'Close the browser instance', inputSchema: { type: 'object', properties: {}, }, },
- index-browser-only.js:163-169 (registration)Tool registration in ListToolsResponse for the browser-only server, defining name, description, and empty input schema.name: 'close_browser', description: 'Close the browser instance', inputSchema: { type: 'object', properties: {}, }, },
- chromium_tool.py:115-122 (helper)Python client helper method that invokes the close_browser MCP tool via subprocess call to the JS server.def close_browser(self) -> str: """Close the browser instance.""" result = self._call_mcp_server("close_browser", {}) if "error" in result: return f"Error: {result['error']}" content = result.get("content", [{}]) return content[0].get("text", "Browser closed")