playwright-multi-mcp
Allows launching, isolating, and controlling Firefox browser sessions through Playwright, including custom profiles, proxies, viewports, user agents, locales, storage state, and navigation/interaction.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@playwright-multi-mcp Create a Chromium session and a Firefox session, then compare example.com's load times."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
playwright-multi-mcp
A multi-browser automation, web auditing, and DevTools Model Context Protocol (MCP) server built natively on Playwright and CDP.
playwright-multi-mcp lets AI agents launch, isolate, and concurrently control multiple independent browser sessions (separate browser processes/contexts, cookies, localStorage, proxies, viewports, browser engines, and optional persistent userDataDir profiles) while combining full-page interaction, performance & accessibility auditing, trace profiling, device/network emulation, and deep CSS & network inspection in a single unified browser_* toolset.
Features
True Multi-Browser Session Management:
browser_session_create: Launch isolatedchromium,firefox, orwebkitinstances with customsessionId,label,userDataDir,proxy,viewport,userAgent,locale,timezoneId,storageState,headless/headed, andinitialUrl.browser_session_list: Inspect all active sessions, engines, labels, tabs, and URLs.browser_session_switch: Change the default active session.browser_session_close: Close a specific session, the active session, orall: true.browser_session_storage_state: Export cookies &localStoragefrom a session (or save to disk) to inspect or clone auth state into another session.
Hybrid Session Targeting:
Every
browser_*tool accepts an optionalsessionId.Pass
sessionIdto operate on a specific browser directly (even concurrently across multiple sessions!).Omit
sessionIdto target the currently active session—or auto-launch a default session if none exist yet.
Structured Accessibility Snapshots (
[ref=eN]):Uses Playwright accessibility snapshots with deterministic element refs (
e1,e2, ...) so LLMs reason over structured UI trees instead of heavy pixel coordinates.
Full Core Toolset:
Navigation:
browser_navigate,browser_navigate_backInteraction:
browser_click,browser_type,browser_fill_form,browser_select_option,browser_hover,browser_drag,browser_press_key,browser_file_upload,browser_handle_dialogInspection:
browser_snapshot,browser_take_screenshot,browser_console_messages,browser_network_requests,browser_network_details,browser_wait_for,browser_evaluate,browser_run_code,browser_css_stylesTabs & Window:
browser_tabs,browser_resize,browser_closeWeb Auditing & Core Web Vitals:
browser_audit: Run Performance, Accessibility, Best Practices, and SEO audits (mobile/desktop,navigation/snapshot, optional Slow 4G + 4x CPU throttling) with Core Web Vitals, optimization opportunities, and failing DOM node selectors.browser_performance_score: Streamlined performance score (0–1), FCP, LCP, TBT, CLS, TTFB, and actionable optimization diagnostics.
DevTools Tracing, Emulation & Runtime Profiling:
browser_trace_start/browser_trace_stop: Record Chromium DevTools performance traces (.json/.json.gz), compute Core Web Vitals, Long Tasks, TBT, and main-thread breakdown.browser_trace_insight: Drill intoWebVitals,LongTasks,MainThreadBreakdown,LayoutShifts, orCdpMetricsfrom the latest trace.browser_performance_metrics: Live JS heap usage, DOM node count, layout/style recalc counts, and paint timings without reloading.browser_emulate: Emulate network throttling (Offline,Slow 3G,Fast 3G,Slow 4G,Fast 4G), CPU slowdown, device viewport, user-agent, geolocation, media features (colorScheme,reducedMotion,forcedColors,contrast), and extra HTTP headers.
Dual Transports:
Stdio (default, for Claude Desktop, Cursor, Windsurf, Antigravity, VS Code)
Streamable HTTP (
--port 8931, with/mcpand/healthendpoints)
Related MCP server: Browser Control MCP Server
Installation
npm install -g playwright-multi-mcp
npx playwright install chromiumOr run directly without global installation using npx -y playwright-multi-mcp (ensure Playwright Chromium is installed via npx playwright install chromium).
(Optional: run npx playwright install firefox webkit if you plan to launch Firefox or WebKit sessions.)
MCP Client Configuration
Stdio (Claude Desktop / Cursor / Windsurf / Antigravity)
{
"mcpServers": {
"playwright-multi": {
"command": "npx",
"args": [
"-y",
"playwright-multi-mcp"
]
}
}
}Pass --headed in args if you want to watch multiple browser windows side-by-side:
{
"mcpServers": {
"playwright-multi": {
"command": "npx",
"args": [
"-y",
"playwright-multi-mcp",
"--headed"
]
}
}
}Streamable HTTP Mode
npx -y playwright-multi-mcp --port 8931 --host 127.0.0.1Connect your MCP client to http://127.0.0.1:8931/mcp.
CLI Options
Flag | Description | Default |
| Default browser engine |
|
| Browser channel (e.g. | unset |
| Show visible browser windows |
|
| Run browsers headlessly |
|
| Default viewport dimensions |
|
| Start Streamable HTTP server on port | stdio |
| HTTP bind host |
|
| Bearer token for HTTP transport (or | unset |
| Comma-separated allowed | same host/loopback |
| Comma-separated allowed directories for file reads/writes |
|
| Disable path root confinement |
|
| Allow |
|
| Block RFC1918/loopback targets via DNS & route checks |
|
| Enable |
|
| Disable |
|
| Maximum concurrent browser sessions |
|
| Maximum open tabs per session |
|
| Disable automatic snapshots after actions |
|
| Truncate snapshots above N characters | unlimited |
Set LOG_FORMAT=json and LOG_LEVEL=debug|info|warn|error to configure structured logging on stderr.
Example Multi-Browser Agent Workflow
Create two isolated sessions:
browser_session_create({ sessionId: "admin", label: "Admin portal", initialUrl: "https://app.example.com/login" })browser_session_create({ sessionId: "buyer", label: "Buyer storefront", initialUrl: "https://app.example.com/shop", setActive: false })
Target each session explicitly without losing state or cookies:
browser_type({ sessionId: "admin", ref: "e4", text: "admin@example.com" })browser_click({ sessionId: "buyer", ref: "e12" })
Inspect all open sessions at any time:
browser_session_list()
Clean up when finished:
browser_session_close({ all: true })
Development & Tests
npm run typecheck
npm run build
npm run test:buildAvailable Tools
35 toolsbrowser_auditB
Run a comprehensive page audit (Performance, Accessibility, Best Practices, SEO) on the target session's page or a given URL with mobile/desktop emulation and optional network/CPU throttling.
Inputs: url, mode, device, savePath, +3 more.
browser_clickC
Perform a click on a web page element identified by its snapshot ref.
Inputs: ref (required), button, element, modifiers, +2 more.
browser_closeA
Close the target browser session (alias of browser_session_close for single-session compatibility).
Inputs: sessionId.
browser_console_messagesA
Retrieve captured browser console messages (logs, warnings, errors) for the target session.
Inputs: clear, level, sessionId.
browser_css_stylesA
Inspect computed CSS styles, inline styles, and matched CSS cascade rules for an element ref from browser_snapshot.
Inputs: ref (required), element, maxRules, sessionId, +2 more.
browser_dragB
Perform drag and drop between two elements identified by their snapshot refs.
Inputs: endRef (required), startRef (required), sessionId, endElement, +1 more.
browser_emulateC
Emulate network conditions, CPU throttling, viewport/mobile device metrics, userAgent, geolocation, CSS media features (colorScheme, reducedMotion, forcedColors, contrast), or extra HTTP headers on a session.
Inputs: contrast, viewport, sessionId, userAgent, +7 more.
browser_evaluateC
Evaluate a JavaScript expression or function in the browser page context (or on a specific element ref).
Inputs: function (required), ref, element, sessionId.
browser_file_uploadB
Upload one or more files to a file input or trigger the next file chooser.
Inputs: ref, paths, element, sessionId.
browser_fill_formB
Fill multiple form fields at once using their snapshot refs.
Inputs: fields (required), sessionId.
browser_handle_dialogB
Accept or dismiss a pending browser JavaScript dialog (alert, confirm, prompt).
Inputs: accept (required), sessionId, promptText.
browser_hoverB
Hover the mouse pointer over an element identified by its snapshot ref.
Inputs: ref (required), element, sessionId.
browser_network_detailsA
Inspect full request/response headers, status, timing, and byte sizes for a specific request ID returned by browser_network_requests.
Inputs: requestId (required), sessionId.
browser_network_requestsB
List HTTP network requests observed in the target browser session, with optional resource type and URL substring filters.
Inputs: clear, sessionId, urlContains, includeStatic, +1 more.
browser_performance_metricsA
Capture live Chromium DevTools performance metrics (JS heap usage, DOM nodes, layout/recalc counts, script duration) and current navigation/paint timings without reloading.
Inputs: sessionId.
browser_performance_scoreA
Measure a focused performance score (0-1), Core Web Vitals (FCP, LCP, TBT, CLS, TTFB), and optimization opportunities for the current page or a target URL.
Inputs: url, mode, device, sessionId, +1 more.
browser_press_keyB
Press a keyboard key or key combination (e.g. 'Enter', 'ArrowDown', 'Control+A').
Inputs: key (required), sessionId.
browser_resizeC
Resize the active browser page viewport in the target session.
Inputs: width (required), height (required), sessionId.
browser_run_codeC
Run a custom async Playwright snippet with page, context, and sessionId in scope.
Inputs: code (required), sessionId.
browser_select_optionA
Select one or more options in a dropdown () element.
Inputs: ref (required), values (required), element, sessionId.
browser_session_closeB
Close a specific browser session, the active session, or all open browser sessions.
Inputs: all, sessionId.
browser_session_createA
Launch a new isolated browser session (instance + context). Use this to run multiple independent browsers, accounts, engines, or proxies concurrently.
Inputs: label, proxy, locale, browser, +11 more.
browser_session_listA
List all open browser sessions with their IDs, labels, engines, active status, tab counts, and current URLs.
Inputs: no named parameters.
browser_session_storage_stateA
Export cookies and localStorage from a browser session (optionally saving to a file) so auth state can be inspected or cloned into another session.
Inputs: savePath, sessionId.
browser_session_switchA
Switch the default active browser session used when sessionId is omitted from subsequent tool calls.
Inputs: sessionId (required).
browser_snapshotA
Capture an accessibility tree snapshot of the current page with element refs (e.g. [ref=e5]). Prefer this over screenshots for reasoning and element targeting.
Inputs: filename, sessionId.
browser_tabsB
List, create, close, or select tabs within a browser session.
Inputs: action (required), url, index, sessionId.
browser_take_screenshotC
Take a visual screenshot of the current page or a specific element.
Inputs: ref, type, element, filename, +2 more.
browser_trace_insightB
Inspect detailed metrics for a specific insight category from the most recent recorded trace in the target session.
Inputs: insight (required), sessionId.
browser_trace_startB
Start a Chrome DevTools CDP performance trace on the target session to measure Core Web Vitals, Long Tasks, TBT, and main-thread breakdown.
Inputs: reload, autoStop, filePath, sessionId, +3 more.
browser_trace_stopA
Stop an active performance trace in the target session, optionally save the raw trace file, and return analyzed performance insights.
Inputs: filePath, sessionId.
browser_typeB
Type text into an editable element identified by its snapshot ref.
Inputs: ref (required), text (required), slowly, submit, +2 more.
browser_wait_forB
Wait for text to appear, text to disappear, or a specified number of seconds in the target session.
Inputs: text, time, textGone, sessionId, +1 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 35 tools
Core interaction tools (click, type, hover, drag, select_option) are distinct, but the performance/audit cluster overlaps heavily: browser_audit, browser_performance_score, browser_performance_metrics, browser_trace_start/stop/insight all measure page performance with subtly different scope. browser_close is explicitly an alias of browser_session_close, and browser_evaluate vs browser_run_code have fuzzy boundaries.
Nearly all tools use a snake_case browser_<verb>_<noun> pattern (browser_session_create, browser_navigate_back, browser_network_details). Minor deviations exist where the pattern collapses to a bare noun or verb (browser_tabs, browser_snapshot, browser_audit), but the prefix convention makes the set readable and predictable.
35 tools is heavy for the domain and includes clear redundancy: a legacy alias (browser_close), four performance-measurement tools, and three overlay-style tools that could be consolidated. Splitting session lifecycle, navigation, interaction, inspection, and performance into this many endpoints creates a large surface to triage.
Coverage is strong for browser automation: session lifecycle, storage state export, navigation, rich element interaction, file upload, dialogs, snapshots, console/network inspection, emulation, and performance tracing are all present. Minor gaps remain around cookie manipulation, request interception/mocking, downloads, and dedicated iframe handling, which could block some workflows.
Maintenance
Related MCP Connectors
Give AI agents a real cloud Chrome: open sessions, navigate, read pages, click, type and screenshot.
Cloud browser, web extraction, screenshots, and remote CDP tools for AI agents.
Control a real browser from AI agents: navigate, click, type, screenshot, read the page.
Launch, inspect, control, and share isolated cloud browsers for your agents.
Related MCP Servers
- AlicenseBqualityDmaintenanceEnables AI assistants to control a real Chromium browser through Playwright, allowing them to navigate pages, click elements, fill forms, extract text or HTML, and capture screenshots in a persistent session.6ISC
- AlicenseBqualityBmaintenanceEnables AI agents to control Chromium-based browsers via CDP with 36 tools for navigation, input, screenshots, accessibility inspection, network monitoring, device emulation, and performance tracing.36MIT

TriPaneofficial
AlicenseNot gradedqualityBmaintenanceEnables AI agents to open pages, click and type across Chromium, Firefox, and WebKit simultaneously, take screenshots, read consoles, and run cross-engine comparisons while the user watches in the window.MIT- AlicenseNot gradedqualityCmaintenanceEnables AI coding agents to control a real Chromium browser through Playwright using accessibility-tree refs, returning snapshots after actions and supporting persistent sessions, screenshots, dialogs, cookies, downloads, and network routes.MIT