Patchright Lite MCP Server
Provides a containerized version of the Patchright MCP server, accessible through Docker Hub for easy deployment and integration with AI tools
Allows GitHub Copilot to leverage Patchright's stealth browser automation capabilities through VS Code, enabling undetected web scraping and interaction
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Patchright Lite MCP Server browse to amazon.com and extract the text from the homepage"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Patchright Lite MCP Server
A streamlined Model Context Protocol (MCP) server that wraps the Patchright Node.js SDK to provide stealth browser automation capabilities to AI models. This lightweight server focuses on essential functionality to make it easier for simpler AI models to use.
What is Patchright?
Patchright is an undetected version of the Playwright testing and automation framework. It's designed as a drop-in replacement for Playwright, but with advanced stealth capabilities to avoid detection by anti-bot systems. Patchright patches various detection techniques including:
Runtime.enable leak
Console.enable leak
Command flags leaks
General detection points
Closed Shadow Root interactions
This MCP server wraps the Node.js version of Patchright to make its capabilities available to AI models through a simple, standardized protocol.
Related MCP server: Puppeteer-Extra MCP Server
Features
Simple Interface: Focused on core functionality with just 4 essential tools
Stealth Automation: Uses Patchright's stealth mode to avoid detection
MCP Standard: Implements the Model Context Protocol for easy AI integration
Stdio Transport: Uses standard input/output for seamless integration
Prerequisites
Node.js 18+
npm or yarn
Installation
Clone this repository:
git clone https://github.com/yourusername/patchright-lite-mcp-server.git cd patchright-lite-mcp-serverInstall dependencies:
npm installBuild the TypeScript code:
npm run buildInstall Chromium-Driver for Pathright:
npx patchright install chromium
Usage
Run the server with:
npm startThis will start the server with stdio transport, making it ready to integrate with AI tools that support MCP.
Integrating with AI Models
Claude Desktop
Add this to your claude-desktop-config.json file:
{
"mcpServers": {
"patchright": {
"command": "node",
"args": ["path/to/patchright-lite-mcp-server/dist/index.js"]
}
}
}VS Code with GitHub Copilot
Use the VS Code CLI to add the MCP server:
code --add-mcp '{"name":"patchright","command":"node","args":["path/to/patchright-lite-mcp-server/dist/index.js"]}'Available Tools
The server provides just 4 essential tools:
1. browse
Launches a browser, navigates to a URL, and extracts content.
Tool: browse
Parameters: {
"url": "https://example.com",
"headless": true,
"waitFor": 1000
}Returns:
Page title
Visible text preview
Browser ID (for subsequent operations)
Page ID (for subsequent operations)
Screenshot path
2. interact
Performs a simple interaction on a page.
Tool: interact
Parameters: {
"browserId": "browser-id-from-browse",
"pageId": "page-id-from-browse",
"action": "click", // can be "click", "fill", or "select"
"selector": "#submit-button",
"value": "Hello World" // only needed for fill and select
}Returns:
Action result
Current URL
Screenshot path
3. extract
Extracts specific content from the current page.
Tool: extract
Parameters: {
"browserId": "browser-id-from-browse",
"pageId": "page-id-from-browse",
"type": "text" // can be "text", "html", or "screenshot"
}Returns:
Extracted content based on the requested type
4. close
Closes a browser to free resources.
Tool: close
Parameters: {
"browserId": "browser-id-from-browse"
}Example Usage Flow
Launch a browser and navigate to a site:
Tool: browse Parameters: { "url": "https://example.com/login", "headless": false }Fill in a login form:
Tool: interact Parameters: { "browserId": "browser-id-from-step-1", "pageId": "page-id-from-step-1", "action": "fill", "selector": "#username", "value": "user@example.com" }Fill in password:
Tool: interact Parameters: { "browserId": "browser-id-from-step-1", "pageId": "page-id-from-step-1", "action": "fill", "selector": "#password", "value": "password123" }Click the login button:
Tool: interact Parameters: { "browserId": "browser-id-from-step-1", "pageId": "page-id-from-step-1", "action": "click", "selector": "#login-button" }Extract text to verify login:
Tool: extract Parameters: { "browserId": "browser-id-from-step-1", "pageId": "page-id-from-step-1", "type": "text" }Close the browser:
Tool: close Parameters: { "browserId": "browser-id-from-step-1" }
Security Considerations
This server provides powerful automation capabilities. Use it responsibly and ethically.
Avoid automating actions that would violate websites' terms of service.
Be mindful of rate limits and don't overload websites with requests.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
Patchright-nodejs by Kaliiiiiiiiii-Vinyzu
Model Context Protocol by modelcontextprotocol
Docker Usage
You can run this server using Docker:
docker run -it --rm dylangroos/patchright-mcpBuilding the Docker Image Locally
Build the Docker image:
docker build -t patchright-mcp .Run the container:
docker run -it --rm patchright-mcpDocker Hub
The image is automatically published to Docker Hub when changes are merged to the main branch. You can find the latest image at: dylangroos/patchright-mcp
Available Tools
4 toolsbrowseB
Browse to a URL and return the page title and visible text
Inputs: url (required), headless, waitFor.
closeC
Close browser to free resources
Inputs: browserId (required).
extractC
Extract information from the current page as text, html, or screenshot
Inputs: browserId (required), pageId (required), type (required).
interactC
Perform simple interactions on a page
Inputs: browserId (required), pageId (required), action (required), selector (required), +1 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
The tools have mostly distinct purposes with clear boundaries: browse for navigation, extract for content retrieval, interact for actions, and close for cleanup. However, 'extract' and 'interact' could potentially overlap in some use cases (e.g., extracting after an interaction), but their descriptions help differentiate them.
All tool names follow a consistent, simple verb-based pattern (browse, close, extract, interact) without any mixing of conventions. This makes the set predictable and easy to understand at a glance.
With 4 tools, this server is well-scoped for its apparent purpose of web browsing and interaction. Each tool serves a clear, essential function, and there are no extraneous or redundant tools, making the count appropriate for the domain.
The toolset covers the core web browsing lifecycle: navigate (browse), retrieve content (extract), perform actions (interact), and clean up (close). A minor gap is the lack of explicit tools for handling multiple tabs or sessions, but agents can likely work around this with the provided tools.
Maintenance
Related MCP Connectors
Official Browserless MCP server: browser automation, scraping, screenshots and PDFs for AI agents.
A Model Context Protocol server for Wix AI tools
Hosted Web Crawler MCP server for Claude, ChatGPT and Cursor, with each action switched per account.
Web scraping, browser automation, screenshots and AI data extraction for AI agents via MCP.
Related MCP Servers
- AlicenseDqualityDmaintenanceAI-driven browser automation server that implements the Model Context Protocol to enable natural language control of web browsers for tasks like navigation, form filling, and visual interaction.12MIT
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that provides enhanced browser automation capabilities using Puppeteer-Extra with Stealth Plugin, enabling LLMs to interact with web pages in a way that better emulates human behavior and avoids detection as automation.3MIT
- AlicenseBqualityDmaintenanceA Model Context Protocol server that enables AI assistants to control a real web browser with stealth capabilities, avoiding bot detection while performing tasks like clicking, filling forms, taking screenshots, and extracting data.1156 npm26MIT
- AlicenseNot gradedqualityDmaintenanceA 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.1MIT