Logo playwright-parallel-mcp

playwright-parallel-mcp

Cộng đồng
sumyapp

MCP server for parallel browser automation with Playwright

Nhà phát hànhsumyapp
Kho mãplaywright-parallel-mcp
Ngôn ngữTypeScript
Bản fork
8
Sao
18
Công cụ có sẵn
63
Phương thức truyền tảistdio
Danh mục
Giấy phépMIT
Liên kết
  • Kết nối công cụ với quy trình làm việc AI

    playwright-parallel-mcp cung cấp các khả năng MCP mà ứng dụng khách và tác nhân AI tương thích có thể sử dụng.

  • 63 công cụ có sẵn

    Xem các thao tác có thể gọi bên dưới, kèm tên và mô tả nếu máy chủ cung cấp.

  • Cấu hình sẵn để sao chép

    Dùng các đoạn cấu hình cài đặt mẫu để thiết lập máy chủ này trong ứng dụng khách MCP bạn muốn dùng.

  • Chỉ số quan tâm đến mã nguồn mở

    18 sao và 8 bản fork từ kho mã được liên kết.

playwright-parallel-mcp

CI Coverage Status npm version

English | 日本語 | 中文

A Model Context Protocol (MCP) server that enables AI agents to control multiple independent browser instances in parallel.

The Problem

Existing browser automation MCP servers (Chrome DevTools MCP, Playwright MCP) share a single browser instance across all sessions, causing conflicts when multiple AI agents try to use them simultaneously.

The Solution

playwright-parallel-mcp creates isolated browser instances for each session by spawning independent MCP backend processes, enabling true parallel browser automation.

Architecture (v0.3.0+)

playwright-parallel-mcp uses a wrapper architecture that spawns child MCP server processes for each session:

┌─────────────────────────────────────────────────────────────────┐
│              playwright-parallel-mcp (Wrapper)                   │
│  ┌─────────────────────────────────────────────────────────┐    │
│  │  Session Manager                                         │    │
│  │  - Session lifecycle management                          │    │
│  │  - Tool routing with sessionId                           │    │
│  │  - Automatic cleanup                                     │    │
│  └─────────────────────────────────────────────────────────┘    │
└───────────────┬─────────────────────┬─────────────────────┬─────┘
                │                     │                     │
                ▼                     ▼                     ▼
    ┌───────────────────┐ ┌───────────────────┐ ┌───────────────────┐
    │  Session A        │ │  Session B        │ │  Session C        │
    │  ┌─────────────┐  │ │  ┌─────────────┐  │ │  ┌─────────────┐  │
    │  │ MCP Backend │  │ │  │ MCP Backend │  │ │  │ MCP Backend │  │
    │  │ (Child      │  │ │  │ (Child      │  │ │  │ (Child      │  │
    │  │  Process)   │  │ │  │  Process)   │  │ │  │  Process)   │  │
    │  └──────┬──────┘  │ │  └──────┬──────┘  │ │  └──────┬──────┘  │
    │         │         │ │         │         │ │         │         │
    │         ▼         │ │         ▼         │ │         ▼         │
    │  ┌─────────────┐  │ │  ┌─────────────┐  │ │  ┌─────────────┐  │
    │  │  Browser    │  │ │  │  Browser    │  │ │  │  Browser    │  │
    │  │  Instance   │  │ │  │  Instance   │  │ │  │  Instance   │  │
    │  └─────────────┘  │ │  └─────────────┘  │ │  └─────────────┘  │
    └───────────────────┘ └───────────────────┘ └───────────────────┘

Key Benefits

  • Process-Level Isolation: Each session runs in a separate OS process
  • Backend Agnostic: Works with any MCP browser automation server
  • Always Latest: Uses @latest versions, no dependency updates needed
  • Automatic Cleanup: Sessions are cleaned up on timeout or process exit

Session Isolation Guarantee

Each session is 100% isolated. This is architecturally guaranteed by process-level separation.

ResourceIsolated?How
Browser Process✅ YesSeparate OS process per session
Cookies✅ YesSeparate browser instance
localStorage✅ YesSeparate browser instance
DOM✅ YesSeparate page instance
Navigation History✅ YesSeparate page instance

Features

  • Parallel Sessions - Each session gets its own browser instance
  • Process Isolation - True isolation via separate OS processes
  • Pluggable Backends - Use Playwright MCP, Chrome DevTools MCP, or any npm package
  • Dynamic Tools - Tools are dynamically loaded from the backend
  • Low Overhead - Only 3 session management tools + backend tools
  • Free & Local - No cloud service required

Installation

With Claude Code

Add to your MCP settings:

json
{
  "mcpServers": {
    "playwright-parallel": {
      "command": "npx",
      "args": ["playwright-parallel-mcp"]
    }
  }
}

With npm

bash
npm install -g playwright-parallel-mcp
playwright-parallel-mcp

Available Tools

Session Management (3 tools)

ToolDescription
create_sessionCreate a new isolated browser session
close_sessionClose a browser session and terminate its backend process
list_sessionsList all active sessions

Backend Tools (dynamically loaded)

All tools from the backend MCP server are automatically available with an added sessionId parameter. For example, with the default Playwright backend:

ToolDescription
browser_navigateNavigate to a URL
browser_snapshotGet accessibility tree snapshot
browser_clickClick an element
browser_fillFill a form input
browser_typeType text
browser_press_keyPress keyboard key
...And many more from @playwright/mcp

Usage Examples

Basic Navigation

User: Open example.com and take a screenshot

Claude: I'll create a browser session and navigate to example.com.

[create_session] -> sessionId: "abc123"
[browser_navigate sessionId="abc123" url="https://example.com"]
[browser_screenshot sessionId="abc123"]

Parallel Sessions

User: Compare the homepage of two websites side by side

Claude: I'll create two browser sessions in parallel.

[create_session] -> sessionId: "session-a"
[create_session] -> sessionId: "session-b"
[browser_navigate sessionId="session-a" url="https://example.com"]
[browser_navigate sessionId="session-b" url="https://google.com"]
[browser_snapshot sessionId="session-a"]
[browser_snapshot sessionId="session-b"]

Form Interaction

User: Fill out the login form

Claude: I'll fill in the form fields and submit.

[browser_fill sessionId="abc123" element="Email input" ref="e1" value="user@example.com"]
[browser_fill sessionId="abc123" element="Password input" ref="e2" value="***"]
[browser_click sessionId="abc123" element="Submit button" ref="e3"]

Backend Configuration

Default Backend (Playwright)

By default, playwright-parallel-mcp uses @playwright/mcp as the backend:

json
{
  "mcpServers": {
    "playwright-parallel": {
      "command": "npx",
      "args": ["playwright-parallel-mcp"]
    }
  }
}

Chrome DevTools Backend

To use Chrome DevTools MCP instead:

json
{
  "mcpServers": {
    "playwright-parallel": {
      "command": "npx",
      "args": ["playwright-parallel-mcp"],
      "env": {
        "MCP_BACKEND": "chrome-devtools"
      }
    }
  }
}

Custom Backend

Any npm package that provides an MCP server can be used:

json
{
  "mcpServers": {
    "playwright-parallel": {
      "command": "npx",
      "args": ["playwright-parallel-mcp"],
      "env": {
        "MCP_BACKEND": "my-custom-mcp-server"
      }
    }
  }
}

Environment Variables

VariableDefaultDescription
MCP_BACKENDplaywrightBackend MCP server: playwright, chrome-devtools, or any npm package
MAX_SESSIONS10Maximum number of concurrent browser sessions
SESSION_TIMEOUT_MS3600000Session inactivity timeout (1 hour)

Comparison

FeatureChrome DevTools MCPPlaywright MCPThis Project
Parallel SessionsNoNoYes
Session IsolationNoNoYes (Process-level)
Backend ChoiceChrome onlyPlaywright onlyAny MCP server
Tool UpdatesManualManualAutomatic (@latest)
CostFreeFreeFree

Requirements

  • Node.js 20+
  • Backend browser requirements (e.g., Playwright browsers)

Development

bash
git clone https://github.com/sumyapp/playwright-parallel-mcp
cd playwright-parallel-mcp
pnpm install
pnpm build
pnpm start

Running Tests

bash
pnpm test

Project Structure

src/
  index.ts           # MCP server entry point with tool definitions
  session-manager.ts # Session lifecycle management
  mcp-client.ts      # MCP client for child process communication
  types.ts           # Type definitions and backend configuration

Security Warning

This MCP server provides powerful browser automation capabilities.

  • Backend tools like browser_evaluate execute arbitrary JavaScript
  • File upload tools can access the file system
  • Only use in controlled environments with trusted clients

License

MIT

Cài đặt

TypingMind
{
  "mcpServers": {
    "playwright-parallel-mcp": {
      "command": "npx",
      "args": [
        "playwright-parallel-mcp"
      ]
    }
  }
}

Công cụ có sẵn

  • create_session

    Create a new isolated browser session

  • close_session

    Close a browser session

  • list_sessions

    List all active browser sessions

  • navigate

    Navigate to a URL

  • go_back

    Go back in browser history

  • go_forward

    Go forward in browser history

  • reload

    Reload the current page

  • get_url

    Get the current URL and page title

  • snapshot

    Get accessibility tree snapshot of the current page (ARIA snapshot format)

  • screenshot

    Take a screenshot of the current page

  • get_content

    Get the text content of the page or an element

  • get_html

    Get the HTML of the page or an element

  • get_console_logs

    Get console logs from the browser session

  • get_network_logs

    Get network request logs from the browser session

  • run_script

    Execute JavaScript in the browser context

  • get_cookies

    Get cookies from the browser context

  • set_cookies

    Set cookies in the browser context

  • get_storage

    Get localStorage or sessionStorage values

  • set_storage

    Set localStorage or sessionStorage values

  • click

    Click on an element

  • fill

    Fill in a form field

  • select_option

    Select option(s) from a dropdown

  • hover

    Hover over an element

  • press_key

    Press a key or key combination

  • type

    Type text with realistic key-by-key input simulation

  • check

    Check a checkbox

  • uncheck

    Uncheck a checkbox

  • wait_for_selector

    Wait for an element to appear in the DOM

  • wait_for_load_state

    Wait for page to reach a specific load state

  • wait_for_url

    Wait for URL to match a pattern

  • wait_for_function

    Wait for a JavaScript function to return truthy value

  • wait_for_timeout

    Wait for a specified amount of time

  • get_dialogs

    Get dialog history from the session

  • set_dialog_handler

    Configure automatic dialog handling

  • get_element_state

    Get the state of an element (visible, enabled, checked, editable)

  • get_attribute

    Get an attribute value from an element

  • get_bounding_box

    Get the bounding box of an element

  • count_elements

    Count elements matching a selector

  • get_all_texts

    Get text content from all elements matching a selector

  • upload_file

    Upload file(s) to a file input element

  • drag_and_drop

    Drag an element and drop it on another element

  • scroll

    Scroll the page or an element

  • scroll_into_view

    Scroll an element into view

  • mouse_move

    Move mouse to specific coordinates

  • mouse_click

    Click at specific coordinates

  • mouse_down

    Press mouse button down

  • mouse_up

    Release mouse button

  • mouse_wheel

    Scroll using mouse wheel

  • set_viewport

    Change the viewport size

  • set_geolocation

    Set geolocation for the browser context

  • set_offline

    Set browser offline/online mode

  • set_extra_http_headers

    Set extra HTTP headers for all requests

  • generate_pdf

    Generate a PDF of the current page (Chromium only)

  • list_frames

    List all frames in the page

  • frame_click

    Click on an element within a frame

  • frame_fill

    Fill an input within a frame

  • frame_get_content

    Get text content from an element within a frame

  • get_page_errors

    Get JavaScript errors from the page

  • clear_logs

    Clear console logs, network logs, or page errors

  • expose_function

    Expose a function to the page that logs calls

  • add_init_script

    Add a script to run before page load

  • get_metrics

    Get page performance metrics

  • get_accessibility_tree

    Get the accessibility tree (ARIA snapshot) of the page or element

Dùng MCP playwright-parallel-mcp với nhiều mô hình AI

TypingMind kết nối các công cụ MCP ở cấp không gian làm việc, nên sau khi kết nối playwright-parallel-mcp, bạn có thể dùng với nhiều mô hình AI khác nhau trong TypingMind thay vì phải thiết lập riêng cho từng mô hình. MCP này chạy cục bộ thông qua trình kết nối MCP của TypingMind trên thiết bị của bạn.

Hướng dẫn thiết lập để dùng trình kết nối cục bộ

Dùng cách này khi máy chủ MCP cần truy cập các tệp, ứng dụng hoặc tài nguyên riêng tư trên máy tính của bạn.

1

Mở cài đặt MCP

Trong TypingMind, vào Cài đặt, Cài đặt nâng cao, rồi đến Giao thức ngữ cảnh mô hình và chọn Cài trình kết nối.

  1. Mở TypingMind trong trình duyệt của bạn.
  2. Nhấp vào biểu tượng Cài đặt.
  3. Vào Cài đặt nâng cao.
  4. Mở mục Giao thức ngữ cảnh mô hình.
  5. Nhấp vào Cài trình kết nối rồi chọn Thiết bị này.
Màn hình thiết lập trình kết nối MCP của TypingMind với tùy chọn Thiết bị này được chọn
2

Chạy lệnh trình kết nối

Chọn Thiết bị này, sao chép lệnh từ TypingMind và chạy trong Terminal. Giữ tiến trình chạy trong khi bạn dùng MCP.

  1. Sao chép lệnh thiết lập hiển thị trong TypingMind.
  2. Mở Terminal trên macOS hoặc Windows Terminal trên Windows.
  3. Dán và chạy lệnh.
  4. Xác nhận cài đặt gói nếu Terminal hỏi bạn có muốn tiếp tục không.
  5. Giữ tiến trình trong cửa sổ Terminal chạy trong khi dùng các công cụ MCP.
3

Thêm playwright-parallel-mcp làm máy chủ

Khi trạng thái trình kết nối là Sẵn sàng, nhấp vào Sửa máy chủ và dán cấu hình máy chủ MCP.

  1. Đợi đến khi trạng thái trình kết nối hiển thị Sẵn sàng.
  2. Nhấp vào Sửa máy chủ.
  3. Dán cấu hình máy chủ MCP của playwright-parallel-mcp.
  4. Lưu danh sách máy chủ.
  5. Làm mới nếu bạn muốn xác nhận trình kết nối vẫn sẵn sàng.
Cài đặt MCP của TypingMind hiển thị máy chủ đang hoạt động và nút Sửa máy chủ
{
  "mcpServers": {
    "playwright-parallel-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "playwright-parallel-mcp"
      ]
    }
  }
}
4

Dùng kết nối với nhiều mô hình

Lưu danh sách máy chủ, mở Plugin, bật các công cụ MCP của playwright-parallel-mcp, sau đó chọn bất kỳ mô hình AI nào được hỗ trợ trong TypingMind và dùng các công cụ trong cuộc trò chuyện hoặc gán chúng cho một tác nhân AI.

  1. Mở trang Plugin trong TypingMind.
  2. Bật các công cụ MCP của playwright-parallel-mcp.
  3. Bắt đầu cuộc trò chuyện và chọn mô hình AI bạn muốn dùng.
  4. Dùng các công cụ MCP trong cuộc trò chuyện hoặc gán chúng cho một tác nhân AI.
  5. Chuyển sang mô hình AI khác bất cứ khi nào cần mà không phải kết nối lại MCP.
Cuộc trò chuyện TypingMind dùng các công cụ MCP đã bật với một mô hình AI được chọn
Bạn có thể dùng playwright-parallel-mcp giúp tôi làm việc này không?
playwright-parallel-mcp
Được. Tôi đã đọc.
Đây là kết quả tôi tìm được bằng playwright-parallel-mcp.

Câu hỏi thường gặp

Máy chủ MCP playwright-parallel-mcp dùng để làm gì?

playwright-parallel-mcp là máy chủ MCP cho phép các ứng dụng AI tương thích kết nối với công cụ và ngữ cảnh bên ngoài. Trong TypingMind, bạn chỉ cần thêm máy chủ MCP này một lần để các công cụ của nó có sẵn trong không gian làm việc AI của bạn.

Bạn có thể dùng MCP playwright-parallel-mcp với nhiều mô hình AI trong TypingMind không?

Có. TypingMind kết nối các công cụ MCP ở cấp không gian làm việc, nên bạn có thể dùng playwright-parallel-mcp với nhiều mô hình AI như Claude, ChatGPT, Gemini hoặc các mô hình khác đã cấu hình trong TypingMind mà không cần thiết lập máy chủ MCP riêng cho từng mô hình.

Vì sao nên dùng MCP playwright-parallel-mcp với TypingMind?

TypingMind là một trong những giao diện trò chuyện với LLM tốt nhất vì tập hợp nhiều mô hình AI, prompt, plugin, tác nhân AI, khóa API và công cụ MCP vào một không gian làm việc. Khi kết nối playwright-parallel-mcp, bạn có thể dùng các công cụ MCP của dịch vụ này với những mô hình ưa thích, đồng thời giữ quy trình trò chuyện gọn gàng trong TypingMind.

Làm cách nào để kết nối MCP playwright-parallel-mcp với TypingMind?

playwright-parallel-mcp hoạt động thông qua trình kết nối MCP cục bộ của TypingMind. Đây là lựa chọn phù hợp nhất khi máy chủ MCP cần truy cập tệp cục bộ, ứng dụng máy tính, công cụ dòng lệnh hoặc tài nguyên riêng trên máy tính của bạn.

MCP playwright-parallel-mcp cung cấp những công cụ nào trong TypingMind?

playwright-parallel-mcp cung cấp 63 công cụ MCP mà bạn có thể bật từ trang Plugin của TypingMind để dùng trong trò chuyện hoặc gán cho tác nhân AI.

Bạn có cần chia sẻ khóa API với TypingMind để dùng MCP playwright-parallel-mcp không?

Không. TypingMind ưu tiên xử lý cục bộ và cho phép bạn kiểm soát nhà cung cấp mô hình, khóa API, prompt và cấu hình MCP. Nếu playwright-parallel-mcp yêu cầu xác thực, hãy thêm các header, cài đặt OAuth hoặc cấu hình cục bộ cần thiết cho máy chủ MCP đó khi tạo kết nối.

Máy chủ MCP liên quan

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇