Playwright MCP
by microsoft
Headless browser automation for your AI assistant
browser Node.js Beginner Self-hostable No API key Verified Featured
π
Updated: 1w ago
Description
Playwright MCP puts the full capabilities of the Playwright automation framework at the disposal of your AI coding assistant. It spins up a managed browser instance β Chromium, Firefox, or WebKit β and gives the model the ability to navigate, interact with elements, extract content, and capture screenshots, all through a straightforward MCP tool interface.
What makes this server particularly useful is its self-contained nature. Unlike approaches that require connecting to an existing browser, Playwright MCP manages its own browser lifecycle. This means zero setup friction: just install the package and your AI can start browsing. It handles page loads, waits for dynamic content, and deals with modern JavaScript-heavy SPAs without any extra configuration.
The practical applications are broad. Your AI can verify that a UI change renders correctly by navigating to a local dev server and taking a screenshot. It can scrape structured data from documentation pages to help you write integration code. It can fill out and submit forms to test workflows end-to-end. Because Playwright supports all major browser engines, you can even ask your AI to check cross-browser compatibility for you.
β Best for
Developers who want their AI to interact with web pages for testing, scraping, or verification without manual browser setup
βοΈ Skip if
You need to debug issues in your actual authenticated browser session β Chrome DevTools MCP gives you access to your real Chrome instance
π‘ Use cases
- Verifying UI changes by navigating to local dev servers and taking comparison screenshots
- Extracting structured data from web pages to inform code generation or documentation
- End-to-end testing of web forms and multi-step user workflows through AI-driven automation
π Pros
- β Self-contained β manages its own browser, no external dependencies to configure
- β Cross-browser support with Chromium, Firefox, and WebKit engines
- β Handles modern SPAs and dynamic content with built-in smart waiting strategies
π Cons
- β Downloads browser binaries on first install, which can take a few minutes and disk space
- β Cannot access authenticated sessions from your real browser β starts with a clean state each time
π§ Exposed tools (14 tools)
| Tool | Category | Description |
|---|---|---|
| screenshot | content extraction | Capture a screenshot of the current page or a specific element |
| get_text | content extraction | Extract visible text content from the page or a selected element |
| get_attribute | content extraction | Retrieve the value of a specific HTML attribute from an element |
| type | input automation | Type text character by character into the currently focused element |
| fill_form | input automation | Fill a form field with the specified value, clearing existing content first |
| select_option | input automation | Select an option from a dropdown menu by value, label, or index |
| press_key | input automation | Simulate a keyboard key press, including special keys and combinations |
| click | interaction | Click on a page element identified by selector or text content |
| evaluate | interaction | Execute JavaScript code in the browser page context and return the result |
| scroll | interaction | Scroll the page in a specified direction or to a particular element |
| hover | interaction | Hover the mouse over an element to trigger hover-dependent behaviors |
| drag_and_drop | interaction | Drag an element from one location and drop it onto another target element |
| navigate | navigation | Navigate the managed browser to a specified URL |
| wait_for | navigation | Wait for a selector to appear, a navigation to complete, or a timeout to elapse |
β‘ Installation
Prerequisites:
- β’ Node.js
claude mcp add playwright -- npx @anthropic-ai/playwright-mcp@latestπ‘ Tips & tricks
For the fastest results, let Playwright use its default Chromium engine. If you need to test in a specific browser, you can set the browser type in the server configuration. When scraping content, ask the AI to use `get_text` on specific selectors rather than the entire page to get cleaner, more focused results. For local development, make sure your dev server is running before asking the AI to navigate to it.
π Alternatives
Quick info
- Author
- microsoft
- License
- Runtime
- Node.js
- Transport
- stdio
- Category
- browser
- Difficulty
- Beginner
- Self-hostable
- β
- API key
- No API key needed
- Docker
- β
- Version
- 0.0.0
- Updated
- Feb 12, 2026
Client compatibility
- β Claude Code
- β Cursor
- β VS Code Copilot
- β Gemini CLI
- β Windsurf
- β Cline
- β JetBrains AI
- β Warp
Platforms
π macOS π§ Linux πͺ Windows