Skip to main content
Glama
AdsPower

AdsPower LocalAPI MCP Server

Official

open-browser

Open a browser profile with custom fingerprint settings through the AdsPower LocalAPI MCP Server, enabling automated browser management and configuration.

Instructions

Open the browser, both environment and profile mean browser

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
serialNumberNoThe serial number of the browser to open
userIdNoThe browser id of the browser to open
ipTabNoThe ip tab of the browser, 0 is not use ip tab, 1 is use ip tab, default is 0
launchArgsNoThe launch args of the browser, use chrome launch args, eg: ["--blink-settings=imagesEnabled=false","--disable-notifications"], or vista url, eg: ["https://www.adspower.net"]
clearCacheAfterClosingNoThe clear cache after closing of the browser, 0 is not clear cache after closing, 1 is clear cache after closing, default is 0
cdpMaskNoThe cdp mask of the browser, 0 is not use cdp mask, 1 is use cdp mask, default is 0

Implementation Reference

  • The core handler function for the 'open-browser' tool. It constructs API parameters and makes a GET request to the local API endpoint to start/open the browser, returning connection details like ws.puppeteer or throwing an error on failure.
    async openBrowser({ serialNumber, userId, ipTab, launchArgs, clearCacheAfterClosing, cdpMask }: OpenBrowserParams) { const params = new URLSearchParams(); if (serialNumber) { params.set('serial_number', serialNumber); } if (userId) { params.set('user_id', userId); } if (ipTab) { params.set('open_tabs', ipTab); } if (launchArgs) { params.set('launch_args', launchArgs); } if (clearCacheAfterClosing) { params.set('clear_cache_after_closing', clearCacheAfterClosing); } if (cdpMask) { params.set('cdp_mask', cdpMask); } params.set('open_tabs', '0'); const response = await axios.get(`${LOCAL_API_BASE}${API_ENDPOINTS.START_BROWSER}`, { params }); if (response.data.code === 0) { return `Browser opened successfully with: ${Object.entries(response.data.data).map(([key, value]) => { if (value && typeof value === 'object') { return Object.entries(value).map(([key, value]) => `ws.${key}: ${value}`).join('\n'); } return `${key}: ${value}`; }).join('\n')}`; } throw new Error(`Failed to open browser: ${response.data.msg}`); },
  • Registers the 'open-browser' tool with the MCP server, providing name, description, input schema, and the wrapped handler function.
    server.tool('open-browser', 'Open the browser, both environment and profile mean browser', schemas.openBrowserSchema.shape, wrapHandler(browserHandlers.openBrowser));
  • Zod schema defining the input parameters for the 'open-browser' tool, including optional fields like serialNumber, userId, launchArgs, etc.
    openBrowserSchema: z.object({ serialNumber: z.string().optional().describe('The serial number of the browser to open'), userId: z.string().optional().describe('The browser id of the browser to open'), ipTab: z.enum(['0', '1']).optional().describe('The ip tab of the browser, 0 is not use ip tab, 1 is use ip tab, default is 0'), launchArgs: z.string().optional().describe(`The launch args of the browser, use chrome launch args, eg: ${JSON.stringify(["--blink-settings=imagesEnabled=false", "--disable-notifications"])}, or vista url, eg: ${JSON.stringify(["https://www.adspower.net"])}`), clearCacheAfterClosing: z.enum(['0', '1']).optional().describe('The clear cache after closing of the browser, 0 is not clear cache after closing, 1 is clear cache after closing, default is 0'), cdpMask: z.enum(['0', '1']).optional().describe('The cdp mask of the browser, 0 is not use cdp mask, 1 is use cdp mask, default is 0'), }).strict(),

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/AdsPower/local-api-mcp-typescript'

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