# Playwright MCP — Browser Automation for Agents > Playwright MCP exposes browser automation via MCP with device emulation; verified 5,510★ and documents 143 device profiles plus `playwright install` setup. ## Install Merge the JSON below into your `.mcp.json`: ## Quick Use ```bash claude mcp add --transport stdio playwright npx @executeautomation/playwright-mcp-server npx playwright install chromium # or: playwright install # Restart your client, then use Playwright tools for navigate/click/type/screenshot. ``` ## Intro Playwright MCP exposes browser automation via MCP with device emulation; verified 5,510★ and documents 143 device profiles plus `playwright install` setup. **Best for:** Agent builders who need reliable browser automation with explicit tools and repeatable prompts **Works with:** Claude Code/Claude Desktop/VS Code MCP and any client that can run an stdio MCP server **Setup time:** 10-20 minutes ### Key facts (verified) - GitHub: 5510 stars · 510 forks · pushed 2025-12-13. - License: MIT · owner avatar + repo URL verified via GitHub API. - README-backed entrypoint: `npx @executeautomation/playwright-mcp-server`. ## Main - Prefer tool-driven prompts (“use Playwright MCP tool to click X”) over free-form browsing for reproducible runs. - Install Playwright browsers explicitly (`npx playwright install chromium`) so the MCP server can launch reliably in CI/containers. - Use device emulation only when needed—README highlights 143 device profiles; desktop mode is usually less flaky. ### Source-backed notes - README shows install options including `npm install -g ...` and Claude Code integration via `claude mcp add ... npx ...`. - README includes Playwright setup steps such as `npx playwright install` and per-browser installs (chromium/firefox/webkit). - README claims support for 143 device emulation profiles with viewport/UA/touch/DPR emulation. ### FAQ - **Do I need a global install?**: Not required—`npx` works, but global install can speed up repeated runs. - **Why does browser launch fail?**: Most failures come from missing browser binaries; run `npx playwright install ` first. - **Is it only for Claude?**: No—README mentions VS Code install links and other MCP-capable clients. ## Source & Thanks > Source: https://github.com/executeautomation/mcp-playwright > License: MIT > GitHub: ⭐ 5510 · forks 510 Thanks to the upstream maintainers for shipping the original project. --- ## 快速使用 ```bash claude mcp add --transport stdio playwright npx @executeautomation/playwright-mcp-server npx playwright install chromium # or: playwright install # Restart your client, then use Playwright tools for navigate/click/type/screenshot. ``` ## 简介 Playwright MCP 通过 MCP 提供浏览器自动化与设备模拟;已验证 5,510★,文档提到 143 个设备配置,并包含 `playwright install` 安装与示例命令。 **适合谁用:** 需要可复现、可控的浏览器自动化工具集来驱动 agent 的开发者 **适用环境:** Claude Code / Claude Desktop / VS Code MCP,以及任意可运行 stdio MCP server 的客户端 **配置耗时:** 10-20 minutes ### 关键事实(已验证) - GitHub:5510 stars · 510 forks;最近更新 2025-12-13。 - 许可证:MIT;作者头像与仓库链接均已通过 GitHub API 复核。 - README 中可对照的入口命令:`npx @executeautomation/playwright-mcp-server`。 ## 正文 - 尽量用“工具驱动”的提示词(明确调用 click/type/screenshot 等工具),比自由浏览更稳定、更可复现。 - 显式安装浏览器(如 `npx playwright install chromium`),避免在 CI/容器里启动失败。 - 设备模拟按需使用。README 提到 143 个设备配置;大多数场景用桌面模式更稳。 ### 基于来源的要点 - README 给出多种安装方式:例如全局 npm 安装,以及通过 `claude mcp add ... npx ...` 接入 Claude Code。 - README 提供 Playwright 安装命令:`npx playwright install`,以及按浏览器安装(chromium/firefox/webkit)。 - README 声称支持 143 个设备模拟配置,涵盖 viewport/UA/touch/DPR 等。 ### 常见问题 - **必须全局安装吗?**:不必须。`npx` 可以直接运行;全局安装的优势是重复运行更快。 - **为什么浏览器启动失败?**:常见原因是缺少浏览器二进制。先执行 `npx playwright install `。 - **只能给 Claude 用吗?**:不是。README 也给出 VS Code 等客户端安装方式,适用于支持 MCP 的工具。 ## 来源与感谢 > Source: https://github.com/executeautomation/mcp-playwright > License: MIT > GitHub: ⭐ 5510 · forks 510 --- Source: https://tokrepo.com/en/workflows/playwright-mcp-browser-automation-for-agents Author: MCP Hub