{"type":"mcp_server","name":"playwright-mcp","description":"This repository hosts Playwright MCP, a server enabling LLMs to interact with web pages using Playwright's accessibility tree, offering fast, lightweight, and deterministic browser automation. It bypasses the need for vision models.","category":"Developer Tools","language":"TypeScript","stars":33883,"forks":226,"owner":"microsoft","github_url":"https://github.com/microsoft/playwright-mcp","homepage":"https://www.npmjs.com/package/@playwright/mcp","setup":"## Setup\n\n1.  Install the Playwright MCP server in VS Code using the provided buttons or the VS Code CLI.\n2.  Use the VS Code CLI with `code --add-mcp '{\"name\":\"playwright\",\"command\":\"npx\",\"args\":[\"@playwright/mcp@latest\"]}'` for VS Code, or `code-insiders --add-mcp '{\"name\":\"playwright\",\"command\":\"npx\",\"args\":[\"@playwright/mcp@latest\"]}'` for VS Code Insiders.\n3.  After installation, the Playwright MCP server will be available for use with your GitHub Copilot agent in VS Code.\n4.  Playwright MCP launches Chrome browser with a new profile in a specific directory depending on the OS, which can be deleted to clear the offline state.\n5.  To run headless browser, configure the `mcpServers` with the `--headless` flag.\n6.  When running headed browser on Linux w/o DISPLAY, run the MCP server from environment with the DISPLAY and pass the `--port` flag to enable SSE transport, then set the `url` in MCP client config to the SSE endpoint.\n7.  To use Vision Mode, add the `--vision` flag when starting the server.","tools":"## Available Tools\n\n1.  **Fast and lightweight** (Uses Playwright's accessibility tree, not pixel-based input).\n2.  **LLM-friendly** (No vision models needed, operates purely on structured data).\n3.  **Deterministic tool application** (Avoids ambiguity common with screenshot-based approaches).\n4.  **Web navigation and form-filling** (Allows LLMs to navigate and interact with web forms).\n5.  **Data extraction from structured content** (Enables extraction of data from web pages).\n6.  **Automated testing driven by LLMs** (Supports automated testing workflows).\n7.  **General-purpose browser interaction for agents** (Provides a versatile interface for browser interaction).\n\n**Snapshot Mode Tools:**\n\n8.  **browser_navigate** (Navigate to a URL).\n9.  **browser_go_back** (Go back to the previous page).\n10. **browser_go_forward** (Go forward to the next page).\n11. **browser_click** (Perform click on a web page).\n12. **browser_hover** (Hover over element on page).\n13. **browser_drag** (Perform drag and drop between two elements).\n14. **browser_type** (Type text into editable element).\n15. **browser_select_option** (Select option in a dropdown).\n16. **browser_choose_file** (Choose one or multiple files to upload).\n17. **browser_press_key** (Press a key on the keyboard).\n18. **browser_snapshot** (Capture accessibility snapshot of the current page).\n19. **browser_save_as_pdf** (Save page as PDF).\n20. **browser_take_screenshot** (Capture screenshot of the page).\n21. **browser_wait** (Wait for a specified time in seconds).\n22. **browser_close** (Close the page).\n\n**Vision Mode Tools:**\n\n23. **browser_navigate** (Navigate to a URL).\n24. **browser_go_back** (Go back to the previous page).\n25. **browser_go_forward** (Go forward to the next page).\n26. **browser_screenshot** (Capture screenshot of the current page).\n27. **browser_move_mouse** (Move mouse to specified coordinates).\n28. **browser_click** (Click at specified coordinates).\n29. **browser_drag** (Perform drag and drop operation).\n30. **browser_type** (Type text at specified coordinates).\n31. **browser_press_key** (Press a key on the keyboard).\n32. **browser_choose_file** (Choose one or multiple files to upload).\n33. **browser_save_as_pdf** (Save page as PDF).\n34. **browser_wait** (Wait for a specified time in seconds).\n35. **browser_close** (Close the page).","faq":null,"created_at":"2025-03-21T17:48:36+00:00","updated_at":"2025-07-07T15:34:48+00:00","source_url":"https://model-context-protocol.com/servers/playwright-llm-accessibility-tree-browser-automation","related_articles":[]}