Playwright を CLI から扱うためのツールです。coding agent と一緒に使う前提で設計されており、MCP よりもトークン効率を優先したいケースに向いています。
- CLI: coding agent がコマンドライン経由で簡潔にブラウザ操作を行う用途に向いています。巨大なツールスキーマやアクセシビリティツリーを毎回コンテキストに載せずに済むため、コードベースやテストと並行して扱いやすいです。
- MCP: 永続セッションや詳細なページ内省、自己修復的な自動化、長時間のエージェントループに向いています。継続的なブラウザ状態の保持を重視する場合はこちらが有力です。詳しくは Playwright MCP を参照してください。
- トークン効率が高い。ページ情報をそのまま LLM に押し込まない構成です。
- Node.js 18 以上
- Claude Code、GitHub Copilot、Codex、その他の coding agent
npm install -g @playwright/cli@latest
playwright-cli --helpこの checkout をそのまま使う場合は、依存関係を入れて Chromium を 1 回取得してください。
npm install
npx playwright install chromium
node playwright-cli.js --help
npm testこのリポジトリ内では npx playwright-cli ... より node playwright-cli.js ... を推奨します。npx キャッシュ依存を避けつつ、checkout 中の実装を確実に使えます。
Claude Code、GitHub Copilot などはローカルにインストールされた skill を利用できます。
playwright-cli install --skillsこのリポジトリには Codex 向け skill も同梱されています。Claude 向け skill と同じ内容を .codex/skills/playwright-cli/ にミラーしているため、clone 後にそのまま共有できます。
Codex で使う場合は、必要に応じて次のようにローカルの skill ディレクトリへコピーしてください。
mkdir -p ~/.codex/skills
cp -R .codex/skills/playwright-cli ~/.codex/skills/playwright-cliインストール後は Codex から playwright-cli skill として利用できます。CLI 実行自体は、引き続き node playwright-cli.js ... または PATH 上の playwright-cli ... を使えます。
agent に CLI を直接使わせることもできます。playwright-cli --help を読ませれば、利用可能コマンドを把握できます。
Test the "add todo" flow on https://demo.playwright.dev/todomvc using playwright-cli.
Check playwright-cli --help for available commands.
> Use playwright skills to test https://demo.playwright.dev/todomvc/.
Take screenshots for all successful and failing scenarios.
agent がコマンドを実行していても、手動で触ることはできます。
playwright-cli open https://demo.playwright.dev/todomvc/ --headed
playwright-cli type "Buy groceries"
playwright-cli press Enter
playwright-cli type "Water flowers"
playwright-cli press Enter
playwright-cli check e21
playwright-cli check e35
playwright-cli screenshot既定では headless です。ブラウザを表示したい場合は open に --headed を付けます。
playwright-cli open https://playwright.dev --headed既定ではブラウザプロファイルはメモリ上に保持されます。セッション内では cookie や storage が維持されますが、ブラウザを閉じると失われます。再起動後も状態を残したい場合は --persistent を使ってください。
複数プロジェクトや複数用途を分けたい場合は -s= でセッション名を付けます。
playwright-cli open https://playwright.dev
playwright-cli -s=example open https://example.com --persistent
playwright-cli listcoding agent 側で PLAYWRIGHT_CLI_SESSION を指定することもできます。
PLAYWRIGHT_CLI_SESSION=todo-app claude .または各コマンドの先頭に -s= を付けてください。
playwright-cli list # セッション一覧
playwright-cli close-all # すべてのブラウザを閉じる
playwright-cli kill-all # すべてのブラウザプロセスを強制終了するplaywright-cli show を使うと、実行中のブラウザセッションを可視化して操作できるダッシュボードを開けます。agent が裏側でブラウザ自動化を走らせているときの観察や介入に便利です。
playwright-cli showダッシュボードには次の 2 ビューがあります。
- Session grid: ワークスペース単位でアクティブなセッションを一覧表示し、ライブプレビュー、セッション名、URL、タイトルを確認できます。
- Session detail: 選択中セッションのライブ画面、タブバー、ナビゲーション、アドレスバーを含む詳細ビューです。ビューポートをクリックすると手動操作に切り替えられます。
グリッド上から、実行中セッションの終了や停止済みセッションのデータ削除も可能です。
playwright-cli open [url] # ブラウザを開き、必要なら URL に移動
playwright-cli goto <url> # URL へ移動
playwright-cli close # ページを閉じる
playwright-cli type <text> # 編集可能要素に入力
playwright-cli click <ref> [button] # ページ上の要素をクリック
playwright-cli dblclick <ref> [button] # ページ上の要素をダブルクリック
playwright-cli fill <ref> <text> # 要素に値を入力
playwright-cli drag <startRef> <endRef> # ドラッグ&ドロップ
playwright-cli hover <ref> # ホバー
playwright-cli select <ref> <val> # セレクトボックスの値を選択
playwright-cli upload <file> # ファイルをアップロード
playwright-cli check <ref> # チェックボックス/ラジオをチェック
playwright-cli uncheck <ref> # チェックボックス/ラジオのチェックを外す
playwright-cli snapshot # 要素 ref を得るためのスナップショットを取得
playwright-cli snapshot --filename=f # スナップショットを指定ファイルに保存
playwright-cli eval <func> [ref] # ページまたは要素で JS を評価
playwright-cli dialog-accept [prompt] # ダイアログを受諾
playwright-cli dialog-dismiss # ダイアログを閉じる
playwright-cli resize <w> <h> # ウィンドウサイズを変更playwright-cli go-back # 戻る
playwright-cli go-forward # 進む
playwright-cli reload # 再読込playwright-cli press <key> # キー入力
playwright-cli keydown <key> # キーを押下
playwright-cli keyup <key> # キーを離すplaywright-cli mousemove <x> <y> # マウス移動
playwright-cli mousedown [button] # ボタン押下
playwright-cli mouseup [button] # ボタン解放
playwright-cli mousewheel <dx> <dy> # スクロールplaywright-cli screenshot [ref] # ページまたは要素のスクリーンショット
playwright-cli screenshot --filename=f # ファイル名指定で保存
playwright-cli pdf # PDF 保存
playwright-cli pdf --filename=page.pdf # ファイル名指定で PDF 保存playwright-cli tab-list # タブ一覧
playwright-cli tab-new [url] # 新規タブ
playwright-cli tab-close [index] # タブを閉じる
playwright-cli tab-select <index> # タブを選択playwright-cli state-save [filename] # ストレージ状態を保存
playwright-cli state-load <filename> # ストレージ状態を読み込み
# Cookies
playwright-cli cookie-list [--domain] # cookie 一覧
playwright-cli cookie-get <name> # cookie を取得
playwright-cli cookie-set <name> <val> # cookie を設定
playwright-cli cookie-delete <name> # cookie を削除
playwright-cli cookie-clear # cookie を全削除
# LocalStorage
playwright-cli localstorage-list # localStorage 一覧
playwright-cli localstorage-get <key> # localStorage を取得
playwright-cli localstorage-set <k> <v> # localStorage を設定
playwright-cli localstorage-delete <k> # localStorage を削除
playwright-cli localstorage-clear # localStorage を全削除
# SessionStorage
playwright-cli sessionstorage-list # sessionStorage 一覧
playwright-cli sessionstorage-get <k> # sessionStorage を取得
playwright-cli sessionstorage-set <k> <v> # sessionStorage を設定
playwright-cli sessionstorage-delete <k> # sessionStorage を削除
playwright-cli sessionstorage-clear # sessionStorage を全削除playwright-cli route <pattern> [opts] # ネットワークリクエストをモック
playwright-cli route-list # アクティブなルート一覧
playwright-cli unroute [pattern] # ルートを削除playwright-cli console [min-level] # console メッセージ一覧
playwright-cli network # 読み込み以降のネットワークリクエスト一覧
playwright-cli run-code <code> # Playwright コード断片を実行
playwright-cli tracing-start # trace 記録開始
playwright-cli tracing-stop # trace 記録停止
playwright-cli video-start # 動画記録開始
playwright-cli video-stop [filename] # 動画記録停止playwright-cli open --browser=chrome # ブラウザ種別を指定
playwright-cli open --extension # ブラウザ拡張経由で接続
playwright-cli open --persistent # 永続プロファイルを利用
playwright-cli open --profile=<path> # カスタムプロファイルディレクトリを指定
playwright-cli open --config=file.json # 設定ファイルを使用
playwright-cli close # ブラウザを閉じる
playwright-cli delete-data # 既定セッションのデータを削除各コマンドの後に、現在のブラウザ状態を表す snapshot が出力されます。
> playwright-cli goto https://example.com
### Page
- Page URL: https://example.com/
- Page Title: Example Domain
### Snapshot
[Snapshot](.playwright-cli/page-2026-02-14T19-22-42-679Z.yml)必要なときは playwright-cli snapshot で明示的に取得できます。--filename を付けない場合はタイムスタンプ付きで自動命名されます。
グローバル playwright-cli が使えない場合は npx playwright-cli で実行できます。
npx playwright-cli open https://example.com
npx playwright-cli click e1このリポジトリの checkout 内では、ローカル entrypoint を直接呼ぶ方法も使えます。
node playwright-cli.js open https://example.com
node playwright-cli.js click e1JSON 設定ファイルを --config で渡せます。既定では .playwright/cli.config.json を読み込みます。
playwright-cli --config path/to/config.json open example.com設定スキーマと環境変数一覧は、以下の英語セクションにも完全な形で掲載しています。
インストールされる skill には次のようなリファレンスが含まれます。
- Request mocking: ネットワークリクエストのインターセプトとモック
- Running Playwright code: 任意の Playwright コード実行
- Browser session management: 複数セッションの管理
- Storage state: cookie と storage の保存・復元
- Test generation: 操作からのテスト生成
- Tracing: 実行 trace の記録と調査
- Video recording: ブラウザ操作動画の記録
Playwright CLI with SKILLS
This package provides CLI interface into Playwright. If you are using coding agents, that is the best fit.
-
CLI: Modern coding agents increasingly favor CLI–based workflows exposed as SKILLs over MCP because CLI invocations are more token-efficient: they avoid loading large tool schemas and verbose accessibility trees into the model context, allowing agents to act through concise, purpose-built commands. This makes CLI + SKILLs better suited for high-throughput coding agents that must balance browser automation with large codebases, tests, and reasoning within limited context windows.
-
MCP: MCP remains relevant for specialized agentic loops that benefit from persistent state, rich introspection, and iterative reasoning over page structure, such as exploratory automation, self-healing tests, or long-running autonomous workflows where maintaining continuous browser context outweighs token cost concerns. Learn more about Playwright MCP.
- Token-efficient. Does not force page data into LLM.
- Node.js 18 or newer
- Claude Code, GitHub Copilot, or any other coding agent.
npm install -g @playwright/cli@latest
playwright-cli --helpIf you are working inside this repository, install dependencies locally and fetch the browser once:
npm install
npx playwright install chromium
node playwright-cli.js --help
npm testFor local repo usage, prefer node playwright-cli.js ... over npx playwright-cli .... This avoids npx cache issues and guarantees you are using the checked-out version.
Claude Code, GitHub Copilot and others will use the locally installed skills.
playwright-cli install --skillsPoint your agent at the CLI and let it cook. It'll read the skill off playwright-cli --help on its own:
Test the "add todo" flow on https://demo.playwright.dev/todomvc using playwright-cli.
Check playwright-cli --help for available commands.
> Use playwright skills to test https://demo.playwright.dev/todomvc/.
Take screenshots for all successful and failing scenarios.
Your agent will be running commands, but it does not mean you can't play with it manually:
playwright-cli open https://demo.playwright.dev/todomvc/ --headed
playwright-cli type "Buy groceries"
playwright-cli press Enter
playwright-cli type "Water flowers"
playwright-cli press Enter
playwright-cli check e21
playwright-cli check e35
playwright-cli screenshot
Playwright CLI is headless by default. If you'd like to see the browser, pass --headed to open:
playwright-cli open https://playwright.dev --headedPlaywright CLI keeps the browser profile in memory by default. Your cookies and storage state
are preserved between CLI calls within the session, but lost when the browser closes. Use
--persistent to save the profile to disk for persistence across browser restarts.
You can use different instances of the browser for different projects with sessions. Pass -s= to
the invocation to talk to a specific browser.
playwright-cli open https://playwright.dev
playwright-cli -s=example open https://example.com --persistent
playwright-cli listYou can run your coding agent with the PLAYWRIGHT_CLI_SESSION environment variable:
PLAYWRIGHT_CLI_SESSION=todo-app claude .Or instruct it to prepend -s= to the calls.
Manage your sessions as follows:
playwright-cli list # list all sessions
playwright-cli close-all # close all browsers
playwright-cli kill-all # forcefully kill all browser processesUse playwright-cli show to open a visual dashboard that lets you see and control all running
browser sessions. This is useful when your coding agents are running browser automation in the
background and you want to observe their progress or step in to help.
playwright-cli show
The dashboard opens a window with two views:
- Session grid — shows all active sessions grouped by workspace, each with a live screencast preview, session name, current URL, and page title. Click any session to zoom in.
- Session detail — shows a live view of the selected session with a tab bar, navigation controls (back, forward, reload, address bar), and full remote control. Click into the viewport to take over mouse and keyboard input; press Escape to release.
From the grid you can also close running sessions or delete data for inactive ones.
playwright-cli open [url] # open browser, optionally navigate to url
playwright-cli goto <url> # navigate to a url
playwright-cli close # close the page
playwright-cli type <text> # type text into editable element
playwright-cli click <ref> [button] # perform click on a web page
playwright-cli dblclick <ref> [button] # perform double click on a web page
playwright-cli fill <ref> <text> # fill text into editable element
playwright-cli drag <startRef> <endRef> # perform drag and drop between two elements
playwright-cli hover <ref> # hover over element on page
playwright-cli select <ref> <val> # select an option in a dropdown
playwright-cli upload <file> # upload one or multiple files
playwright-cli check <ref> # check a checkbox or radio button
playwright-cli uncheck <ref> # uncheck a checkbox or radio button
playwright-cli snapshot # capture page snapshot to obtain element ref
playwright-cli snapshot --filename=f # save snapshot to specific file
playwright-cli eval <func> [ref] # evaluate javascript expression on page or element
playwright-cli dialog-accept [prompt] # accept a dialog
playwright-cli dialog-dismiss # dismiss a dialog
playwright-cli resize <w> <h> # resize the browser windowplaywright-cli go-back # go back to the previous page
playwright-cli go-forward # go forward to the next page
playwright-cli reload # reload the current pageplaywright-cli press <key> # press a key on the keyboard, `a`, `arrowleft`
playwright-cli keydown <key> # press a key down on the keyboard
playwright-cli keyup <key> # press a key up on the keyboardplaywright-cli mousemove <x> <y> # move mouse to a given position
playwright-cli mousedown [button] # press mouse down
playwright-cli mouseup [button] # press mouse up
playwright-cli mousewheel <dx> <dy> # scroll mouse wheelplaywright-cli screenshot [ref] # screenshot of the current page or element
playwright-cli screenshot --filename=f # save screenshot with specific filename
playwright-cli pdf # save page as pdf
playwright-cli pdf --filename=page.pdf # save pdf with specific filenameplaywright-cli tab-list # list all tabs
playwright-cli tab-new [url] # create a new tab
playwright-cli tab-close [index] # close a browser tab
playwright-cli tab-select <index> # select a browser tabplaywright-cli state-save [filename] # save storage state
playwright-cli state-load <filename> # load storage state
# Cookies
playwright-cli cookie-list [--domain] # list cookies
playwright-cli cookie-get <name> # get a cookie
playwright-cli cookie-set <name> <val> # set a cookie
playwright-cli cookie-delete <name> # delete a cookie
playwright-cli cookie-clear # clear all cookies
# LocalStorage
playwright-cli localstorage-list # list localStorage entries
playwright-cli localstorage-get <key> # get localStorage value
playwright-cli localstorage-set <k> <v> # set localStorage value
playwright-cli localstorage-delete <k> # delete localStorage entry
playwright-cli localstorage-clear # clear all localStorage
# SessionStorage
playwright-cli sessionstorage-list # list sessionStorage entries
playwright-cli sessionstorage-get <k> # get sessionStorage value
playwright-cli sessionstorage-set <k> <v> # set sessionStorage value
playwright-cli sessionstorage-delete <k> # delete sessionStorage entry
playwright-cli sessionstorage-clear # clear all sessionStorageplaywright-cli route <pattern> [opts] # mock network requests
playwright-cli route-list # list active routes
playwright-cli unroute [pattern] # remove route(s)playwright-cli console [min-level] # list console messages
playwright-cli network # list all network requests since loading the page
playwright-cli run-code <code> # run playwright code snippet
playwright-cli tracing-start # start trace recording
playwright-cli tracing-stop # stop trace recording
playwright-cli video-start # start video recording
playwright-cli video-stop [filename] # stop video recordingplaywright-cli open --browser=chrome # use specific browser
playwright-cli open --extension # connect via browser extension
playwright-cli open --persistent # use persistent profile
playwright-cli open --profile=<path> # use custom profile directory
playwright-cli open --config=file.json # use config file
playwright-cli close # close the browser
playwright-cli delete-data # delete user data for default sessionAfter each command, playwright-cli provides a snapshot of the current browser state.
> playwright-cli goto https://example.com
### Page
- Page URL: https://example.com/
- Page Title: Example Domain
### Snapshot
[Snapshot](.playwright-cli/page-2026-02-14T19-22-42-679Z.yml)You can also take a snapshot on demand using playwright-cli snapshot command.
If --filename is not provided, a new snapshot file is created with a timestamp. Default to automatic file naming, use --filename= when artifact is a part of the workflow result.
playwright-cli -s=name <cmd> # run command in named session
playwright-cli -s=name close # stop a named browser
playwright-cli -s=name delete-data # delete user data for named browser
playwright-cli list # list all sessions
playwright-cli close-all # close all browsers
playwright-cli kill-all # forcefully kill all browser processesIn some cases you might want to install playwright-cli locally. If running the globally available playwright-cli binary fails, use npx playwright-cli to run the commands. For example:
npx playwright-cli open https://example.com
npx playwright-cli click e1When working from this repository checkout, you can invoke the local entrypoint directly:
node playwright-cli.js open https://example.com
node playwright-cli.js click e1If you are using Codex, this repository also ships a Codex-native copy of the same skill under .codex/skills/playwright-cli/.
You can install it into your local Codex skills directory with:
mkdir -p ~/.codex/skills
cp -R .codex/skills/playwright-cli ~/.codex/skills/playwright-cliAfter copying, Codex can use the bundled skill directly. You can still invoke the local CLI with node playwright-cli.js ... when working from this checkout.
The Playwright CLI can be configured using a JSON configuration file. You can specify the configuration file using the --config command line option:
playwright-cli --config path/to/config.json open example.comPlaywright CLI will load config from .playwright/cli.config.json by default so that you did not need to specify it every time.
Configuration file schema
{
/**
* The browser to use.
*/
browser?: {
/**
* The type of browser to use.
*/
browserName?: 'chromium' | 'firefox' | 'webkit';
/**
* Keep the browser profile in memory, do not save it to disk.
*/
isolated?: boolean;
/**
* Path to a user data directory for browser profile persistence.
* Temporary directory is created by default.
*/
userDataDir?: string;
/**
* Launch options passed to
* @see https://playwright.dev/docs/api/class-browsertype#browser-type-launch-persistent-context
*
* This is useful for settings options like `channel`, `headless`, `executablePath`, etc.
*/
launchOptions?: playwright.LaunchOptions;
/**
* Context options for the browser context.
*
* This is useful for settings options like `viewport`.
*/
contextOptions?: playwright.BrowserContextOptions;
/**
* Chrome DevTools Protocol endpoint to connect to an existing browser instance in case of Chromium family browsers.
*/
cdpEndpoint?: string;
/**
* CDP headers to send with the connect request.
*/
cdpHeaders?: Record<string, string>;
/**
* Timeout in milliseconds for connecting to CDP endpoint. Defaults to 30000 (30 seconds). Pass 0 to disable timeout.
*/
cdpTimeout?: number;
/**
* Remote endpoint to connect to an existing Playwright server.
*/
remoteEndpoint?: string;
/**
* Paths to TypeScript files to add as initialization scripts for Playwright page.
*/
initPage?: string[];
/**
* Paths to JavaScript files to add as initialization scripts.
* The scripts will be evaluated in every page before any of the page's scripts.
*/
initScript?: string[];
},
/**
* If specified, saves the Playwright video of the session into the output directory.
*/
saveVideo?: {
width: number;
height: number;
};
/**
* The directory to save output files.
*/
outputDir?: string;
/**
* Whether to save snapshots, console messages, network logs and other session logs to a file or to the standard output. Defaults to "stdout".
*/
outputMode?: 'file' | 'stdout';
console?: {
/**
* The level of console messages to return. Each level includes the messages of more severe levels. Defaults to "info".
*/
level?: 'error' | 'warning' | 'info' | 'debug';
},
network?: {
/**
* List of origins to allow the browser to request. Default is to allow all. Origins matching both `allowedOrigins` and `blockedOrigins` will be blocked.
*/
allowedOrigins?: string[];
/**
* List of origins to block the browser to request. Origins matching both `allowedOrigins` and `blockedOrigins` will be blocked.
*/
blockedOrigins?: string[];
};
/**
* Specify the attribute to use for test ids, defaults to "data-testid".
*/
testIdAttribute?: string;
timeouts?: {
/*
* Configures default action timeout: https://playwright.dev/docs/api/class-page#page-set-default-timeout. Defaults to 5000ms.
*/
action?: number;
/*
* Configures default navigation timeout: https://playwright.dev/docs/api/class-page#page-set-default-navigation-timeout. Defaults to 60000ms.
*/
navigation?: number;
};
/**
* Whether to allow file uploads from anywhere on the file system.
* By default (false), file uploads are restricted to paths within the MCP roots only.
*/
allowUnrestrictedFileAccess?: boolean;
/**
* Specify the language to use for code generation.
*/
codegen?: 'typescript' | 'none';
}Configuration via env
| Environment |
|---|
PLAYWRIGHT_MCP_ALLOWED_HOSTS comma-separated list of hosts this server is allowed to serve from. Defaults to the host the server is bound to. Pass '*' to disable the host check. |
PLAYWRIGHT_MCP_ALLOWED_ORIGINS semicolon-separated list of TRUSTED origins to allow the browser to request. Default is to allow all. Important: does not serve as a security boundary and does not affect redirects. |
PLAYWRIGHT_MCP_ALLOW_UNRESTRICTED_FILE_ACCESS allow access to files outside of the workspace roots. Also allows unrestricted access to file:// URLs. By default access to file system is restricted to workspace root directories (or cwd if no roots are configured) only, and navigation to file:// URLs is blocked. |
PLAYWRIGHT_MCP_BLOCKED_ORIGINS semicolon-separated list of origins to block the browser from requesting. Blocklist is evaluated before allowlist. If used without the allowlist, requests not matching the blocklist are still allowed. Important: does not serve as a security boundary and does not affect redirects. |
PLAYWRIGHT_MCP_BLOCK_SERVICE_WORKERS block service workers |
PLAYWRIGHT_MCP_BROWSER browser or chrome channel to use, possible values: chrome, firefox, webkit, msedge. |
PLAYWRIGHT_MCP_CAPS comma-separated list of additional capabilities to enable, possible values: vision, pdf. |
PLAYWRIGHT_MCP_CDP_ENDPOINT CDP endpoint to connect to. |
PLAYWRIGHT_MCP_CDP_HEADERS CDP headers to send with the connect request, multiple can be specified. |
PLAYWRIGHT_MCP_CDP_TIMEOUT timeout for the CDP connection. |
PLAYWRIGHT_MCP_CONFIG path to the configuration file. |
PLAYWRIGHT_MCP_CONSOLE_LEVEL level of console messages to return: "error", "warning", "info", "debug". Each level includes the messages of more severe levels. |
PLAYWRIGHT_MCP_DEVICE device to emulate, for example: "iPhone 15" |
PLAYWRIGHT_MCP_EXECUTABLE_PATH path to the browser executable. |
PLAYWRIGHT_MCP_EXTENSION Connect to a running browser instance (Edge/Chrome only). Requires the "Playwright MCP Bridge" browser extension to be installed. |
PLAYWRIGHT_MCP_GRANT_PERMISSIONS List of permissions to grant to the browser context, for example "geolocation", "clipboard-read", "clipboard-write". |
PLAYWRIGHT_MCP_HEADLESS whether to run browser in headless mode, headless by default. |
PLAYWRIGHT_MCP_IGNORE_HTTPS_ERRORS ignore https errors |
PLAYWRIGHT_MCP_INIT_PAGE path to TypeScript file to evaluate on Playwright page object |
PLAYWRIGHT_MCP_INIT_SCRIPT path to JavaScript file to add as an initialization script. The script will be evaluated in every page before any of the page's scripts. Can be specified multiple times. |
PLAYWRIGHT_MCP_ISOLATED keep the browser profile in memory, do not save it to disk. |
PLAYWRIGHT_MCP_SANDBOX whether to enable the browser sandbox. |
PLAYWRIGHT_MCP_OUTPUT_DIR path to the directory for output files. |
PLAYWRIGHT_MCP_PROXY_BYPASS comma-separated domains to bypass proxy, for example ".com,chromium.org,.domain.com" |
PLAYWRIGHT_MCP_PROXY_SERVER specify proxy server, for example "http://myproxy:3128" or "socks5://myproxy:8080" |
PLAYWRIGHT_MCP_SAVE_TRACE Whether to save the Playwright Trace of the session into the output directory. |
PLAYWRIGHT_MCP_SAVE_VIDEO Whether to save the video of the session into the output directory. For example "--save-video=800x600" |
PLAYWRIGHT_MCP_SECRETS_FILE path to a file containing secrets in the dotenv format |
PLAYWRIGHT_MCP_STORAGE_STATE path to the storage state file for isolated sessions. |
PLAYWRIGHT_MCP_TEST_ID_ATTRIBUTE specify the attribute to use for test ids, defaults to "data-testid" |
PLAYWRIGHT_MCP_TIMEOUT_ACTION specify action timeout in milliseconds, defaults to 5000ms |
PLAYWRIGHT_MCP_TIMEOUT_NAVIGATION specify navigation timeout in milliseconds, defaults to 60000ms |
PLAYWRIGHT_MCP_USER_AGENT specify user agent string |
PLAYWRIGHT_MCP_USER_DATA_DIR path to the user data directory. If not specified, a temporary directory will be created. |
PLAYWRIGHT_MCP_VIEWPORT_SIZE specify browser viewport size in pixels, for example "1280x720" |
The installed skill includes detailed reference guides for common tasks:
- Request mocking — intercept and mock network requests
- Running Playwright code — execute arbitrary Playwright scripts
- Browser session management — manage multiple browser sessions
- Storage state (cookies, localStorage) — persist and restore browser state
- Test generation — generate Playwright tests from interactions
- Tracing — record and inspect execution traces
- Video recording — capture browser session videos