Mentioned as a planned future support for browser automation, alongside other browser engines (currently appears to use Chromium)
Enables execution of custom JavaScript in the browser context to manipulate web pages or extract data that requires client-side scripting
Required as a prerequisite for the Playwright browser installation, enabling the browser automation capabilities
Provides package distribution for easy installation of the playwright-mcp-server using pip
Used for testing the MCP server functionality and ensuring reliability
The primary language for the MCP server implementation, required in version 3.8 or higher
Mentioned as a planned future support for browser automation, alongside other browser engines (currently appears to use Chromium)
Playwright MCP Server
A powerful Model Context Protocol (MCP) server that provides comprehensive browser automation capabilities using Playwright. This server enables AI assistants to interact with web pages, perform automated testing, web scraping, and complex browser-based workflows.
🚀 Quick Install for VSCode
Install this MCP server directly in VSCode with one click:
✨ Features
- 🌐 Complete Browser Control: Navigate, click, type, and interact with any web element
- 📸 Screenshot & Visual Testing: Capture full pages or specific elements
- 🔄 Tab Management: Open, close, and switch between multiple browser tabs
- 📝 Form Automation: Fill forms, select options, handle checkboxes and radio buttons
- ⏳ Smart Waiting: Wait for elements, network requests, or specific page states
- 🔍 Content Extraction: Get text, attributes, and data from web pages
- 💻 JavaScript Execution: Run custom JavaScript in the browser context
- 🛡️ Robust Error Handling: Comprehensive error handling with meaningful messages
📦 Installation
Prerequisites
- Python 3.8 or higher
- Node.js (required for Playwright browser installation)
Install from PyPI
Install from Source
🔧 Configuration
For MCP Clients
Add to your MCP client configuration:
For VSCode MCP Extension
Add to your VSCode settings:
🛠️ Available Tools
Tool | Description | Parameters |
---|---|---|
browser_navigate | Navigate to a URL | url |
browser_click | Click on an element | selector , timeout? |
browser_type | Type text into an element | selector , text , timeout? |
browser_screenshot | Take a screenshot | path? , full_page? |
browser_get_text | Extract text from an element | selector , timeout? |
browser_wait_for_selector | Wait for element to appear | selector , timeout? , state? |
browser_evaluate | Execute JavaScript | script |
browser_new_tab | Open a new tab | url? |
browser_close_tab | Close current tab | - |
browser_get_title | Get page title | - |
browser_get_url | Get current URL | - |
💡 Usage Examples
Web Scraping
Form Automation
Testing Workflows
🧪 Testing
Run the test suite:
📚 Documentation
Comprehensive documentation is available in the docs directory:
🔒 Security
- Runs in headless mode by default
- Isolated browser contexts for each session
- Automatic resource cleanup
- Configurable timeout limits
- No sensitive data logging
🤝 Contributing
We welcome contributions! Please see our contributing guidelines:
- Fork the repository
- Create a feature branch
- Add tests for your changes
- Ensure all tests pass
- Submit a pull request
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
🙏 Acknowledgments
- Built with Playwright for reliable browser automation
- Implements the Model Context Protocol specification
- Inspired by the need for robust browser automation in AI workflows
📈 Roadmap
- Support for multiple browser engines (Firefox, Safari)
- Advanced element selection strategies
- Built-in visual regression testing
- Performance monitoring and metrics
- Browser extension interaction
- Mobile browser simulation
⭐ Star this repository if you find it useful!
This server cannot be installed
A Model Context Protocol server that enables AI assistants to interact with web pages through browser automation, supporting web scraping, form filling, navigation, and other browser-based tasks using Playwright.
Related MCP Servers
- AsecurityAlicenseAqualityA Model Context Protocol server that provides browser automation capabilities using Playwright. This server enables LLMs to interact with web pages, take screenshots, and execute JavaScript in a real browser environment.Last updated -1310,5343,956TypeScriptMIT License
- -securityFlicense-qualityProvides a server utilizing Model Context Protocol to enable human-like browser automation with Playwright, allowing control over browser actions such as navigation, element interaction, and scrolling.Last updated -2TypeScript
- -securityAlicense-qualityA Model Context Protocol server that provides browser automation capabilities using Playwright, enabling LLMs to interact with web pages, take screenshots, and execute JavaScript in a real browser environment.Last updated -3PythonApache 2.0
- AsecurityAlicenseAqualityA Model Context Protocol server that provides browser automation capabilities using Playwright, enabling LLMs to interact with web pages, take screenshots, generate test code, scrape web content, and execute JavaScript in real browser environments.Last updated -3110,534TypeScriptMIT License