# playwright-stealth

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

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 81
- Author: pulsemcp
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/pulsemcp/mcp-servers/tree/HEAD/experimental/playwright-stealth
- Updated: 2026-10-09
- HTML: https://affpapa.org/en/nevibecode/mcp/playwright-stealth

## What it 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.

## Requirements
- Needs: Node.js (commands run via npx)
- Environment variables: `STEALTH_MODE`, `STEALTH_USER_AGENT`, `STEALTH_MASK_LINUX`, `STEALTH_LOCALE`, `HEADLESS`, `TIMEOUT`, `NAVIGATION_TIMEOUT`, `SCREENSHOT_STORAGE_PATH`, `VIDEO_STORAGE_PATH`, `PROXY_URL` — keys and tokens: ask the human for the values, never commit them or put them in shared files.
- Works with: Playwright

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
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

### Codex

**Platform CLI**
```bash
codex mcp add playwright-stealth --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> -- npx -y playwright-stealth-mcp-server
```
Replace <…> with your own values. 10 more environment variables are in the server README

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "playwright-stealth": {
            "command": "npx",
            "args": [
                "-y",
                "playwright-stealth-mcp-server"
            ],
            "env": {
                "STEALTH_MODE": "<STEALTH_MODE>",
                "STEALTH_USER_AGENT": "<STEALTH_USER_AGENT>",
                "STEALTH_MASK_LINUX": "<STEALTH_MASK_LINUX>",
                "STEALTH_LOCALE": "<STEALTH_LOCALE>",
                "HEADLESS": "<HEADLESS>"
            }
        }
    }
}
```
Replace <…> with your own values. 10 more environment variables are in the server README

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "playwright-stealth": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "playwright-stealth-mcp-server"
            ],
            "env": {
                "STEALTH_MODE": "<STEALTH_MODE>",
                "STEALTH_USER_AGENT": "<STEALTH_USER_AGENT>",
                "STEALTH_MASK_LINUX": "<STEALTH_MASK_LINUX>",
                "STEALTH_LOCALE": "<STEALTH_LOCALE>",
                "HEADLESS": "<HEADLESS>"
            }
        }
    }
}
```
Replace <…> with your own values. 10 more environment variables are in the server README

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e STEALTH_MODE=<STEALTH_MODE> -e STEALTH_USER_AGENT=<STEALTH_USER_AGENT> -e STEALTH_MASK_LINUX=<STEALTH_MASK_LINUX> -e STEALTH_LOCALE=<STEALTH_LOCALE> -e HEADLESS=<HEADLESS> playwright-stealth npx -y playwright-stealth-mcp-server
```
Replace <…> with your own values. 10 more environment variables are in the server README

## When to use it
- 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
- 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.

## Similar
- [Scrapling MCP Server](https://affpapa.org/en/nevibecode/mcp/scrapling-mcp-server.md) — MCP server · ★ 89433
- [browser-use](https://affpapa.org/en/nevibecode/mcp/browser-use.md) — MCP server · ★ 119160
- [AIHawk](https://affpapa.org/en/nevibecode/mcp/aihawk.md) — MCP server · ★ 32221
- [Skyvern](https://affpapa.org/en/nevibecode/mcp/skyvern.md) — MCP server · ★ 23263
- [SeleniumBase MCP](https://affpapa.org/en/nevibecode/mcp/seleniumbase-mcp.md) — MCP server · ★ 13169
- [apify-mcp-server](https://affpapa.org/en/nevibecode/mcp/apify-mcp-server.md) — MCP server · ★ 12927

From the same set: [pulsemcp/mcp-servers](https://affpapa.org/en/nevibecode/by/pulsemcp/mcp-servers.md) — 17 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
