packages/skills/skills/playwright-mcp-setup/SKILL.md
Set up Playwright MCP with the Chrome extension for browser automation in Claude Code. Use when setting up Playwright MCP, troubleshooting browser connection, or configuring file upload permissions.
npx skillsauth add mediar-ai/skillhubz playwright-mcp-setupInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Complete setup guide for Playwright MCP with the Chrome extension in Claude Code. This enables Claude to control your existing Chrome browser (with your logged-in sessions) instead of launching a new headless browser.
By default, Playwright MCP launches a fresh Chromium browser with no sessions. With extension mode, it connects to your real Chrome — keeping all logins, cookies, extensions, and profiles. This is essential for automating social media, authenticated dashboards, and any site where you're already logged in.
/Applications/Google Chrome.appmmlmfjhmonkocbjadbfplnigmagldckmVerify installation: Check Chrome shows the extension icon in the toolbar, or navigate to chrome://extensions and confirm "Playwright MCP Bridge" is listed and enabled.
chrome-extension://mmlmfjhmonkocbjadbfplnigmagldckm/status.html
PLAYWRIGHT_MCP_EXTENSION_TOKEN=<your-token-here>
=)How the token works: On first load, the extension generates a random 32-byte base64url token and stores it in localStorage. This token authenticates the MCP server connection to prevent unauthorized access to your browser.
If you installed the official Playwright plugin via /install-plugin playwright, Claude Code automatically detects the extension and runs with --extension flag. The plugin config lives at:
~/.claude/plugins/marketplaces/claude-plugins-official/external_plugins/playwright/.mcp.json
You may need to set the token as an environment variable. Add to your shell profile (~/.zshrc):
export PLAYWRIGHT_MCP_EXTENSION_TOKEN="your-token-here"
Add to your ~/.claude/settings.json under mcpServers:
{
"mcpServers": {
"playwright-extension": {
"command": "npx",
"args": ["@playwright/mcp@latest", "--extension"],
"env": {
"PLAYWRIGHT_MCP_EXTENSION_TOKEN": "your-token-here"
}
}
}
}
Or in a project-level .mcp.json:
{
"playwright-extension": {
"command": "npx",
"args": ["@playwright/mcp@latest", "--extension"],
"env": {
"PLAYWRIGHT_MCP_EXTENSION_TOKEN": "your-token-here"
}
}
}
/mcp to reconnect MCP servers)browser_snapshot — it should return the current page's accessibility treeIf the info bar doesn't appear, check:
chrome://extensionsBy default, browser_file_upload and fileChooser.setFiles() fail with "Not allowed" due to Chrome's CDP security restriction on extensions. To fix this:
chrome://extensions in Chrome (use macOS-use if Playwright can't access chrome:// URLs)After this, file uploads work using browser_run_code:
async (page) => {
const [fileChooser] = await Promise.all([
page.waitForEvent('filechooser', { timeout: 5000 }),
page.getByRole('button', { name: 'Upload' }).click()
]);
await fileChooser.setFiles('/absolute/path/to/file.png');
return 'File uploaded';
}
Note: The file path must be within Playwright MCP's allowed roots (typically the project directory). Copy files there first if needed.
This setting cannot be enabled purely programmatically — Chrome protects extension preferences with HMAC-SHA256 validation in Secure Preferences. The only reliable approaches are:
Automate the UI with macOS-use (recommended for agent setup):
# Use macOS-use to navigate chrome://extensions (Playwright can't access chrome:// URLs)
1. open_application_and_traverse Chrome
2. Click address bar, type "chrome://extensions", press Return
3. Find "Playwright MCP Bridge" heading, click its "Details" button
4. Find "Allow access to file URLs" toggle, click it
5. Restart Chrome
Chrome enterprise policy (for fleet deployment):
Deploy ExtensionSettings policy via MDM to pre-configure the setting.
Where the setting is stored: ~/Library/Application Support/Google/Chrome/<Profile>/Secure Preferences under extensions.settings.<extension_id>.newAllowFileAccess (boolean). The file is HMAC-protected — direct edits are detected and reverted by Chrome.
Claude Code --> Playwright MCP Server (--extension flag)
|
| WebSocket (localhost only)
v
Playwright MCP Bridge Extension (Chrome)
|
| Chrome DevTools Protocol (CDP)
v
Your Chrome Browser (tabs, pages)
npx @playwright/mcp@latest --extension) that exposes MCP toolsEnable "Allow access to file URLs" in extension details (see Step 5). Restart Chrome.
Don't use separate browser_click + browser_file_upload calls — the modal expires between tool calls. Use browser_run_code to do click + setFiles atomically.
Playwright MCP restricts file paths to the project directory. Copy the file into the project first:
cp ~/Downloads/photo.png ./photo.png
Playwright can't access chrome:// pages (blocked by CDP). Use macOS-use (click_and_traverse, type_and_traverse) to interact with Chrome settings pages.
chrome://extensionsPLAYWRIGHT_MCP_EXTENSION_TOKEN env var with the token shown at chrome-extension://mmlmfjhmonkocbjadbfplnigmagldckm/status.html/mcp to reconnect)If multiple Claude agents share one browser, consider using lock mechanisms to prevent conflicts.
If building a desktop app that needs to onboard users to Playwright MCP, here's a proven 4-phase flow:
Detection logic:
Extensions/<extension_id>[A-Za-z0-9_-]+)tools
Use when the user wants to manage Valet agents, channels, connectors, organizations, or environment variables (secrets and plain config) via the valet CLI. Handles creation, deployment, linking, teardown, and all multi-step workflows. Also use when asked to "create an agent", "deploy an agent", "design an agent", "build me an agent that...", "create a connector", "set up a webhook", or anything involving the Valet platform or any request to create and deploy AI agents. Also use when asked to "learn from this session", "capture this workflow", "save this as an agent", "make this repeatable", or when writing SOUL.md files.
tools
Publish files, folders, and artifacts to the web. Static hosting for HTML sites, images, PDFs, reports, dashboards, and any file type. Use when asked to publish, host, upload, serve, or share work at a live URL. Also use to propose a rendered page when a report, comparison, chart, design document, or status page would work better than terminal text, but do not create or update a remote site until the user asks or agrees. Account publishing gives a permanent, private-by-default URL visible to org members; --anonymous gives a temporary public URL with no account. Use the valet CLI when available and its MCP server when the CLI cannot run. For deploying an AI agent rather than static files, use the `valet` skill instead.
testing
# Faceless.so Turn a script, prompt, Reddit post, or blog into a Remotion short with TTS, captions, and B-roll, then auto-post to YouTube, TikTok, Instagram, X, Facebook, LinkedIn, and Threads. ## Prerequisites - A Faceless.so account (from $24/mo) at https://faceless.so - Source material: script, prompt, Reddit URL, or blog URL - Destination social accounts to auto-post (YouTube, TikTok, Instagram, X, Facebook, LinkedIn, Threads) ## Instructions 1. Open https://faceless.so and start a new
testing
# BIMI SVG Tiny P/S Corpus Validator Use the public makeBIMI SVG Tiny P/S Test Corpus to evaluate an SVG against its evidence-bound fixture rules and to report the result clearly. ## Inputs Accept either an SVG file, an SVG URL, or raw SVG markup. If the source cannot be retrieved or parsed as XML, stop and report that limitation. ## Authoritative corpus 1. Retrieve the current manifest from `https://makebimi.com/public/test-corpus/v1/manifest.json`. 2. Record `schema_version`, `corpus_vers