A Playwright browser MCP server for UI automation
npm install custom-ui-automatorA Playwright-based MCP (Model Context Protocol) server for browser UI automation.
``bash`
npm install custom-ui-automator
After installation, you need to install Playwright browsers:
`bash`
npx playwright install chromium
Add this to your Claude Desktop configuration (claude_desktop_config.json):
`json`
{
"mcpServers": {
"custom-ui-automator": {
"command": "npx",
"args": ["custom-ui-automator"]
}
}
}
Add this to your .mcp.json:
`json`
{
"mcpServers": {
"custom-ui-automator": {
"command": "npx",
"args": ["custom-ui-automator"]
}
}
}
| Tool | Description |
|------|-------------|
| navigate_to | Navigate the browser to a specified URL |go_back
| | Navigate back to the previous page |click
| | Click an element using CSS selector |double_click
| | Double click an element |right_click
| | Right click (context click) an element |type_text
| | Type text into an input field |drag_and_drop
| | Drag and drop elements |wait_for_element
| | Wait for an element to reach a specific state |select_option
| | Select option(s) from a dropdown |execute_javascript
| | Execute JavaScript in the browser context |browser_handle_dialog
| | Handle modal dialogs (alert, confirm, prompt) |browser_upload_file
| | Upload files via file chooser |resize_window
| | Resize the browser window |press_key
| | Press keyboard keys or combinations |hover
| | Hover over an element |close_browser
| | Close the browser instance |
When selecting elements, follow this priority order:
1. data-dgat attribute: [data-dgat="value"]data-testid
2. attribute: [data-testid="value"]id
3. attribute: #idclass
4. or complex CSS selectors (last resort)
```
Navigate to https://example.com
Click the login button using [data-testid="login-btn"]
Type "user@example.com" into the email field
MIT