close_browser
Terminate the current browser instance in MCP Browser Server to manage resources effectively and end automated web interactions.
Instructions
Close the current browser instance
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:654-679 (handler)The handler case for 'close_browser' tool that closes the current browser instance if it exists, nullifies the global browser/context/page variables, and returns an appropriate success or informational message.case 'close_browser': { if (currentBrowser) { await currentBrowser.close(); currentBrowser = null; currentContext = null; currentPage = null; return { content: [ { type: 'text', text: 'Browser closed successfully' } ] }; } else { return { content: [ { type: 'text', text: 'No browser instance to close' } ] }; } }
- src/index.ts:323-329 (registration)Registration of the 'close_browser' tool in the ListTools response, including its name, description, and empty input schema (no parameters required).name: 'close_browser', description: 'Close the current browser instance', inputSchema: { type: 'object', properties: {} } },