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
# 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 -
tools
Use when the user says "mk0r", "appmaker CLI", "open a VM", "run something in the sandbox", "talk to the VM agent", "spin up an E2B sandbox", or "chat with appmaker from CLI." Wraps the `mk0r` CLI to list projects, exec commands inside their E2B sandboxes, stream chat with the VM agent (same `/api/chat` the web UI uses), toggle SOAX residential IP, manage schedules, and copy files. Supports a sticky default project via `mk0r projects use`.
testing
Use when the user mentions "influencer candidates", "social media operator", "check proposals on Upwork/Fiverr", "review influencer applications", "qualify candidates", or "reach out to operators". Manages the IG/TikTok account operator hiring pipeline — review applicants, check replies, qualify, and do proactive outreach.
tools
End-to-end newsletter pipeline: investigate recent features, draft, send via API endpoint, and track delivery/open/click metrics.