October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan NowOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
AI agents

How to Set Up an MCP Server for Browser Access with Playwright

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

To set up browser access through the Model Context Protocol (MCP), install Node.js 20 or newer, use an MCP-compatible client, and register Playwright MCP with npx. Add the server configuration below, start with its default headed browser, then select headless mode, another browser engine, an isolated profile, an existing browser session, or a separate HTTP endpoint only when your workflow requires it.

What this setup provides

Playwright MCP is an MCP server that gives an AI client browser-automation capabilities. It lets a model navigate pages and interact with controls through structured accessibility snapshots rather than relying only on screenshots or coordinate clicks. The server can launch a browser, reuse a browser profile, attach to a running browser, or expose an HTTP MCP endpoint.

The instructions in this guide are specific to Playwright MCP. Other MCP browser servers can use different packages, options, transports, and configuration formats.

Prerequisites

  • Node.js 20 or newer. Confirm the installed version with node --version.
  • An MCP-compatible host. Examples documented by the Playwright project include VS Code, Cursor, Claude Code, and Claude Desktop. Each host decides where its MCP configuration lives and how the server is enabled.
  • A browser supported by your selected mode. The documented choices include Chromium/Chrome, Firefox, WebKit, and Microsoft Edge.

Do not assume that one configuration-file path works everywhere. Open your client’s current MCP setup instructions and use its documented file location or settings screen.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Sale
Logitech M185 Compact Ambidextrous 2.4 GHz Wireless Mouse - Swift Grey
  • Compact Mouse: With a comfortable and contoured shape, this Logitech ambidextrous wireless mouse feels great in either right or left hand and is far superior to a touchpad
  • Durable and Reliable: This USB wireless mouse features a line-by-line scroll wheel, up to 1 year of battery life (2) thanks to a smart sleep mode function, and comes with the included AA battery
  • Universal Compatibility: Your Logitech mouse works with your Windows PC, Mac, or laptop, so no matter what type of computer you own today or buy tomorrow your mouse will be compatible
  • Plug and Play Simplicity: Just plug in the tiny nano USB receiver and start working in seconds with a strong, reliable connection to your wireless computer mouse up to 33 feet / 10 m (5)
  • Better than touchpad: Get more done by adding M185 to your laptop; according to a recent study, laptop users who chose this mouse over a touchpad were 50% more productive (3) and worked 30% faster (4)

Add the standard Playwright MCP server

The smallest documented configuration starts a browser under MCP control when the client needs it:

{
  "mcpServers": {
    "playwright": {
      "command": "npx",
      "args": ["@playwright/mcp@latest"]
    }
  }
}
  1. Open your MCP client’s server configuration UI or file.
  2. Add the playwright entry, preserving the command and args values shown above.
  3. Save the configuration and restart or reload the client if it does not discover the server automatically.
  4. Ask the assistant to open the Playwright TodoMVC demonstration and add a couple of items. This first task verifies that the client can start the server, create a browser context, read an accessibility snapshot, and act on the resulting element references.

The default documented mode is headed, so a browser window normally appears. That is useful during initial setup because you can see navigation, consent dialogs, authentication prompts, and other state changes.

Choose how the browser runs

Headless execution

Add --headless to the argument list when the machine has no display or you do not need to watch the session:

{
  "mcpServers": {
    "playwright": {
      "command": "npx",
      "args": ["@playwright/mcp@latest", "--headless"]
    }
  }
}

Headless is a browser-display mode; it does not change the MCP protocol or turn the server into an HTTP service. Validate your workflow in headed mode first when diagnosing navigation or login problems.

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

Select a browser engine

Use the --browser option when compatibility with a particular engine matters. For example, this selects Firefox:

{
  "mcpServers": {
    "playwright": {
      "command": "npx",
      "args": ["@playwright/mcp@latest", "--browser=firefox"]
    }
  }
}

Chrome, Firefox, WebKit, and Microsoft Edge are documented choices. Pick the engine that matches the site you are testing or the browser behavior you need; no engine is universally best for every site.

Rank #2
Sale
Logitech G305 Lightspeed Wireless Gaming Mouse - Black
  • The next-generation optical HERO sensor delivers incredible performance and up to 10x the power efficiency over previous generations, with 400 IPS precision and up to 12,000 DPI sensitivity
  • Ultra-fast LIGHTSPEED wireless technology gives you a lag-free gaming experience, delivering incredible responsiveness and reliability with 1 ms report rate for competition-level performance
  • G305 wireless mouse boasts an incredible 250 hours of continuous gameplay on just 1 AA battery; switch to Endurance mode via Logitech G HUB software and extend battery life up to 9 months
  • Wireless does not have to mean heavy, G305 lightweight mouse provides high maneuverability coming in at only 3.4 oz thanks to efficient lightweight mechanical design and ultra-efficient battery usage
  • The durable, compact design with built-in nano receiver storage makes G305 not just a great portable desktop mouse, but also a great laptop travel companion, use with a gaming laptop and play anywhere

Decide whether to reuse browser state

Persistent profile

A persistent profile retains cookies and login state between runs. It is appropriate for a dedicated automation profile that you control and can protect. Because the profile contains session data, restrict access to the machine and profile directory.

Isolated sessions

Use --isolated when each run should begin with a fresh context instead of sharing persistent cookies and storage. Isolation is useful for repeatable tests and for reducing accidental access to a personal browsing profile.

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

Connect to an existing Chrome or Edge session

The documented channel or CDP approaches can attach to a browser that is already running, but the browser must have remote debugging enabled for the relevant flow. This is different from launching a new browser: the MCP server is connecting to an existing process and its available tabs.

Use the browser-channel or CDP settings from the current Playwright MCP configuration documentation for your exact launch command. Keep the debugging interface bound to a trusted local interface unless you have deliberately designed and secured remote access.

Extension mode

Enable --extension when you need the server to work with existing tabs, the current profile, installed extensions, or an already authenticated session. This can simplify SSO and two-factor-authentication workflows, but it also gives the MCP-controlled assistant access to the connected session’s cookies, pages, and extensions. Treat extension mode as a high-sensitivity operation, not as a general-purpose shortcut.

Connect to a Playwright browser server

If a browser is already exposed by a Playwright server, use --endpoint with that server’s WebSocket endpoint. A WebSocket endpoint identifies the browser connection; it is not the same thing as the HTTP URL that an MCP client uses to reach an MCP server.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
Logitech M185 Compact Ambidextrous Wireless Mouse with Rubber Grips - Blue
  • Compact Mouse: With a comfortable and contoured shape, this Logitech ambidextrous wireless mouse feels great in either right or left hand and is far superior to a touchpad
  • Durable and Reliable: This USB wireless mouse features a line-by-line scroll wheel, up to 1 year of battery life (2) thanks to a smart sleep mode function, and comes with the included AA battery
  • Universal Compatibility: Your Logitech mouse works with your Windows PC, Mac, or laptop, so no matter what type of computer you own today or buy tomorrow your mouse will be compatible
  • Plug and Play Simplicity: Just plug in the tiny nano USB receiver and start working in seconds with a strong, reliable connection to your wireless computer mouse up to 33 feet / 10 m (5)
  • Better than touchpad: Get more done by adding M185 to your laptop; according to a recent study, laptop users who chose this mouse over a touchpad were 50% more productive (3) and worked 30% faster (4)

Run Playwright MCP as a separate HTTP server

Some IDE workers, display-less machines, and remote arrangements work better when the MCP server runs independently. Start it on a port:

npx @playwright/mcp@latest --port 8931

Then configure the client to use the MCP endpoint:

{
  "mcpServers": {
    "playwright": {
      "url": "http://localhost:8931/mcp"
    }
  }
}

Use the host name that is reachable from the MCP client. If the client and server are in different containers, virtual machines, or computers, localhost may refer to the wrong machine. Proxies and long-lived connections can also require heartbeat-related host settings documented by the client and Playwright MCP. Do not expose this endpoint publicly without an access-control and network design appropriate to the browser session it controls.

A practical configuration decision table

Requirement Documented approach Important consequence
Start a new browser Standard npx configuration Headed mode is the default and is easiest to observe.
No visible window Add --headless Useful on servers; troubleshoot first with a visible browser.
Use another engine --browser=firefox or another documented engine Behavior can differ by browser, so test the target engine.
Keep login state Persistent profile Cookies and authenticated sessions remain available to later runs.
Start clean --isolated Fresh context improves repeatability and limits shared state.
Reuse current tabs --extension Existing cookies, extensions, and authenticated pages become available.
Attach to a running browser Browser channel or CDP endpoint Remote debugging must be enabled for the documented channel flow.
Connect through a separate service --port, then the /mcp URL Hostname, proxy, and heartbeat behavior affect connectivity.

Security boundaries you should not overestimate

Playwright MCP documents origin lists, a file-access guard, and secret-redaction features as convenience defenses. They are intended to catch mistakes, not to provide complete isolation or a security boundary. Origin lists do not control redirects and can be deliberately worked around. Secret redaction should not replace proper secret storage, least-privilege credentials, network controls, or a separate automation account.

  • Use an isolated profile for untrusted or repeatable tasks.
  • Do not connect a personal browser profile unless the assistant genuinely needs its authenticated state.
  • Keep CDP and HTTP listeners off public interfaces unless they are protected by a deliberate authentication and network policy.
  • Give automation accounts only the site permissions required for the task.
  • Review the pages and tabs exposed when extension mode is enabled.

Troubleshooting

The client cannot find the server

Check JSON syntax, the exact package name, and whether the client requires a restart or an explicit enable action. Confirm Node.js is 20 or newer and run npx @playwright/mcp@latest in a terminal to reveal installation or permission errors.

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.

The browser never appears

Look for --headless in the arguments, then remove it for an interactive test. On a remote machine, a missing display can also require headless mode rather than a headed launch.

Login state is missing

A new or isolated context will not contain cookies from another profile. Use a properly managed persistent profile, or use extension mode when connecting to the already authenticated browser is intentional. Verify that the client is connecting to the expected browser process rather than starting a fresh one.

Rank #4
Amazon Basics 3-Button USB Wired Mouse with Responsive Tracking, Plug & Play, Compatible with Windows and Mac, Black
  • Computer mouse for easily navigating a computer interface; click, scroll, and more
  • USB-A wired connection; if existing device only supports USB-C, an additional adapter will be required
  • High-definition (1000 dpi) optical tracking ensures responsive cursor control for precise tracking and easy text selection
  • 3 buttons offer effortless fingertip control
  • Plug-and-go ready for instant use

Existing tabs are unavailable

Attaching to a running browser requires the documented remote-debugging or extension setup. A normal browser launch without that connection mechanism does not automatically expose its tabs to MCP.

The HTTP client cannot connect

Confirm that the server is still running on port 8931, that the client can resolve the configured hostname, and that the URL ends in /mcp. In containers or virtual machines, replace localhost with the address visible from the client. Check proxy timeouts and heartbeat settings for long sessions.

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

Actions target the wrong element

Ask the assistant to inspect the current page or accessibility snapshot again before acting. Dynamic pages can replace element references after navigation, a dialog, or a state update; a fresh snapshot gives the model current structure and references.

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

Reliability and operating-cost considerations

The standard npx configuration is the simplest starting point because it avoids maintaining a separately addressed server. An HTTP deployment can separate the browser host from an IDE or agent, but it adds network, proxy, process-lifecycle, and endpoint-security concerns.

Headed mode consumes a display-capable environment; headless mode is usually more practical for unattended workers. Persistent profiles reduce repeated logins but increase the sensitivity and cleanup burden of the machine. Isolated contexts improve repeatability but require the workflow to handle authentication deliberately. Extension mode can save setup time for SSO, while exposing more of an existing session.

The package is invoked through npx, so pin or review the package version in environments where reproducibility matters rather than allowing an unreviewed update to change behavior unexpectedly. Recheck the current Playwright MCP documentation before deploying because client configuration conventions and command-line options can change.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Acer Wireless Mouse for Laptop, 2.4GHz Computer Mouse 3 Adjustable 1600 DPI
  • 【Plug and Play for Home/Office/School】The wireless computer mouse features 2.4GHz connectivity, delivering a stable, interference-free connection up to 32ft. Designed for 𝐦𝐞𝐝𝐢𝐮𝐦 𝐭𝐨 𝐥𝐚𝐫𝐠𝐞 𝐬𝐢𝐳𝐞𝐝 𝐡𝐚𝐧𝐝𝐬, it ensures comfortable use all day. Simply plug in the USB-A receiver for instant pairing—no drivers needed. 📌📌 If the mouse isn’t suitable, place the USB receiver in the battery compartment and return both.
  • 【3 Levels Adjustable DPI】This travel USB mouse offers 3 adjustable DPI settings (800, 1200, 1600), allowing you to customize sensitivity for precise design work. Effortlessly switch to match your task and elevate your productivity. 📌 Please remove the film at the bottom of the mouse before use.
  • 【Effortless Browsing】Equipped with forward and backward buttons, this computer mice streamlines your workflow, making it easy to navigate through web pages and files with a simple click. 📌Side button does not work on Mac.
  • 【Visible Indicator Light】 The pc mouse features a visual indicator for DPI levels and low battery alerts. The red light flashes once for 800 DPI, twice for 1200 DPI, and three times for 1600 DPI. When the battery level is below 10%, the light flashes red until the mouse is completely out of power.
  • 【Click to Wake】With smart sleep mode, it saves power by standby after 10 inactive minutes, just 2-3 clicks to wake. This efficient design delivers 3x longer battery life than motion-wake mice. Engineered for durability, its buttons and scroll wheel are tested for 10 million clicks, ensuring long-term reliability and consistent performance.

Or skip the browser setup

If your goal is a clean website image or PDF rather than interactive browser control, ScreenshotNeo provides a single-request screenshot API and an MCP server for AI clients such as Claude and Cursor. It removes cookie-consent banners, newsletter popups, and chat widgets before capture; bot checks, blank pages, failed loads, timeouts, and cache hits are not billed, and the response identifies the page and billing result in headers.

Use the API directly with cURL:

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

Python:

import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)

Node.js:

const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);

See the complete options and response details in the ScreenshotNeo documentation. The service supports PNG, JPEG, WebP, and PDF output, full-page captures with lazy images, CSS-selector element shots, device and viewport settings, dark mode, custom CSS and JavaScript, waits, blocking rules, headers and cookies, geolocation and timezone, signed links, asynchronous webhooks, bulk capture, caching, and an MCP server with take_screenshot, get_page_info, and capture_pdf tools.

Free accounts include 1,000 screenshots a month with no card. Paid plans start at $5 for 3,000 shots, and every feature is available on every plan. Create a free ScreenshotNeo account.

FAQ

Does Playwright MCP require a separate browser-server computer?

No. The documented standard configuration launches the MCP package with npx; it does not require dedicated browser-server hardware.

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

Is the HTTP MCP URL the same as a CDP endpoint?

No. The HTTP URL, such as http://localhost:8931/mcp, is for an MCP client. A CDP or Playwright WebSocket endpoint connects to a browser process.

Should I use extension mode for every logged-in site?

No. Use it only when reusing the existing authenticated browser is intentional, because the connected session, cookies, tabs, and extensions are then within the automation context.

Frequently Asked Questions

Can I use a different MCP client from the examples?

Yes. The server protocol is client-independent, but the configuration location and user interface are determined by the client, so follow that client’s current MCP instructions.

What is the safest starting profile for a repeatable task?

Start with the default headed launch to verify behavior, then use an isolated context for runs that should not share cookies or storage.

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

Quick Recap

SaleBestseller No. 1
Logitech M185 Compact Ambidextrous 2.4 GHz Wireless Mouse - Swift Grey
Logitech M185 Compact Ambidextrous 2.4 GHz Wireless Mouse - Swift Grey
Product carbon footprint: 3.97 kg CO2e; Contoured shape: Gives you more comfort and control
$14.90
SaleBestseller No. 3
Bestseller No. 4
Amazon Basics 3-Button USB Wired Mouse with Responsive Tracking, Plug & Play, Compatible with Windows and Mac, Black
Amazon Basics 3-Button USB Wired Mouse with Responsive Tracking, Plug & Play, Compatible with Windows and Mac, Black
Computer mouse for easily navigating a computer interface; click, scroll, and more; 3 buttons offer effortless fingertip control
$9.70

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.

Leave a Reply

Your email address will not be published. Required fields are marked *

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.

Read next

Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
PC Slower Than It Used to Be?Free scan - under a minute

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.