Skip to main content
Glama
mcp-browser-parallel

mcp-browser-parallel

by Mokecy

mcp-browser-parallel

多实例并行浏览器 MCP Server — 在单个 Chrome 进程中管理多个隔离的浏览器实例,支持 Cookie 自动克隆。

核心特性

  • 多实例隔离:每个实例拥有独立的 BrowserContext(cookies、storage、缓存完全隔离)

  • 零登录克隆:从用户已登录的 Chrome 自动提取 auth,新实例自动继承登录状态

  • 并行友好:所有操作通过 instanceId 路由,无共享全局状态,多 AI 会话可同时操作不同实例

  • CDP 窗口管理:支持通过 CDP 协议真正最大化窗口

Related MCP server: playwright-parallel-mcp

工作原理

用户的 Chrome(已登录,端口 9222)
         │
         │ connectOverCDP
         ↓
┌─────────────────────────────────┐
│  mcp-browser-parallel Server    │
│                                 │
│  browser_connect                │
│    → 连接 Chrome                │
│    → 提取 storageState          │
│                                 │
│  instance_create("batch-1")     │
│    → 新建 BrowserContext        │
│    → 注入 cookies → 已登录!     │
│    → 导航到目标 URL             │
│                                 │
│  instance_create("batch-2")     │
│    → 又一个独立 Context          │
│    → 同样已登录!                │
│                                 │
│  page_snapshot("batch-1")       │  ← 操作 batch-1
│  page_click("batch-1", "e5")    │  ← 不影响 batch-2
│                                 │
│  page_snapshot("batch-2")       │  ← 操作 batch-2
│  page_click("batch-2", "e3")    │  ← 不影响 batch-1
└─────────────────────────────────┘

安装

方式一:直接使用(推荐)

无需克隆代码,直接通过 npx 使用:

{
  "mcpServers": {
    "browser-parallel": {
      "command": "npx",
      "args": ["mcp-browser-parallel@latest"]
    }
  }
}

方式二:指定 Chrome CDP 端点

{
  "mcpServers": {
    "browser-parallel": {
      "command": "npx",
      "args": [
        "mcp-browser-parallel@latest",
        "--cdp-endpoint", "http://localhost:9222"
      ]
    }
  }
}

方式三:从源码构建

git clone <repo-url>
cd mcp-browser-parallel
npm install
npm run build

使用

1. 启动 Chrome(开启远程调试)

# Windows
chrome.exe --remote-debugging-port=9222

# macOS
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --remote-debugging-port=9222

# Linux
google-chrome --remote-debugging-port=9222

2. 在 Chrome 中登录目标系统

手动在 Chrome 中打开目标系统并完成登录。

3. 使用工具

Step 1: 连接 Chrome 并提取 auth
→ browser_connect(cdpUrl="http://localhost:9222")

Step 2: 创建隔离实例(自动带登录状态)
→ instance_create(instanceId="batch-1", url="https://your-system.com/module1")
→ instance_create(instanceId="batch-2", url="https://your-system.com/module2")

Step 3: 对每个实例独立操作
→ page_snapshot(instanceId="batch-1")
→ page_click(instanceId="batch-1", ref="e5")
→ page_snapshot(instanceId="batch-2")
→ page_click(instanceId="batch-2", ref="e3")

Step 4: 完成后关闭
→ instance_close_all()

工具清单

实例管理

工具

说明

browser_connect

连接 Chrome CDP + 提取 auth

instance_create

创建隔离实例(自动克隆 auth)

instance_list

列出所有活跃实例

instance_close

关闭指定实例

instance_close_all

关闭所有实例

页面操作(所有操作通过 instanceId 路由)

工具

说明

page_navigate

导航到 URL

page_snapshot

获取可访问性快照(含 ref)

page_click

点击元素(by ref)

page_fill

填入文本(by ref)

page_type

逐字输入(触发 input 事件)

page_select_option

下拉选择

page_hover

悬停

page_press_key

按键

page_screenshot

截图

page_wait

等待文本/时间

page_evaluate

执行 JS

page_maximize

CDP 窗口最大化

与现有 MCP 对比

特性

Chrome DevTools MCP

Playwright MCP

本 MCP

多实例隔离

❌ 共享 select_page 状态

❌ 单实例

✅ 独立 Context

Auth 克隆

❌

❌

✅ storageState

并行安全

❌ 会话间冲突

❌ 会话间冲突

✅ instanceId 路由

窗口最大化

❌

✅ browser_run_code

✅ 内置 CDP

快照 + Ref

✅ uid

✅ ref

✅ ref

Available Tools

36 tools
browser_connectA

Connect to an existing Chrome browser via CDP and extract auth cookies. Chrome must be running with --remote-debugging-port. This also extracts cookies/storage so new instances can be created without re-login.

Inputs: cdpUrl, pageIndex.

instance_closeB

Close a specific browser instance and release its resources.

Inputs: instanceId (required).

instance_close_allA

Close all browser instances.

Inputs: no named parameters.

instance_createA

Create a new isolated browser instance. Auth (cookies/localStorage) is automatically cloned from the connected Chrome, so no re-login is needed. Each instance has fully isolated state.

Inputs: instanceId (required), url, cloneAuth.

instance_listA

List all active browser instances with their current URLs and titles.

Inputs: no named parameters.

page_clickB

Click an element identified by ref from the latest page_snapshot.

Inputs: ref (required), instanceId (required), button, modifiers, +1 more.

page_console_messagesC

Return all console messages captured from the page.

Inputs: instanceId (required), level.

page_dragB

Drag an element and drop it onto another element.

Inputs: endRef (required), startRef (required), instanceId (required).

page_evaluateB

Evaluate a JavaScript expression in the page context. Returns JSON-serializable result.

Inputs: expression (required), instanceId (required).

page_file_uploadB

Upload one or multiple files via a file input element.

Inputs: ref (required), paths (required), instanceId (required).

page_fillB

Clear and fill text into an input element identified by ref.

Inputs: ref (required), value (required), instanceId (required).

page_fill_formC

Fill multiple form fields at once.

Inputs: fields (required), instanceId (required).

page_generate_locatorB

Generate a Playwright locator string for the given element, useful for test code generation.

Inputs: ref (required), instanceId (required).

page_handle_dialogA

Handle a browser dialog (alert, confirm, prompt). Must be called when a dialog is open.

Inputs: accept (required), instanceId (required), promptText.

page_hoverC

Hover over an element.

Inputs: ref (required), instanceId (required).

page_maximizeB

Maximize the browser window for an instance via CDP protocol.

Inputs: instanceId (required).

page_mouse_click_xyB

Click at specific coordinates on the page.

Inputs: x (required), y (required), instanceId (required), button.

page_mouse_drag_xyB

Drag from one point to another using coordinates.

Inputs: endX (required), endY (required), startX (required), startY (required), +1 more.

page_mouse_move_xyC

Move the mouse to specific coordinates.

Inputs: x (required), y (required), instanceId (required).

page_network_requestsA

Return all network requests since the page was loaded.

Inputs: instanceId (required), includeStatic.

page_pdf_saveC

Save the page as a PDF file.

Inputs: filePath (required), instanceId (required).

page_press_keyC

Press a key or key combination (e.g. "Enter", "Control+a", "Escape").

Inputs: key (required), instanceId (required).

page_resizeB

Resize the browser viewport for an instance.

Inputs: width (required), height (required), instanceId (required).

page_run_codeB

Run a Playwright code snippet against the instance page. For advanced use cases.

Inputs: code (required), instanceId (required).

page_screenshotC

Take a screenshot of the page or a specific element.

Inputs: filePath (required), instanceId (required), ref, fullPage.

page_select_optionB

Select option(s) in a element.

Inputs: ref (required), values (required), instanceId (required).

page_snapshotA

Take an accessibility snapshot of the page. Returns a structured text representation with refs for interactive elements. Always use this before performing actions to understand the current page state.

Inputs: instanceId (required).

page_start_tracingC

Start a Playwright trace recording for debugging.

Inputs: instanceId (required).

page_stop_tracingB

Stop the trace recording and save to file.

Inputs: filePath (required), instanceId (required).

page_typeA

Type text into editable element. By default fills at once; set slowly=true to type character by character.

Inputs: ref (required), text (required), instanceId (required), slowly, +1 more.

page_verify_element_visibleB

Verify that an element with a specific role and name is visible.

Inputs: role (required), instanceId (required), accessibleName.

page_verify_text_visibleB

Verify that text is visible on the page.

Inputs: text (required), instanceId (required).

page_verify_valueC

Verify the value of a form element.

Inputs: ref (required), value (required), instanceId (required).

page_waitC

Wait for text to appear, disappear, or a specified time.

Inputs: instanceId (required), text, time, timeout, +1 more.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.4/5.0

    Scored across 36 tools

    Disambiguation5/5

    Each tool has a clear, distinct purpose. Even similar actions like click vs mouse_click_xy are differentiated by targeting element vs coordinates. Fill, fill_form, and type are distinct in scope and behavior.

    Naming Consistency5/5

    All tools follow a consistent category_verb pattern in snake_case. Prefixes like browser_, instance_, page_ clearly indicate the scope. Multi-word verbs are used consistently.

    Tool Count3/5

    With 36 tools, the set is larger than typical recommendations (25+). However, the browser automation domain inherently requires many distinct actions. The count is borderline but justified by the comprehensive coverage.

    Completeness5/5

    The tool set covers the full lifecycle of browser interactions: connection, instance management, navigation, all major user actions, state inspection (snapshot, console, network), debugging (tracing), and output (screenshot, PDF). No obvious gaps.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers