playwright-ui-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@playwright-ui-mcp Open a browser, go to https://example.com, and describe what you see"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
playwright-ui-mcp
A lightweight MCP (Model Context Protocol) server for headed browser UI capture and analysis using Playwright. Designed for use with Claude to enable visual UI inspection, screenshots, and browser automation.
Features
Headed browser - Always visible, not headless, for real UI analysis
Lightweight by default - No video recording unless explicitly enabled
Screenshot capture - Returns base64 images for Claude to analyze
Video recording - Optional, enable only when needed
Auto cleanup - All screenshots/videos deleted when browser closes
Interactive elements - Get clickable elements with selectors
Related MCP server: browser-for-claude
Installation
Automatic Install (Recommended)
Install as a dependency in your project. The configuration (.mcp.json) is created automatically.
npm install playwright-ui-mcpQuick Setup (Without Installing)
If you just want to configure the current directory without adding a dependency:
npx playwright-ui-mcp-installManual Configuration
Create .mcp.json in your project root:
{
"mcpServers": {
"playwright-ui": {
"command": "npx",
"args": ["-y", "playwright-ui-mcp"]
}
}
}Then restart Claude Code or run /mcp to load the server.
Available Tools
Tool | Description |
| Launch headed browser. Options: |
| Create a new tab |
| Navigate to URL |
| Capture screenshot (returns base64 image for analysis) |
| Get interactive elements with selectors |
| Get page HTML and text |
| Click an element |
| Type into input field |
| Wait for element to appear |
| Run JavaScript in page |
| Close a specific tab |
| Close browser and cleanup all captures |
| Get session info |
Usage Examples
Basic UI Inspection
Ask Claude:
"Open a browser, go to https://example.com, and describe what you see"
Claude will:
Launch browser
Navigate to the URL
Take a screenshot
Analyze the UI visually
Close browser (auto-cleanup)
Form Interaction
"Go to the login page, fill in username 'test@example.com' and password 'secret', then click submit"
With Video Recording (Heavy Mode)
"Record a video while you navigate through the checkout flow"
Claude will use recordVideo: true when launching.
Lightweight vs Heavy Mode
Mode | Video | slowMo | Use Case |
Default (Light) | Off | None | Quick UI checks |
Heavy | On | 100-200ms | Debugging, demos |
// Lightweight (default)
browser_launch()
// Heavy mode for debugging
browser_launch({ recordVideo: true, slowMo: 150 })Cleanup
All temporary files (screenshots, videos) are automatically deleted when browser_close is called. No manual cleanup required.
Uninstall
Remove from project:
npx playwright-ui-mcp-install uninstallRequirements
Node.js >= 18.0.0
Chromium browser (auto-installed via Playwright on first run)
License
MIT
Available Tools
13 toolsbrowser_clickC
Click on an element in the page
Inputs: pageId (required), selector (required).
browser_closeA
Close the browser and clean up all screenshots/recordings. IMPORTANT: Always call this when done with UI analysis to ensure proper cleanup.
Inputs: no named parameters.
browser_close_pageB
Close a specific page/tab
Inputs: pageId (required).
browser_evaluateB
Execute JavaScript code in the page context
Inputs: pageId (required), script (required).
browser_get_contentB
Get the HTML and text content of the current page
Inputs: pageId (required).
browser_get_visible_elementsB
Get all visible interactive elements on the page (buttons, links, inputs, etc.) with their selectors for interaction
Inputs: pageId (required).
browser_launchA
Launch a headed browser for UI capture and analysis. The browser will be visible on screen. By default runs in lightweight mode (no video). Enable recordVideo only when you need to capture a sequence of interactions for debugging or demonstration.
Inputs: width, height, slowMo, recordVideo.
browser_new_pageC
Create a new page/tab in the browser
Inputs: name.
browser_screenshotA
Take a screenshot of the current page for UI analysis. Returns the screenshot as base64-encoded image data that can be analyzed.
Inputs: pageId (required), fullPage, selector.
browser_statusB
Get the current status of the browser session
Inputs: no named parameters.
browser_typeB
Type text into an input field
Inputs: text (required), pageId (required), selector (required).
browser_wait_forB
Wait for an element to appear on the page
Inputs: pageId (required), selector (required), timeout.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 13 tools
Each tool maps to a distinct browser action, and the launch/close vs. new_page/close_page pairs are disambiguated by their descriptions. Minor overlap exists between browser_get_content and browser_get_visible_elements, and browser_close vs browser_close_page could be misread at a glance, but the descriptions clarify scope.
All 13 tools use a uniform browser_ prefix with snake_case verb_noun naming (browser_new_page, browser_close_page, browser_get_visible_elements). The pattern is fully predictable and symmetric across page lifecycle, navigation, capture, and interaction actions.
13 tools sit comfortably in the well-scoped range for a UI automation/capture server. Every tool corresponds to a necessary part of the launch-navigate-inspect-interact-close workflow, with no obvious redundancy.
The core lifecycle (launch, new page, navigate, screenshot, inspect elements/content, click, type, wait, evaluate, close) is fully covered with no dead ends. Minor gaps remain for common interactions like hover, select dropdown option, key press, and element-scoped screenshots, which agents will need browser_evaluate to work around.
Maintenance
Related MCP Connectors
Control a real browser from AI agents: navigate, click, type, screenshot, read the page.
Playwright browser automation — navigate, click, fill forms, extract, screenshot — 17 agent tools.
Hosted browser for agents: open pages, search the web, extract data, read PDFs and take screenshots.
A real browser for your agent: screenshots, page checks, Markdown and PDFs.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables browser automation and web interaction control through Playwright, allowing Claude Code to navigate, click, fill forms, take screenshots, and manage sessions.79 npm9MIT
- FlicenseAqualityDmaintenanceGives Claude control of a real, headed Chromium browser via Playwright, enabling web navigation, clicking, typing, screenshots, and JavaScript evaluation.8-
- AlicenseBqualityCmaintenanceEnables AI assistants to control a real Chromium browser through Playwright, allowing them to navigate pages, click elements, fill forms, extract text or HTML, and capture screenshots in a persistent session.6ISC
- AlicenseAqualityCmaintenanceEnables Claude Code to control Google Chrome using local Playwright sessions to navigate, click, fill forms, take screenshots, and read pages, with security guards and an audit log.6MIT