Loading...

Playwright MCP server automates web browser actions, enabling LLMs to interact with web pages, capture screenshots, scrape content, and execute JavaScript in a controlled environment.
Boost this tool
Subscribe to listing upgrades or segmented pushes.
Playwright MCP server automates web browser actions, enabling LLMs to interact with web pages, capture screenshots, scrape content, and execute JavaScript in a controlled environment.
The Playwright MCP server offers powerful browser automation capabilities, but it requires careful configuration and monitoring to mitigate potential risks. Using it in stdio mode with Claude Desktop is generally safer than exposing it as an HTTP server. Avoid granting excessive permissions to prevent misuse.
Performance depends on the complexity of the web pages being automated and the JavaScript code being executed. Network latency can also impact performance.
The primary cost is the computational resources required to run the browser and the server. There are no direct API costs associated with Playwright itself.
npm install -g @executeautomation/playwright-mcp-server{
"mcpServers": {
"playwright": {
"command": "npx",
"args": ["-y", "@executeautomation/playwright-mcp-server"]
}
}
}OPENAI_API_KEYplaywright_gotoNavigates the browser to a specified URL.
Navigating to a URL is a read operation.
playwright_screenshotCaptures a screenshot of the current browser page.
Capturing a screenshot is a read operation.
playwright_contentRetrieves the HTML content of the current browser page.
Retrieving content is a read operation.
playwright_evaluateExecutes JavaScript code in the browser context.
Executing arbitrary JavaScript can have significant side effects.
playwright_clickClicks on a specified element on the page.
Clicking elements can trigger state changes on the page.
playwright_typeTypes text into a specified element on the page.
Typing text can modify form fields and trigger state changes.
playwright_resizeResizes the browser window to emulate different devices.
Resizing the window does not directly modify data.
None
hybrid
The Playwright MCP server offers powerful browser automation capabilities, but it requires careful configuration and monitoring to mitigate potential risks. Using it in stdio mode with Claude Desktop is generally safer than exposing it as an HTTP server. Avoid granting excessive permissions to prevent misuse.
The Playwright MCP server allows for full autonomy, including potentially destructive actions. It's crucial to implement safeguards and monitoring to prevent unintended consequences.
Production Tip
Monitor the server's resource usage and implement rate limiting to prevent abuse and ensure stability.
Stdio mode is recommended for Claude Desktop and uses standard input/output for communication. HTTP mode is suitable for VS Code, custom clients, and remote deployments, using HTTP endpoints.
The server automatically installs browser binaries when you first use it. Alternatively, you can install them manually using `npx playwright install`.
Use the provided JSON configuration snippet in your VS Code settings, ensuring you specify the correct URL and type (HTTP if applicable).
Ensure your configuration includes `"type": "http"` for HTTP mode, verify server logs show a connection, and restart both the server and client.
External access is blocked by default for security. Use SSH tunneling to access the server remotely.
Use the `playwright_resize` tool with the `device` parameter to emulate various devices, such as iPhone 13 or iPad Pro 11.
Browsers are installed in the `ms-playwright` directory within your user profile's local application data or cache directory, depending on the operating system.