Enterprise-grade web automation with 35 MCP tools + auto-healing + optional LLM
Project description
🎭 Playwright MCP Forge
Enterprise-Grade Web Automation via Claude Desktop
An intelligent Model Context Protocol (MCP) server for browser automation. Write web automation workflows in natural language through Claude Desktop. Includes CAPTCHA solving, multi-account management, proxy rotation, PDF generation, and more.
✨ What You Can Do
- 🌐 Control browsers - Navigate, click, type, scroll
- 📊 Extract data - Tables, text, HTML, structured data
- 🎯 Solve CAPTCHAs - Automatically solve image-based CAPTCHAs with OCR
- 👥 Multi-account - Run multiple browser sessions simultaneously
- 🔄 Proxy rotation - Distribute requests across multiple IPs
- 📄 Generate PDFs - Create PDFs from web pages
- 🔖 Manage tabs - Open, switch, close browser tabs
- ✅ Test assertions - Assert element states, visibility, count
- 🎙️ Record sessions - Trace automation for debugging
- 🔧 Auto-healing locators - Find elements even when selectors change
Works with: Claude Desktop, VS Code, Cline, Cursor, and other MCP clients
🚀 Quick Start (5 minutes)
1. Install
# Clone repository
git clone https://github.com/shakti44/playwright-mcp-forge.git
cd playwright-mcp-forge
# Create virtual environment
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
playwright install # Installs Chromium
# Start server
python src/web_automation.py
2. Connect to Claude Desktop
Edit Claude Desktop config:
- macOS:
~/.anthropic/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"web-automation": {
"command": "python",
"args": ["C:\\path\\to\\src\\web_automation.py"]
}
}
}
Restart Claude Desktop.
3. Use It
In Claude Desktop, try:
Navigate to example.com and get the main heading
Claude will automatically:
- Open browser
- Navigate to the URL
- Extract the heading text
- Return the result
📚 Usage Examples
Simple: Get Page Title
Get the page title from example.com
Intermediate: Extract Data
Go to example.com, find all h2 headings, and extract their text
Advanced: Multi-Step Workflow
1. Switch to account "buyer_1"
2. Go to https://shop.example.com
3. Click "Add to Cart" button
4. Take a screenshot
5. Extract order confirmation
6. Switch to account "buyer_2"
7. Repeat steps 2-5
Complex: Automation Plan
Execute this automation:
{
"steps": [
{"type": "navigate", "value": "https://example.com/login"},
{"type": "fill", "selector": "input[name='email']", "value": "test@example.com"},
{"type": "fill", "selector": "input[name='password']", "value": "password123"},
{"type": "click", "selector": "button[type='submit']"},
{"type": "wait", "selector": ".dashboard"},
{"type": "screenshot"}
]
}
🔑 Key Features
| Feature | Benefit |
|---|---|
| 35 Tools | Covers 95% of automation needs |
| Auto-Healing Locators | Find elements even when selectors change (82% success) |
| Optional LLM Enhancement | Improve accuracy to 85-88% with Ollama/Claude/OpenAI/Gemini/Mistral |
| Python-based | Easy to extend and customize |
| No Selenium | Modern Playwright API |
| Stealth Mode | Bypass bot detection |
| Multi-account | Concurrent browser sessions |
| CAPTCHA Solving | OCR-based image solving |
| Proxy Support | Automatic rotation |
| PDF Export | Generate PDFs from pages |
| Session Recording | Trace automation for debugging |
| Test Assertions | Built-in testing framework |
📖 Documentation
| Guide | Purpose |
|---|---|
| Quick Start | 5-minute setup |
| Environment Setup | Configure API keys with .env files |
| Auto-Healing Locators | Smart element detection & fallback strategies |
| Optional LLM Enhancement | [NEW] Add intelligence (Ollama/Claude/OpenAI/Gemini/Mistral) |
| LLM Integration | Claude, GPT-4, Gemini, local LLaMA |
| Advanced Features | CAPTCHA, multi-account, proxies |
| Complete Tool Reference | All 35 tools explained |
| Architecture | How it works internally |
| Contributing | How to contribute |
| Changelog | What's new in v1.3.0 |
🛠️ Installation Options
From PyPI (Easiest)
pip install playwright-mcp-forge
With LLM Integration (Choose One)
# Anthropic Claude
pip install playwright-mcp-forge[claude]
# OpenAI ChatGPT
pip install playwright-mcp-forge[openai]
# Google Gemini
pip install playwright-mcp-forge[gemini]
# Mistral AI
pip install playwright-mcp-forge[mistral]
# All LLMProviders
pip install playwright-mcp-forge[all-llms]
From Source
git clone https://github.com/shakti44/playwright-mcp-forge.git
cd playwright-mcp-forge
pip install -e .
Complete Setup (Everything)
pip install playwright-mcp-forge[complete]
# Includes: CAPTCHA solving + all LLMs + dev tools
🤖 Using with Any LLM
Works with Claude, ChatGPT, Gemini, Mistral, LLaMA, and more!
Quick Setup:
- Install integration:
pip install playwright-mcp-forge[claude] - Set API key:
export ANTHROPIC_API_KEY=sk-... - Code or use in your framework
📖 Full LLM Integration Guide - Setup with 5+ LLM providers
❓ FAQ
Q: Can I use this without Claude Desktop? A: Yes! Works with any LLM (Claude, GPT-4, Gemini, local LLaMA). See LLM Integration Guide.
Q: Which LLM should I use? A: Claude is recommended, but use what fits your budget/latency needs. See comparison in LLM guide.
Q: How do I integrate with my existing framework? A: Install the package, set your LLM's API key, and import the tools. See integration examples in docs.
Q: How do I solve CAPTCHAs?
A: Install Tesseract OCR with pip install playwright-mcp-forge[captcha]. Works with image-based CAPTCHAs.
Q: Can I automate multiple accounts?
A: Yes! Use switch_account(name) to manage concurrent sessions with separate cookies and states.
Q: Does it work with all websites? A: Works with most sites. Stealth mode enabled by default. Some sites may require adjustments.
Q: How do I debug automation?
A: Use toggle_headless(False) to see browser GUI, or use start_trace() to record actions.
🤝 Contributing
We welcome contributions! See CONTRIBUTING.md for guidelines.
Quick links:
📊 What's Included
34 Total Tools:
- Browser Control (4) - navigate, screenshot, health checks, browser info
- Page Interaction (5) - click, type, scroll, wait for elements, viewport
- Data Extraction (4) - get text, HTML, fetch URLs, extract structured data
- Testing (2) - bot detection, test case generation
- Automation (4) - execute plans, manage cookies
- Advanced (5) - solve CAPTCHAs, multi-account, proxy rotation, headless toggle
- Tab Management (4) - get tabs, new tab, switch tab, close tab
- PDF & Recording (3) - generate PDF, start trace, stop trace
- Testing Tools (4) - assert visibility, text, count, element state
🗺️ Roadmap
v1.1.0 ✅ (Current)
- Tab management, PDF generation, test assertions
v1.2 🔜 (Planned)
- WebSocket support, performance metrics, request caching
v2.0 🔮 (Future)
- Distributed execution, ML integration, Web3 support
📄 License
MIT License - See LICENSE for details
Attribution: Built with Playwright and FastMCP
💬 Need Help?
⭐ Show Your Support
If this project helped you, please:
- Star the repository ⭐
- Share it with others
- Contribute improvements
Made with ❤️ for web automation enthusiasts
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file playwright_mcp_forge-1.3.0-py3-none-any.whl.
File metadata
- Download URL: playwright_mcp_forge-1.3.0-py3-none-any.whl
- Upload date:
- Size: 27.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d3d1a1cce9069cdc117f94090bd163735a7a9d0f233af8f17fce496a7620e32e
|
|
| MD5 |
409468b9833183ad87a52d9661585edb
|
|
| BLAKE2b-256 |
6baf101bcc05a03a5f3d56e48ab35bd33f1341637b255ec2c94573a0f8c76008
|