playwright-mcp
БесплатноБез исполняемых скриптовНе проверенPlaywright MCP is a Model Context Protocol server that lets an AI agent drive a real browser: it reads each page as a structured accessibility snapshot and…
от TerminalSkills★ 221 звезда на GitHubОб этом скилле
Playwright MCP — Browser control for AI agents through accessibility snapshots
Overview
Playwright MCP runs a browser and exposes it to an MCP client as tools such as browser_navigate, browser_click and browser_type. Every action returns a text snapshot of the page's accessibility tree in which each element carries a short reference (ref=e5); the agent passes that reference back as the target of the next call. No vision model is needed, and the same page structure always produces the same interaction.
Instructions
Installation
The server is an npm package started with npx; nothing is installed globally. The browser is downloaded on first use.
# Claude Code
claude mcp add playwright npx @playwright/mcp@latest
# Claude Code, with server flags (everything after -- goes to the server)
claude mcp add playwright -- npx @playwright/mcp@latest --headless --caps=testing,storage
# OpenAI Codex
codex mcp add playwright npx "@playwright/mcp@latest"
# VS Code
code --add-mcp '{"name":"playwright","command":"npx","args":["@playwright/mcp@latest"]}'
Cursor, Gemini CLI, Claude Desktop, Windsurf and most other clients take the standard JSON block in their MCP settings file:
{
"mcpServers": {
"playwright": {
"command": "npx",
"args": ["@playwright/mcp@latest"]
}
}
}
Server flags go into the same args array, one string per flag, for example "--caps=testing,storage".
The snapshot, ref, act loop
browser_navigateopens a URL and returns a snapshot.- Read the snapshot and find the element's
[ref=...]. - Call an action tool with that ref as
target. - The action returns a fresh snapshot. Use refs from that one for the next step.
→ browser_navigate { url: "https://demo.playwright.dev/todomvc" }
- heading "todos" [level=1] [ref=e3]
- textbox "What needs to be done?" [ref=e5]
→ browser_type { target: "e5", text: "Renew TLS certificate", submit: true }
- textbox "What needs to be done?" [ref=e5]
- list [ref=e8]:
- listitem [ref=e9]:
- checkbox "Toggle Todo" [ref=e10]
- text: Renew TLS certificate
target also accepts a Playwright selector or locator string such as #submit or getByRole('button', { name: 'Save' }). Elements inside an iframe get a frame prefix, for example f1e12. A stale ref fails with Ref e10 not found in the current page snapshot; take a new snapshot and retry.
Core tools (always enabled)
| Tool | Key parameters | Use |
|---|---|---|
browser_navigate |
url |
Open a page |
browser_snapshot |
target, depth, boxes, filename |
Re-read the page, or only one subtree |
browser_find |
text or regex |
Locate one element on a large page without a full snapshot |
browser_click |
target, doubleClick, button, modifiers |
Click |
browser_type |
target, text, submit, slowly |
Fill one field, optionally press Enter |
browser_fill_form |
fields[] of name, target, type, value |
Fill several fields in one call |
browser_select_option |
target, values |
Choose options in a dropdown |
browser_wait_for |
text, textGone, time (seconds, max 30) |
Wait for async work |
browser_take_screenshot |
target, fullPage, filename, type |
Visual record; cannot be acted on |
browser_console_messages |
level, all |
Read page console output |
browser_network_requests |
filter, static |
List requests; browser_network_request shows one in full |
browser_evaluate |
function, target |
Run JavaScript inside the page |
browser_tabs |
action, index, url |
List, open, select, close tabs |
browser_handle_dialog |
accept, promptText |
Answer alert, confirm, prompt |
browser_file_upload |
paths |
Answer a file chooser |
Field type in browser_fill_form is one of textbox, checkbox, radio, combobox, slider; checkboxes and radios take "true" or "false" as value.
Capabilities (opt-in tool groups)
Extra tool groups are enabled with --caps, comma-separated. Enable only what the task needs: every group adds tool schemas to the model context.
| Capability | Adds |
|---|---|
storage |
Cookies, localStorage, sessionStorage, browser_storage_state, browser_set_storage_state |
testing |
browser_verify_element_visible, browser_verify_text_visible, browser_verify_list_visible, browser_verify_value, browser_generate_locator |
network |
browser_route, browser_route_list, browser_unroute, browser_network_state_set |
vision |
Coordinate mouse tools such as browser_mouse_click_xy for canvas and unlabeled widgets |
pdf |
browser_pdf_save |
devtools |
Tracing, video recording, action recording, highlighting |
config |
browser_get_config to print the resolved configuration |
Common server flags
| Flag | Effect |
|---|---|
--headless |
Run without a window. The default is headed. |
--browser=firefox |
Установить playwright-mcp в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл playwright-mcp?
Playwright MCP is a Model Context Protocol server that lets an AI agent drive a real browser: it reads each page as a structured accessibility snapshot and clicks, types, and fills forms by element reference instead of guessing at pixels. Use when someone asks to "let the agent use a browser", "add the Playwright MCP server", "open the site and check it", "log in and click through the app", "reproduce this UI bug in the browser", "fill out this web form", or "keep the browser logged in between sessions". Covers client setup, the snapshot-and-ref workflow, opt-in capabilities, profiles and saved login state, headless, HTTP and Docker runs, and security limits.
Как установить скилл playwright-mcp?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл playwright-mcp запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic