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

Set Playwright MCP’s browser on the MCP server, not in a prompt or in your automation code. Add --browser=<value> to the server’s args array. For example, this configuration starts Firefox:

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

The supported command-line values are chrome, firefox, webkit and msedge. Google Chrome is used when you do not specify a browser.

Choose the browser in your MCP server configuration

Playwright MCP reads browser selection when its server process starts. Put the browser flag in the Playwright server’s argument list, then restart the MCP client so it launches a new server with that setting.

Chrome

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

Firefox

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

WebKit

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

Microsoft Edge

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

The surrounding JSON differs between Claude Desktop, Cursor, VS Code and other MCP clients. Keep the --browser=... item inside the Playwright server’s args array and follow your client’s rules for the outer configuration file.

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.

Change the browser with an environment variable

The Playwright MCP README also documents PLAYWRIGHT_MCP_BROWSER. Set it in the environment inherited by the MCP server:

PLAYWRIGHT_MCP_BROWSER=firefox

This is useful when the same MCP configuration is deployed to several machines or environments. You can switch browsers without editing the client’s JSON. A command-line flag is more explicit and overrides the environment value when both are present.

Use an advanced JSON configuration file

For reusable settings, start the server with --config path/to/config.json. In that file, the browser is selected under the browser object:

{
  "browser": {
    "browserName": "firefox"
  }
}

The configuration schema accepts chromium, firefox and webkit for browserName. Notice the naming difference: the CLI uses chrome and msedge, while the JSON schema uses the Playwright engine name chromium rather than the Chrome channel name.

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

Configuration precedence

When a value is supplied in more than one place, Playwright MCP applies settings in this order:

  1. JSON configuration file
  2. Environment variables
  3. Command-line arguments

The later source wins. Therefore, --browser=firefox in args overrides both an environment value and the JSON file.

Browser choice is separate from headed mode

Selecting Firefox or WebKit does not decide whether a window is visible. Playwright MCP runs headed by default. Add --headless when the server must run without a visible browser:

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

Headed mode requires a graphical display. On a server, container or IDE worker without one, use headless mode or run the MCP server separately over HTTP and configure the client to connect to that process.

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

Browser selection does not control profile state

The browser engine and the session profile are independent settings. Persistent profile mode is the default, so logins and cookies can remain available between runs.

Start a clean session

Add --isolated to create a fresh session instead of using the persistent profile:

["@playwright/mcp@latest", "--browser=chrome", "--isolated"]

Load cookies and local storage

Use --storage-state when an isolated run should begin with saved authentication state. The supplied state file must be valid for the target site.

Choose a profile directory

--user-data-dir selects the directory used for a persistent profile. Keep separate directories when different MCP projects need different cookies or extensions, and do not let two browser processes write the same profile simultaneously.

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

Attach to a browser that is already running

Launching a new browser is simplest when a clean, reproducible session is wanted. Connection mode is better when you must retain an existing login, installed extension, open tabs or cookies. Playwright MCP documents several connection methods:

  • Browser channels for installed browsers
  • Chrome DevTools Protocol (CDP) endpoints
  • Playwright server endpoints
  • The Playwright browser extension

The extension can reuse an existing logged-in session, including its cookies, extensions and tabs. Use --profile-dir-name to select the browser profile when that connection method supports profiles. Attaching to an existing browser is different from setting a default engine: the connection target and its running browser determine what is controlled.

Which setting should you use?

Method Best for Important behavior
--browser=... A clear per-server default Command-line value has highest precedence
PLAYWRIGHT_MCP_BROWSER Process- or environment-specific deployments Overridden by a command-line flag
Config file browser.browserName Reusable advanced configuration Uses chromium, firefox or webkit
Connection mode An already-running browser and its existing state Does not launch an independent clean session

Verify that the requested browser is actually running

  1. Stop or reload the MCP server in your client.
  2. Check the server’s startup output for launch or connection errors.
  3. Use a simple navigation and inspect the browser window or page behavior.
  4. If the result is unexpected, remove duplicate browser settings and test with only one source, preferably the command-line flag.

Remember that chrome identifies the Chrome channel, while chromium belongs in the advanced JSON schema. Using the wrong spelling in the wrong location is a common cause of startup failure.

Troubleshooting

The browser does not change

Cause: The MCP client is still using an existing server process, or a higher-precedence argument overrides your environment or config-file value.

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.

Fix: Restart the MCP server, inspect its complete args array, and remove conflicting --browser flags.

“Unknown browser” or an invalid-value error

Cause: A CLI name was placed in the JSON schema, or an unsupported value was typed.

Fix: Use chrome, firefox, webkit or msedge on the command line. Use chromium, firefox or webkit for browser.browserName.

Headed mode fails on a server

Cause: No display is available.

Fix: Add --headless, provide a display, or run the headed MCP server separately with HTTP transport and connect the client to it.

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

Login state disappeared

Cause: --isolated creates a new session, or the server is using a different --user-data-dir.

Fix: Remove --isolated for persistent state, select the intended profile directory, or provide --storage-state when an isolated run is required.

The server cannot start a browser

Cause: The selected browser or its Playwright binaries are unavailable to the server process.

Fix: Confirm that the MCP package and required browser installation are available in the same environment that runs npx. In remote or containerized setups, check the server process rather than the desktop client.

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

Two projects interfere with each other

Cause: Both processes share one persistent profile directory.

Fix: Assign a separate --user-data-dir to each project, or use --isolated for independent runs.

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

Performance and reliability considerations

Browser choice should follow the site and workflow you need to reproduce, not an assumption that one engine is universally best. A clean launch with an isolated profile improves repeatability but requires signing in or loading storage state again. A persistent profile saves setup time for interactive work but also carries cookies, extensions and other state into later tasks.

For unattended workers, headless mode avoids display dependencies. For debugging visual behavior, headed mode makes the active page and navigation visible. If a task depends on a browser already open with a particular extension or account, use a documented connection method instead of trying to recreate that state with a new launch.

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

Or skip the browser setup

If your goal is simply to obtain a reliable website image rather than operate a browser through MCP, ScreenshotNeo provides a single HTTP request. It accepts consent banners before capture and removes more than 60 known consent platforms, newsletter popups and chat widgets; each cleanup step can be disabled. Only clean shots are billed: bot checks or CAPTCHAs, blank pages, timeouts, failed loads and cache hits cost nothing, and the response identifies the result with X-Page-Verdict and X-Billed headers. Its MCP server exposes take_screenshot, get_page_info and capture_pdf for Claude, Cursor and other MCP clients.

For the full option list and request parameters, see the ScreenshotNeo documentation.

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}`);

ScreenshotNeo includes full-page and selector captures, device presets, custom viewport and retina scale, PDF output, custom CSS and JavaScript, waits, request blocking, headers, cookies, user agents, timezone and geolocation controls, resizing, TTL caching, signed links, asynchronous webhooks, bulk capture and a usage API. Every feature is included on every plan. The Free plan provides 1,000 shots per month without a card; paid plans start at $5 for 3,000 shots. Create a free ScreenshotNeo account to try it.

Frequently Asked Questions

Can I change the browser from an MCP conversation?

No. Browser selection is a server launch setting. Change the server arguments, environment or config file, then restart the MCP server.

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

Is WebKit the same as Safari?

WebKit is Playwright’s browser engine option. The MCP CLI exposes it as webkit; the setting does not install or control Apple’s Safari application.

Should I use a persistent profile in CI?

Usually not. CI runs are more reproducible with --isolated and an explicit storage-state file when authentication is required.

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.