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
Design web-like user interfaces in the terminal and inside tmux with a cell-grid Canvas, CSS-like box model, flexbox/grid layout, and 15 reusable widgets such as Panel, Table, Card, ProgressBar, Meter, Tabs, Tree, Badge, Banner, and a braille line chart. Use when an agent needs a dashboard, panel, table, status page, TUI layout, tmux dashboard, screenshot-driven CLI/TUI replica, ANSI frame, truecolor render, pyte PNG screenshot smoke test, wide-character alignment, or a new terminal widget.
tools
Drive interactive terminal (TUI) programs — CLIs, REPLs, installers, menu apps, agent CLIs, and editors like vim — through a PTY, reading semantic screen snapshots. A pattern library classifies a screen (REPL, menu, pager, fzf search, confirm dialog, form, spinner, wizard) and drives it with a ready recipe. Use when a program expects a live terminal (arrow-key menus, prompts, spinners, password fields, curses UIs), or when a piped command hangs or prints nothing.
tools
Design and render terminal/CMD visual effects and ASCII art from a one-line request via the pluggable `fx` engine (18 hot-swappable, themeable effects plus scripted shows). Effects include donut, matrix rain, plasma, fire, a spinning 3D ball, Game of Life, wireframe cube, 3D text banners, rainbow/lolcat gradient text, starfield, tunnel, fireworks, image-to-ASCII, and more. Use when the request is for a terminal animation, ANSI/CLI art, or a new console effect. Pure Python stdlib; truecolor.
tools
# X Twitter Scraper Use Xquik for X/Twitter tweet search, user lookup, profile tweets, follower export, media download, monitors, webhooks, posting workflows, and MCP-backed API exploration. ## Prerequisites - A Xquik API key in `XQUIK_API_KEY`. - Internet access to `https://xquik.com/api/v1`, `https://xquik.com/mcp`, and `https://docs.xquik.com`. - A clear user request that identifies the target tweets, users, accounts, keywords, media, monitor, webhook, or write action. ## Source Truth -