Playwright Stealth Browser MCP Server
A Model Context Protocol (MCP) server that provides browser automation capabilities using Playwright with stealth features. This server enables LLMs to interact with web pages through structured accessibility snapshots or vision-based interactions, while avoiding detection by anti-bot systems.
Key Features
- Stealth browsing: Uses playwright-stealth to avoid detection by anti-bot systems
- Fast and lightweight: Uses Playwright's accessibility tree by default, not pixel-based input
- LLM-friendly: No vision models needed for default mode, operates purely on structured data
- Deterministic tool application: Avoids ambiguity common with screenshot-based approaches
- Vision mode support: Optional screenshot-based interactions for visual-based models
- Complete feature parity: Matches all capabilities of the official Playwright MCP server
Installation
Using uvx (Recommended)
The easiest way to use this MCP server is with uvx, which handles the Python environment automatically:
uvx stealth-browser-mcp
or via docker
docker run --rm -p 3000:3000 stealth-browser-mcp
MCP Client Configuration
VS Code / Cursor / Windsurf
Add this configuration to your MCP settings:
{
"mcpServers": {
"stealth-browser": {
"command": "uvx",
"args": ["stealth-browser-mcp"]
}
}
}
Claude Desktop
Add this to your Claude Desktop configuration file:
{
"mcpServers": {
"stealth-browser": {
"command": "uvx",
"args": ["stealth-browser-mcp"]
}
}
}
Vision Mode
To enable vision mode (screenshot-based interactions), add the --vision flag:
{
"mcpServers": {
"stealth-browser": {
"command": "uvx",
"args": ["stealth-browser-mcp", "--vision"]
}
}
}
Usage
The server provides two interaction modes:
- Snapshot Mode (default): Uses accessibility snapshots for better performance and reliability
- Vision Mode: Uses screenshots for visual-based interactions
Quick Start
- Install and configure the MCP server in your client
- Start a conversation with your AI assistant
- Ask it to navigate to a website:
Please navigate to https://example.com and take a snapshot of the page
Available Tools
Navigation
browser_navigate- Navigate to a URLbrowser_navigate_back- Go back to the previous pagebrowser_navigate_forward- Go forward to the next page
Interactions
browser_snapshot- Capture accessibility snapshot of the current pagebrowser_click- Perform click on a web page elementbrowser_type- Type text into editable elementsbrowser_hover- Hover over page elementsbrowser_drag- Perform drag and drop between elementsbrowser_select_option- Select options in dropdownsbrowser_press_key- Press keyboard keysbrowser_wait_for- Wait for conditions (time, text appear/disappear)browser_file_upload- Upload files through file inputsbrowser_handle_dialog- Handle browser dialogs (alerts, confirms, prompts)
Resources
browser_take_screenshot- Take screenshots of the page or elementsbrowser_pdf_save- Save page as PDFbrowser_network_requests- List all network requestsbrowser_console_messages- Get browser console messages
Tab Management
browser_tab_list- List all open tabsbrowser_tab_new- Open new tabsbrowser_tab_select- Switch between tabsbrowser_tab_close- Close tabs
Utilities
browser_install- Install required browser binariesbrowser_close- Close the browserbrowser_resize- Resize browser window
Testing
browser_generate_playwright_test- Generate Playwright test code
Vision Mode Tools
browser_screen_capture- Take screenshotsbrowser_screen_move_mouse- Move mouse to coordinatesbrowser_screen_click- Click at coordinatesbrowser_screen_drag- Drag between coordinatesbrowser_screen_type- Type text in vision mode
Stealth Features
This server includes advanced stealth capabilities to avoid detection by anti-bot systems:
- User Agent Spoofing: Uses realistic browser user agents
- WebGL Fingerprinting: Spoofs WebGL vendor and renderer information
- Language Headers: Sets appropriate language preferences
- Automation Detection Bypass: Disables automation control features
- Stealth Scripts: Injects scripts to hide automation indicators
Browser Setup
The server will automatically install the required Chromium browser on first run. If you encounter issues, you can manually install browsers:
# Install Playwright browsers
uvx playwright install chromium
# Or if you have the package installed locally
playwright install chromium
Development
Local Development
# Clone the repository
git clone <repository-url>
cd stealth_browser_mcp
# Install in development mode
pip install -e .
# Run the server
python playwright_mcp.py
# Run with vision mode
python playwright_mcp.py --vision
Testing
# Install development dependencies
pip install -e ".[dev]"
# Run tests (if available)
pytest
# Format code
black .
ruff check .
Troubleshooting
Browser Installation Issues
If you encounter browser installation issues:
# Use the browser_install tool through your MCP client, or manually:
uvx playwright install chromium
Permission Issues
On some systems, you may need to install additional dependencies:
# Ubuntu/Debian
sudo apt-get install libnss3 libatk-bridge2.0-0 libdrm2 libxkbcommon0 libxcomposite1 libxdamage1 libxrandr2 libgbm1 libxss1 libasound2
# CentOS/RHEL/Fedora
sudo yum install nss atk java-atk-wrapper at-spi2-atk gtk3 libdrm libxkbcommon libxcomposite libxdamage libxrandr mesa-libgbm
Network Issues
If you encounter network-related issues, the server includes network monitoring tools:
- Use
browser_network_requeststo see all network activity - Check console messages with
browser_console_messages
Contributing
Contributions are welcome! Please feel free to submit pull requests or open issues for bugs and feature requests.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
- Built on top of Playwright
- Uses playwright-stealth for anti-detection
- Inspired by the official Playwright MCP Server
- Built with FastMCP
Metadata
Release files for stealth-browser-mcp 0.1.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| stealth_browser_mcp-0.1.4.tar.gz | 48.8 kB | Without provenance | Details for stealth_browser_mcp-0.1.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| stealth_browser_mcp-0.1.4-py3-none-any.whl | Python 3 | none | any | Details for stealth_browser_mcp-0.1.4-py3-none-any.whl |
Total release size: 109.6 kB
Release files / stealth_browser_mcp-0.1.4.tar.gz
| Download URL | stealth_browser_mcp-0.1.4.tar.gz |
|---|---|
| Size | 48.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a9911fa55e99de52677235cca67e302bdf3a23960b32d601a8d7d1258d70c902
|
|
BLAKE2b-256 checksum How to use checksums |
5cb87bd50d4b1e605ead1a793e4aca2bd100352019b2bda8eb304d8a08cd7f51
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.9.22
|
Release files / stealth_browser_mcp-0.1.4-py3-none-any.whl
| Download URL | stealth_browser_mcp-0.1.4-py3-none-any.whl |
|---|---|
| Size | 60.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9ca3739ff53b2ce91be21f442d98002c2a53b676f295571ab1faf4666fe20d79
|
|
BLAKE2b-256 checksum How to use checksums |
a673533d7e604c84683074a9a0eed795bb0c1b2af3348d3d70885f79f745bb5d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.9.22
|
Security for stealth-browser-mcp 0.1.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.