Skip to main content
Glama

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
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • 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' }], }; }
  • 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: {}, }, },
  • 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: {}, }, },
  • 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")

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/nfodor/claude-arm64-browser'

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