Skip to main content
MCP server CX Codex

playwright-stealth — Claude Code MCP server for browser automation

Let an agent control a Playwright browser, capture page images, and record sessions. Stealth behavior is an optional setting.

Install into Claude Code · Platform CLI All methods and platforms ↓
claude mcp add --env STEALTH_MODE=<STEALTH_MODE> --env STEALTH_USER_AGENT=<STEALTH_USER_AGENT> --env STEALTH_MASK_LINUX=<STEALTH_MASK_LINUX> --env STEALTH_LOCALE=<STEALTH_LOCALE> --env HEADLESS=<HEADLESS> --transport stdio playwright-stealth -- npx -y playwright-stealth-mcp-server
Open on GitHub

What playwright-stealth does

The server exposes Playwright code execution through browser_execute, with the current page object available to the code. Browser state persists between calls, so an agent can carry out a multi-step flow. Separate tools report browser state, capture screenshots, and start or stop WebM recording.

Set STEALTH_MODE to enable the optional stealth layer, which relies on playwright-extra and a stealth plugin. Environment variables also control proxy settings and browser behavior. Headless operation and ignoring HTTPS certificate errors are the defaults; set IGNORE_HTTPS_ERRORS to false when certificate validation should be stricter. All browser permissions are granted by default, so review that setting before using the server with a live site.

What it helps with

  • run Playwright actions on a web page
  • keep browser state across consecutive agent calls
  • capture a full page or selected element
  • save a browser session as a WebM recording
  • inspect the active browser URL and title

Example prompts for the agent

  • Open the sign-in page and return its title using Playwright.
  • Capture a screenshot of the element selected by #main-content.
  • Record the browser interaction and save the WebM video.

How to install playwright-stealth

Platform CLI

claude mcp add --env STEALTH_MODE=<STEALTH_MODE> --env STEALTH_USER_AGENT=<STEALTH_USER_AGENT> --env STEALTH_MASK_LINUX=<STEALTH_MASK_LINUX> --env STEALTH_LOCALE=<STEALTH_LOCALE> --env HEADLESS=<HEADLESS> --transport stdio playwright-stealth -- npx -y playwright-stealth-mcp-server

Replace <…> with your own values. 10 more environment variables are in the server README

Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more

Questions about playwright-stealth

How do I install playwright-stealth in Claude Code?

Run `claude mcp add --env STEALTH_MODE=<STEALTH_MODE> --env STEALTH_USER_AGENT=<STEALTH_USER_AGENT> --env STEALTH_MASK_LINUX=<STEALTH_MASK_LINUX> --env STEALTH_LOCALE=<STEALTH_LOCALE> --env HEADLESS=<HEADLESS> --transport stdio playwright-stealth -- npx -y playwright-stealth-mcp-server`.

What does playwright-stealth do?

It gives an agent browser automation through Playwright. The agent can run code against the page, take screenshots, and record browser activity.

How can I use a proxy with the server?

Configure PROXY_URL, PROXY_USERNAME, and PROXY_PASSWORD as environment variables. Stealth mode is controlled separately with STEALTH_MODE.

Similar MCP servers

All MCP servers for Browser and scraping →

From the same set17

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor