Skip to main content
Glama
Rainmen-xia

Chrome Debug MCP Server

by Rainmen-xia

close_browser

Shuts down active browser connections managed by the Chrome Debug MCP Server, ensuring clean termination of automation sessions.

Instructions

关闭浏览器连接

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler function for closing the browser connection. It disconnects or closes the browser instance if it exists and resets the session state.
    async closeBrowser(): Promise<BrowserActionResult> { if (this.browser || this.page) { console.log("关闭浏览器连接..."); if (this.isUsingRemoteBrowser && this.browser) { await this.browser.disconnect().catch(() => {}); } else { await this.browser?.close().catch(() => {}); } this.resetBrowserState(); } return { success: true }; }
  • The tool schema definition in the list of tools, including name, description, and empty input schema (no parameters required).
    { name: "close_browser", description: "关闭浏览器连接", inputSchema: { type: "object", properties: {}, }, },
  • src/index.ts:178-180 (registration)
    Registration in the CallToolRequestSchema handler switch statement that dispatches to the browserSession.closeBrowser() method.
    case "close_browser": result = await this.browserSession.closeBrowser(); break;
  • Helper method called by closeBrowser to reset all browser-related state variables.
    private resetBrowserState(): void { this.browser = undefined; this.page = undefined; this.currentMousePosition = undefined; this.isUsingRemoteBrowser = false; }

Other Tools

Related Tools

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/Rainmen-xia/chrome-debug-mcp'

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