Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To let an AI application automate a browser through the Model Context Protocol (MCP), connect an MCP client to Playwright MCP, the browser-automation server documented by Playwright. The client calls the server’s tools; Playwright operates the browser and provides structured accessibility snapshots the model can use to identify and interact with page elements. The documented quick start requires Node.js 20 or newer and an MCP client.

How the Playwright MCP connection works

MCP is the connection mechanism in this example, not the browser automation itself. The MCP client connects to the Playwright MCP server; that server launches or connects to a browser and exposes tools the client can invoke. Playwright’s documented workflow gives the model structured accessibility information about the page, so the basic interaction path does not require a vision model.

That description applies to Playwright MCP. Other browser servers and MCP clients can use different tools, configuration formats, session behavior, and security controls.

What you need before setup

  • Node.js 20 or newer. This is the prerequisite listed in Playwright’s getting-started guide.
  • An MCP-compatible client. Playwright documents setup options for clients including VS Code, Cursor, Claude Code, and Claude Desktop. Follow the current instructions for your specific client; file locations and configuration steps differ.
  • A browser installation. Playwright says the browser is downloaded automatically on first use.

The quick-start launch command uses npx @playwright/mcp@latest. Because @latest can resolve to a newer package over time, check Playwright’s current documentation if an option or client configuration shown there differs from what your installation accepts.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
CanaKit Raspberry Pi 5 Starter Kit PRO - Turbine Black (128GB Edition) (8GB RAM)
  • Includes Raspberry Pi 5 with 2.4Ghz 64-bit quad-core CPU (8GB RAM)
  • Includes 128GB Micro SD Card pre-loaded with 64-bit Raspberry Pi OS, USB MicroSD Card Reader
  • CanaKit Turbine Black Case for the Raspberry Pi 5
  • CanaKit Low Noise Bearing System Fan
  • Mega Heat Sink - Black Anodized

Connect an MCP client to Playwright MCP

In the client’s MCP server settings, add a server entry that invokes the package through npx. The basic command is:

npx @playwright/mcp@latest

A representative configuration has a server name and command with arguments. The exact JSON shape and the place to save it depend on your MCP client, so treat this as the command to adapt rather than a universal client configuration file:

{
  "mcpServers": {
    "playwright": {
      "command": "npx",
      "args": ["@playwright/mcp@latest"]
    }
  }
}
  1. Confirm that your client supports MCP servers and open its MCP or developer settings.
  2. Add a server entry using the client’s documented configuration format, with npx as the command and @playwright/mcp@latest as an argument.
  3. Save the configuration and restart or reload the client if its instructions require it.
  4. Check that the client reports the Playwright server as connected and its browser tools as available.
  5. Ask the client to perform a bounded test, such as Playwright’s documented example: “Navigate to https://demo.playwright.dev/todomvc and add a few todo items.”

If the command starts but the client cannot discover tools, check the client’s configuration syntax and logs before changing browser settings. A client may expect a different configuration location or server-launch format than another MCP client.

Choose how the browser should run

Browser mode affects visibility, browser engine, and whether the server starts a browser or works with an existing one. Playwright documents the following choices; they are specific to its implementation and may vary as its options evolve.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
CanaKit Raspberry Pi 4 4GB Starter PRO Kit - 4GB RAM
  • Includes Raspberry Pi 4 4GB Model B with 1.5GHz 64-bit quad-core CPU (4GB RAM)
  • Includes Pre-Loaded 32GB EVO+ Micro SD Card (Class 10), USB MicroSD Card Reader
  • CanaKit Premium High-Gloss Raspberry Pi 4 Case with Integrated Fan Mount, CanaKit Low Noise Bearing System Fan
  • CanaKit 3.5A USB-C Raspberry Pi 4 Power Supply (US Plug) with Noise Filter, Set of Heat Sinks, Display Cable - 6 foot (Supports up to 4K60p)
  • CanaKit USB-C PiSwitch (On/Off Power Switch for Raspberry Pi 4)
Choice What it means When it fits
Headed (default in the getting-started guide) The browser runs with a visible window. Useful while observing or debugging an interaction locally.
Headless Pass --headless to run without a visible browser window. Useful when a visible window is not needed.
Browser engine Documented choices include Chrome, Firefox, WebKit, and Microsoft Edge. Select the engine relevant to the site or testing task.
Standalone HTTP server A documented server mode for situations such as headed browser operation without a display or use from IDE worker processes. Use the target client’s current instructions for connecting to this mode.

The guide documents --headless as the switch for headless operation. Consult the current Playwright setup guide for the exact browser-selection option and client-specific configuration rather than assuming a flag or JSON key across all versions.

Choose the right browser session and profile

Session mode determines whether browser state is reused. This is a practical security choice as well as a convenience: a persistent profile may already be logged in to sites, while an isolated session is intended to start fresh.

Mode State behavior Practical use
Persistent Documented default; preserves login state and cookies. Tasks that intentionally need an existing signed-in session. Protect access to that profile.
Isolated Starts a fresh session and can load initial storage state. Tasks where separation from an existing browser profile matters.
Extension Can attach to existing browser tabs and reuse the logged-in profile. Tasks that need to operate in tabs already open in a browser.

Playwright documents these modes in its browser context documentation and browser extension documentation. Check the current option names and setup steps there before configuring a particular mode. Do not give an agent access to an authenticated profile unless the task requires it and the connecting client is trusted.

Connect to an existing or remote browser

Starting a new browser process is not the only documented option. Playwright describes ways to connect to Chrome or Edge by channel, connect to Chromium using a Chrome DevTools Protocol (CDP) endpoint, connect to an existing Playwright server endpoint, or use its browser extension.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
ELECROW CrowPi Case Kit for Raspberry Pi 5, 9-Inch Display
  • Not including the Raspberry Pi 5 (8GB), the Crowpi advanced version comes with the Raspberry Pi 5
  • ELECROW Black Case for the Raspberry Pi 5, CrowPi is equipped with a 9-inch HD touchscreen along with a camera; All the regular components used in DIY electronics are packed into the CrowPi development board, such as LCD, LED matrix, buzzer, light sensor, PIR sensor, ultrasonic sensor, IR sensor, etc
  • Raspberry Pi Sensors: The Crowpi raspberry pi 5 programming kit is jam-packed with lots of buttons such as 19 different sensors in a tidy easy to use package; You don't have to wait and wire things
  • Build Quality: Solid ABS shell and well made components in one place make it strong and convenient to travel
  • Programming Lessons: This raspberry pi 5 learning kit ships with step by step instructions and provides 21 lessons to take you through identifying components reading code and running it in the terminal

The CDP connection approach is documented as potentially working with Chrome or Chromium, Edge, Electron apps, and cloud browser services. That establishes compatibility language, not a recommendation of a particular provider or its terms, price, or reliability. See Playwright’s remote browser connection guidance for the relevant connection modes.

Security: treat browser access as access to real accounts and data

A browser-automation agent can interact with pages using the permissions and session state available to its browser. Persistent sessions preserve cookies and login state, and extension mode can reuse an existing logged-in profile. Limit which clients can connect and use an isolated context when a task does not need existing credentials.

Playwright explicitly cautions: “Origin lists and the file-access guardrail are convenience defenses to catch unintended access, not a security boundary — they do not affect redirects and can be worked around deliberately.” Its secret-value redaction is also a convenience, not a security boundary. Do not treat origin restrictions, file-access checks, or redaction as guarantees against deliberate misuse, redirects, or access by an untrusted client. The details are in Playwright’s security considerations.

Also treat the browser_run_code_unsafe tool as a high-risk capability: Playwright warns that it executes arbitrary JavaScript in the server process and is RCE-equivalent. Enable it only for trusted MCP clients, and do not expose the server to clients that should not have that level of access. This warning is in the getting-started guide.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
CanaKit Raspberry Pi 5 Desktop PC with SSD (Fully Assembled) (256 GB SSD)
  • Fully assembled for plug-and-play operation
  • Includes Raspberry Pi 5 with 8GB RAM
  • 256 GB PCIe Pi NVMe SSD (Pre-loaded with Pi 64-Bit OS)
  • M.2 HAT+
  • CanaKit Turbine Black Case for the Pi 5

Or skip the browser setup

If your job is to capture a website screenshot rather than let an agent interact with a live browser, ScreenshotNeo is a direct screenshot API and MCP server from Yorker Media. One GET request returns a PNG, JPEG, WebP, or PDF. For example, cURL can save a WebP screenshot of Stripe:

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

See the ScreenshotNeo API documentation for request options. ScreenshotNeo accepts cookie or consent banners before capture and removes more than 60 known consent platforms, newsletter popups, and chat widgets; each of those steps can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits cost nothing, with the response identifying the page verdict and billing status in headers. Its MCP server gives AI agents tools including take_screenshot, get_page_info, and capture_pdf. The Free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000 shots.

Sign up for 1,000 free screenshots a month with no card.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Troubleshooting Playwright MCP

The client does not show a connected server

  • Check that Node.js 20 or newer is installed and available to the client process, not just your interactive terminal.
  • Verify the client’s required configuration location, syntax, command, and argument format. The documented launch command is npx @playwright/mcp@latest, but client-specific setup differs.
  • Restart or reload the client if required, then inspect its MCP logs for a launch or protocol error.

The browser does not appear or cannot start

  • Remember that headed mode is the documented default; use --headless when a visible display is unavailable and headless operation suits the task.
  • Allow the documented first-use browser download to finish. If it cannot complete, check the environment’s network and installation restrictions.
  • For a remote or already-running browser, use the matching documented channel, endpoint, or extension workflow instead of expecting the default launch to attach to it.

The agent is not logged in, or has unexpected cookies

  • Check whether the configured mode is persistent, isolated, or extension-based. Persistent and extension modes can reuse existing state; isolated mode starts fresh and can load initial storage state.
  • Use an isolated session if the task should not inherit a profile’s cookies or login. Avoid switching to a personal authenticated profile just to work around a session mismatch.

A page or redirect is reachable despite an origin restriction

Do not assume an origin list or file-access guardrail blocks every route: Playwright says these are convenience defenses and do not affect redirects. Restrict trusted clients and browser-profile access; do not use these options as a security boundary.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The client asks to run arbitrary browser code

Decline to enable browser_run_code_unsafe for an untrusted client. Playwright describes it as arbitrary JavaScript execution in the server process and RCE-equivalent.

Best Value
RasTech Raspberry Pi 5 8GB Kit with Active Cooler and Pi5 Case
  • 【What you Get】You will get 1*Pi 5 8GB Single Board,1*RasTech Case,1*Active Cooler,1*Screwdriver,1*Installation instructions,12-month free warranty, lifetime service, 24-hour prompt and friendly response.
  • 【More Connectors】There are two USB 3.0 ports(5Gbps simultaneously) and two USB 2.0 ports, which triple total bandwidth ,support any combination of up to two cameras or displays. Peak SD card performance is doubled through support for the SDR104 high-speed mode. It provides a smooth desktop experience for you. Offer Gigabit Ethernet and a PCIe interface, along with dual-band Wi-Fi and Bluetooth 5.0/BLE wireless capability. The RasTech Pi 5 Kit use the new 27W 5.1V 5A USB-C power connector.
  • 【 Support Dual 4Kp60 Display 】Each of the two microHDMI sockets can control a 4K display at 60 Hertz, now support HDR, offering super HD video for media streaming projects. RPi 5 is the first RPi model that comes with a PCI Express port (PCIe 2.0 x1 with 500 MB/s) to attach SSDs (requires separate M.2 HAT).
  • 【 Excellent Chips And Applications】Pi 5 is a full-size Pi computer using silicon built in-house at Pi. The RP1 “southbridge” provides the bulk of the I/O capabilities for Pi 5. Pi 5 is more friendly and convenient in the development of Internet of Things, Web development, machine identification, automatic control and other electronic equipment applications and network.
  • 【 Faster CPU, Better GPU 】 Pi 5 features a Broadcom BCM2712 64-bit quad-core Arm Cortex-A76 processor running at 2.4GHz, it delivers a 2–3× increase in CPU performance relative to RaspberryPi 4. The 800MHz VideoCore VII GPU is compatible to OpenGL ES 3.1 and Vulkan 1.2, substantial uplift in graphics performance. Pi 5 Offers lightning-fast CPU speed, a PCI Express interface, a Real Time Clock (RTC) and a power button and runs significantly cooler than Pi 4.

FAQ

Does the basic Playwright MCP workflow require a vision model?

No. The documented workflow uses structured accessibility snapshots for the model to identify and interact with page elements; the quick start does not require a vision model.

Can Playwright MCP connect to an Electron application?

Playwright documents its CDP connection approach as compatible with Electron apps, along with Chrome or Chromium, Edge, and cloud browser services. The exact connection setup depends on the target browser or application.

Does every MCP browser server use these same options?

No. These setup steps, session modes, and security notes describe Playwright MCP. Other servers can expose different tools and configuration choices.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Quick Recap

Bestseller No. 1
CanaKit Raspberry Pi 5 Starter Kit PRO - Turbine Black (128GB Edition) (8GB RAM)
CanaKit Raspberry Pi 5 Starter Kit PRO - Turbine Black (128GB Edition) (8GB RAM)
Includes Raspberry Pi 5 with 2.4Ghz 64-bit quad-core CPU (8GB RAM); CanaKit Turbine Black Case for the Raspberry Pi 5
$259.95
Bestseller No. 2
CanaKit Raspberry Pi 4 4GB Starter PRO Kit - 4GB RAM
CanaKit Raspberry Pi 4 4GB Starter PRO Kit - 4GB RAM
Includes Raspberry Pi 4 4GB Model B with 1.5GHz 64-bit quad-core CPU (4GB RAM); Includes Pre-Loaded 32GB EVO+ Micro SD Card (Class 10), USB MicroSD Card Reader
$159.99
Bestseller No. 4
CanaKit Raspberry Pi 5 Desktop PC with SSD (Fully Assembled) (256 GB SSD)
CanaKit Raspberry Pi 5 Desktop PC with SSD (Fully Assembled) (256 GB SSD)
Fully assembled for plug-and-play operation; Includes Raspberry Pi 5 with 8GB RAM; 256 GB PCIe Pi NVMe SSD (Pre-loaded with Pi 64-Bit OS)
$339.97

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.