Skip to main content
Glama
Rainmen-xia

Chrome Debug MCP Server

by Rainmen-xia

launch_browser

Start a browser connection to Chrome debugging ports for browser automation with persistent login sessions.

Instructions

启动浏览器连接,连接到Chrome调试端口以保持登录状态

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
remote_hostNo可选的远程Chrome主机URL (例如: http://localhost:9222)

Implementation Reference

  • Core handler function that establishes connection to Chrome debugging port using provided remote host or automatic discovery.
    async launchBrowser(remoteBrowserHost?: string): Promise<BrowserActionResult> {
    	console.log("启动浏览器连接");
    
    	if (this.browser) {
    		await this.closeBrowser();
    	}
    
    	const remoteConnected = await this.connectToRemoteBrowser(remoteBrowserHost);
    
    	if (!remoteConnected) {
    		return {
    			success: false,
    			error: "无法连接到Chrome调试端口。请确保Chrome以 --remote-debugging-port=9222 参数启动"
    		};
    	}
    
    	return { success: true };
    }
  • Input schema definition for the launch_browser tool, including optional remote_host parameter.
    	name: "launch_browser",
    	description: "启动浏览器连接,连接到Chrome调试端口以保持登录状态",
    	inputSchema: {
    		type: "object",
    		properties: {
    			remote_host: {
    				type: "string",
    				description: "可选的远程Chrome主机URL (例如: http://localhost:9222)",
    			},
    		},
    	},
    },
  • src/index.ts:47-59 (registration)
    Registration of the launch_browser tool in the ListToolsRequestSchema handler.
    {
    	name: "launch_browser",
    	description: "启动浏览器连接,连接到Chrome调试端口以保持登录状态",
    	inputSchema: {
    		type: "object",
    		properties: {
    			remote_host: {
    				type: "string",
    				description: "可选的远程Chrome主机URL (例如: http://localhost:9222)",
    			},
    		},
    	},
    },
  • MCP CallToolRequestSchema dispatch handler that invokes the browserSession.launchBrowser method.
    case "launch_browser":
    	result = await this.browserSession.launchBrowser(args?.remote_host as string);
    	break;
  • Output schema/interface for browser action results, used by launchBrowser.
    export interface BrowserActionResult {
    	screenshot?: string;
    	logs?: string;
    	currentUrl?: string;
    	currentMousePosition?: string;
    	success?: boolean;
    	error?: string;
    }

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