Logo di playwright-parallel-mcp

playwright-parallel-mcp

Community
sumyapp

MCP server for parallel browser automation with Playwright

Autoresumyapp
Repositoryplaywright-parallel-mcp
LinguaTypeScript
Fork
8
Stelle
18
Strumenti disponibili
63
Tipo di trasportostdio
Categorie
LicenzaMIT
Link
  • Collega gli strumenti ai flussi di lavoro IA

    playwright-parallel-mcp mette a disposizione funzionalità MCP utilizzabili da client e agenti IA compatibili.

  • 63 strumenti disponibili

    Esplora le azioni richiamabili qui sotto, con nomi e descrizioni quando forniti dal server.

  • Configurazione pronta da copiare

    Usa gli esempi di installazione per configurare questo server nel tuo client MCP preferito.

  • Indicatori di interesse open source

    18 stelle e 8 fork nel repository collegato.

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

Installazione

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

Strumenti disponibili

  • 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

Usa MCP playwright-parallel-mcp con più modelli IA

TypingMind collega gli strumenti MCP a livello di area di lavoro: una volta connesso playwright-parallel-mcp, puoi usarlo con diversi modelli IA in TypingMind, senza configurarlo separatamente per ogni modello. Questa integrazione MCP viene eseguita localmente sul tuo dispositivo tramite il connettore MCP di TypingMind.

Guida alla configurazione del connettore locale

Usa questo metodo quando il server MCP deve accedere a file locali, app o risorse private sul tuo computer.

1

Apri le impostazioni MCP

In TypingMind, vai su Impostazioni, Impostazioni avanzate, poi su Model Context Protocol e scegli Configura MCP.

  1. Apri TypingMind nel tuo browser.
  2. Fai clic sull'icona Impostazioni.
  3. Vai a Impostazioni avanzate.
  4. Apri la sezione Model Context Protocol.
  5. Fai clic su Configura MCP e scegli Questo dispositivo.
Schermata di configurazione del connettore MCP di TypingMind con Questo dispositivo selezionato
2

Esegui il comando del connettore

Scegli Questo dispositivo, copia il comando da TypingMind ed eseguilo nel terminale. Lascia il processo in esecuzione mentre usi MCP.

  1. Copia il comando di configurazione mostrato da TypingMind.
  2. Apri Terminale su macOS o Windows Terminal su Windows.
  3. Incolla ed esegui il comando.
  4. Conferma l'installazione del pacchetto se il terminale ti chiede di procedere.
  5. Tieni aperta la finestra del terminale con il processo in esecuzione mentre usi gli strumenti MCP.
3

Aggiungi playwright-parallel-mcp come server

Quando lo stato del connettore è Pronto, fai clic su Modifica server e incolla la configurazione del server MCP.

  1. Attendi che lo stato del connettore sia Pronto.
  2. Fai clic su Modifica server.
  3. Incolla la configurazione del server MCP di playwright-parallel-mcp.
  4. Salva l'elenco dei server.
  5. Aggiorna per verificare che il connettore sia ancora pronto.
Impostazioni MCP di TypingMind con un server attivo e il pulsante Modifica server
{
  "mcpServers": {
    "playwright-parallel-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "playwright-parallel-mcp"
      ]
    }
  }
}
4

Usa la connessione con diversi modelli

Salva l'elenco dei server, apri Plugin, abilita gli strumenti MCP di playwright-parallel-mcp, poi seleziona un modello IA supportato in TypingMind e usa gli strumenti in chat o assegnali a un agente IA.

  1. Apri la pagina Plugin in TypingMind.
  2. Abilita gli strumenti MCP di playwright-parallel-mcp.
  3. Avvia una chat e scegli il modello IA che vuoi usare.
  4. Usa gli strumenti MCP in chat o assegnali a un agente IA.
  5. Passa a un altro modello IA quando serve, senza riconnettere MCP.
Chat di TypingMind che usa gli strumenti MCP abilitati con un modello IA selezionato
Puoi usare playwright-parallel-mcp per aiutarmi con questa attività?
playwright-parallel-mcp
Certo. Ho letto.
Ecco cosa ho trovato con playwright-parallel-mcp.

Domande frequenti

A cosa serve il server MCP playwright-parallel-mcp?

playwright-parallel-mcp è un server MCP che consente ai client IA compatibili di accedere a strumenti e informazioni di contesto esterni. In TypingMind puoi aggiungere questo server MCP una sola volta e rendere disponibili i suoi strumenti nella tua area di lavoro IA.

Posso usare playwright-parallel-mcp MCP con più modelli IA in TypingMind?

Sì. TypingMind collega gli strumenti MCP a livello di area di lavoro, quindi puoi usare playwright-parallel-mcp con diversi modelli IA come Claude, ChatGPT, Gemini o altri modelli che hai configurato in TypingMind, senza dover configurare il server MCP separatamente per ogni modello.

Perché usare il connettore MCP playwright-parallel-mcp con TypingMind?

TypingMind è una delle migliori interfacce per chattare con gli LLM perché riunisce più modelli IA, prompt, plugin, agenti IA, chiavi API e strumenti MCP in un'unica area di lavoro. Collegando playwright-parallel-mcp, puoi usare i suoi strumenti MCP con i tuoi modelli preferiti e mantenere organizzato il tuo flusso di lavoro in chat su TypingMind.

Come collego playwright-parallel-mcp MCP a TypingMind?

playwright-parallel-mcp funziona tramite il connettore MCP locale di TypingMind. È la soluzione ideale quando il server MCP deve accedere a file locali, app desktop, strumenti da riga di comando o risorse private sul tuo computer.

Quali strumenti offre playwright-parallel-mcp MCP in TypingMind?

playwright-parallel-mcp mette a disposizione 63 strumenti MCP che puoi attivare dalla pagina Plugin di TypingMind e usare in chat o assegnare agli agenti IA.

Devo condividere le mie chiavi API con TypingMind per usare playwright-parallel-mcp MCP?

No. TypingMind privilegia il funzionamento in locale e ti permette di mantenere il controllo su fornitori di modelli, chiavi API, prompt e configurazione MCP. Se playwright-parallel-mcp richiede l'autenticazione, aggiungi le intestazioni, le impostazioni OAuth o la configurazione locale necessarie per quel server MCP quando crei la connessione.

Server MCP correlati

Vedi tutti

Crea subito la tua area di lavoro IA

Iscriviti alla nostra newsletter per ricevere aggiornamenti sulle nuove funzionalità e sulle prossime iniziative a premi 👇