Logo de playwright-parallel-mcp

playwright-parallel-mcp

Comunidade
sumyapp

MCP server for parallel browser automation with Playwright

Publicado porsumyapp
Repositórioplaywright-parallel-mcp
IdiomaTypeScript
Forks
8
Estrelas
18
Ferramentas disponíveis
63
Tipo de transportestdio
Categorias
LicençaMIT
Links
  • Conecte ferramentas a fluxos de trabalho de IA

    playwright-parallel-mcp disponibiliza recursos MCP que podem ser usados por clientes e agentes de IA compatíveis.

  • 63 ferramentas disponíveis

    Confira abaixo as ações que podem ser chamadas, incluindo nomes e descrições quando fornecidos pelo servidor.

  • Configuração pronta para copiar

    Use os exemplos de instalação para configurar este servidor no seu cliente MCP preferido.

  • Indicadores da comunidade de código aberto

    18 estrelas e 8 forks no repositório vinculado.

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

Instalação

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

Ferramentas disponíveis

  • 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

Use o MCP de playwright-parallel-mcp com vários modelos de IA

O TypingMind conecta as ferramentas MCP no nível do espaço de trabalho. Assim, após conectar playwright-parallel-mcp, é possível usá-lo com diferentes modelos de IA no TypingMind, em vez de configurá-lo separadamente para cada modelo. Este MCP é executado localmente no seu dispositivo por meio do conector MCP do TypingMind.

Guia de configuração para usar o conector local

Use esta opção quando o servidor MCP precisar acessar arquivos locais, aplicativos ou recursos privados no seu computador.

1

Abra as configurações de MCP

No TypingMind, vá até Configurações, Configurações avançadas e depois Model Context Protocol e selecione Configurar conector.

  1. Abra o TypingMind no navegador.
  2. Clique no ícone de Ajustes.
  3. Acesse Configurações avançadas.
  4. Abra a seção Model Context Protocol.
  5. Clique em Configurar conector e selecione Este dispositivo.
Tela de configuração do conector MCP do TypingMind com a opção Este dispositivo selecionada
2

Execute o comando do conector

Selecione Este dispositivo, copie o comando do TypingMind e execute-o no Terminal. Mantenha o processo em execução enquanto usa o MCP.

  1. Copie o comando de configuração exibido pelo TypingMind.
  2. Abra o Terminal no macOS ou o Windows Terminal no Windows.
  3. Cole e execute o comando.
  4. Autorize a instalação do pacote se o Terminal pedir confirmação para continuar.
  5. Mantenha o processo em execução na janela do Terminal enquanto usa as ferramentas MCP.
3

Adicione playwright-parallel-mcp como servidor

Quando o status do conector for Pronto, clique em Editar e cole a configuração do servidor MCP.

  1. Aguarde até que o status do conector mostre Pronto.
  2. Clique em Editar.
  3. Cole a configuração do servidor MCP de playwright-parallel-mcp.
  4. Salve a lista de servidores.
  5. Atualize para confirmar se o conector ainda está pronto para uso.
Configurações de MCP do TypingMind mostrando um servidor ativo e o botão Editar
{
  "mcpServers": {
    "playwright-parallel-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "playwright-parallel-mcp"
      ]
    }
  }
}
4

Use a conexão com diferentes modelos

Salve a lista de servidores, abra Plugins, ative as ferramentas MCP de playwright-parallel-mcp, selecione qualquer modelo de IA compatível no TypingMind e use as ferramentas no chat ou atribua-as a um agente de IA.

  1. Abra a página Plugins no TypingMind.
  2. Ative as ferramentas MCP de playwright-parallel-mcp.
  3. Inicie um chat e escolha o modelo de IA que deseja usar.
  4. Use as ferramentas MCP no chat ou atribua-as a um agente de IA.
  5. Mude para outro modelo de IA sempre que necessário, sem reconectar o MCP.
Chat do TypingMind usando ferramentas MCP ativadas com um modelo de IA selecionado
Pode usar playwright-parallel-mcp para me ajudar nesta tarefa?
playwright-parallel-mcp
Claro. Já li.
Veja o que encontrei usando playwright-parallel-mcp.

Perguntas frequentes

Para que serve o servidor MCP playwright-parallel-mcp?

playwright-parallel-mcp é um servidor MCP que permite que aplicativos de IA compatíveis se conectem a ferramentas externas e informações de contexto. No TypingMind, basta adicionar esse servidor MCP uma vez para disponibilizar suas ferramentas no seu espaço de trabalho com IA.

Posso usar o MCP playwright-parallel-mcp com vários modelos de IA no TypingMind?

Sim. O TypingMind conecta as ferramentas MCP no nível do espaço de trabalho, permitindo usar playwright-parallel-mcp com diferentes modelos de IA, como Claude, ChatGPT, Gemini ou outros modelos configurados no TypingMind, sem configurar o servidor MCP separadamente para cada modelo.

Por que usar o MCP playwright-parallel-mcp com o TypingMind?

O TypingMind é uma das melhores interfaces de chat com LLMs porque reúne vários modelos de IA, prompts, plugins, agentes de IA, chaves de API e ferramentas MCP em um só espaço de trabalho. Com playwright-parallel-mcp conectado, é possível usar suas ferramentas MCP nos seus modelos preferidos e manter seu fluxo de trabalho de chat organizado no TypingMind.

Como conecto o MCP playwright-parallel-mcp ao TypingMind?

playwright-parallel-mcp funciona por meio do conector MCP local do TypingMind. Essa é a melhor opção quando o servidor MCP precisa acessar arquivos locais, apps de desktop, ferramentas de linha de comando ou recursos privados no seu computador.

Quais ferramentas o MCP playwright-parallel-mcp oferece no TypingMind?

playwright-parallel-mcp disponibiliza 63 ferramentas MCP que podem ser ativadas na página Plugins do TypingMind e usadas no chat ou atribuídas a agentes de IA.

Preciso compartilhar minhas chaves de API com o TypingMind para usar o MCP playwright-parallel-mcp?

Não. O TypingMind prioriza o uso local e permite manter seus provedores de modelos, chaves de API, prompts e configuração MCP sob seu controle. Se playwright-parallel-mcp exigir autenticação, adicione os cabeçalhos, as configurações OAuth ou a configuração local exigidos por esse servidor MCP ao criar a conexão.

Servidores MCP relacionados

Ver todos

Crie seu próprio espaço de IA agora

Inscreva-se na nossa newsletter para receber novidades sobre recursos e futuros sorteios 👇