
Puppeteer真实浏览器
STDIO提供防检测浏览器自动化能力的MCP服务器
提供防检测浏览器自动化能力的MCP服务器
A Model Context Protocol (MCP) server that provides AI assistants with powerful, detection-resistant browser automation capabilities using puppeteer-real-browser.
This is an MCP (Model Context Protocol) server that lets AI assistants like Claude control a real web browser. Think of it as giving Claude "hands" to interact with websites - it can click buttons, fill forms, take screenshots, and much more, all while avoiding bot detection.
node --version
The npx command will automatically download and run the latest version, so no manual installation is needed.
For Windows:
%APPDATA%\Claude\
claude_desktop_config.json
{ "mcpServers": { "puppeteer-real-browser": { "command": "npx", "args": ["puppeteer-real-browser-mcp-server@latest"] } } }
For Mac:
Cmd+Shift+G
~/Library/Application Support/Claude/
claude_desktop_config.json
For Linux:
~/.config/Claude/
claude_desktop_config.json
Close and reopen Claude Desktop completely.
In Claude Desktop, try saying:
"Initialize a browser and navigate to google.com, then take a screenshot"
If everything is working, Claude should be able to:
Once set up, you can ask Claude to:
headless: true
) if you don't want to see the browser windowThe Puppeteer Real Browser MCP Server acts as a bridge between AI assistants and browser automation. It leverages puppeteer-real-browser to provide stealth browsing capabilities that can bypass common bot detection mechanisms.
This server implements the Model Context Protocol (MCP), allowing AI assistants to control a real browser with human-like interactions, take screenshots, extract content, and more.
page.realClick
and page.realCursor
setTarget
functionnpm install -g puppeteer-real-browser-mcp-server
# Clone the repository git clone https://github.com/withLinda/puppeteer-real-browser-mcp-server.git cd puppeteer-real-browser-mcp-server # Install dependencies npm install # Build the project npm run build
Add to Claude Desktop config:
{ "mcpServers": { "puppeteer-real-browser": { "command": "npx", "args": ["puppeteer-real-browser-mcp-server@latest"] } } }
Start the server:
puppeteer-real-browser-mcp-server
Or if installed from source:
npm start
The server communicates via stdin/stdout using the MCP protocol.
User: "Initialize a browser and navigate to example.com" AI: I'll initialize a stealth browser and navigate to the website. [Uses browser_init and navigate tools] User: "Take a screenshot of the main content" AI: I'll capture a screenshot of the page. [Uses screenshot tool]
User: "Fill in the search form with 'test query'" AI: I'll type that into the search field using human-like typing. [Uses human_like_type tool with selector and text] User: "Click the search button" AI: I'll click the search button with human-like movement. [Uses human_like_click tool]
User: "Get all the product names from this e-commerce page" AI: I'll extract the product information from the page. [Uses get_content tool with appropriate selectors] User: "Save the page content as text" AI: I'll get the text content of the entire page. [Uses get_content tool with type: 'text']
User: "Use real click on the dropdown menu" AI: I'll use the enhanced real_click method for better interaction. [Uses real_click tool with selector and options] User: "Move the cursor to coordinates 500, 300 smoothly" AI: I'll move the cursor using enhanced movement. [Uses real_cursor tool with x, y coordinates and step options]
User: "Initialize a browser with a proxy server" AI: I'll set up the browser with your proxy configuration. [Uses browser_init with proxy: "https://proxy.example.com:8080"]
Tool Name | Description | Required Parameters | Optional Parameters |
---|---|---|---|
browser_init | Initialize stealth browser with advanced options | None | headless , disableXvfb , ignoreAllFlags , proxy , plugins , connectOption |
navigate | Navigate to a URL | url | waitUntil |
screenshot | Take a screenshot of page or element | None | fullPage , selector |
get_content | Get page content (HTML or text) | None | type , selector |
browser_close | Close the browser instance | None | None |
Tool Name | Description | Required Parameters | Optional Parameters |
---|---|---|---|
click | Standard click on element | selector | waitForNavigation |
type | Type text into input field | selector , text | delay |
wait | Wait for various conditions | type , value | timeout |
Tool Name | Description | Required Parameters | Optional Parameters |
---|---|---|---|
real_click | Enhanced click using page.realClick | selector | options (button, clickCount, delay) |
real_cursor | Enhanced cursor movement using page.realCursor | selector OR x ,y | options (steps) |
set_target | Use setTarget function for advanced targeting | target | None |
Tool Name | Description | Required Parameters | Optional Parameters |
---|---|---|---|
human_like_click | Click with human-like mouse movement | selector | None |
human_like_type | Type text with human-like timing | selector , text | None |
random_scroll | Perform random scrolling with natural timing | None | None |
Tool Name | Description | Required Parameters | Optional Parameters |
---|---|---|---|
solve_captcha | Attempt to solve captchas | type | None |
The server includes several tools designed to mimic human behavior:
These features help avoid detection by sophisticated bot-detection systems that analyze user behavior patterns.
The server includes basic support for solving common captcha types:
Note that captcha solving capabilities depend on the underlying puppeteer-real-browser implementation.
Custom options like headless mode are not configured in the MCP config file. Instead, they're passed when initializing the browser using the browser_init
tool:
When you ask Claude to initialize a browser, you can specify options like:
Please initialize a browser with headless mode enabled and a 30-second timeout
Claude will then use the browser_init
tool with appropriate parameters:
{ "headless": true, "connectOption": { "timeout": 30000 } }
When initializing with browser_init
, you can configure:
headless
: true/false (Set to true for headless operation)disableXvfb
: true/false (Disable X Virtual Framebuffer)ignoreAllFlags
: true/false (Ignore all Chrome flags)proxy
: "https://proxy:8080" (Proxy server URL)plugins
: ["plugin1", "plugin2"] (Array of plugins to load)connectOption
: Additional connection options like:
slowMo
: 250 (Slow down operations by milliseconds)timeout
: 60,000 (Connection timeout)The MCP config file only tells Claude where to find the server - all browser-specific options are configured through your conversations with Claude.
When initializing the browser with browser_init
, you can configure:
{ "headless": false, "disableXvfb": false, "ignoreAllFlags": false, "proxy": "https://proxy:8080", "plugins": ["plugin1", "plugin2"], "connectOption": { "slowMo": 250, "timeout": 60000 } }
{ "headless": true, "proxy": "https://username:[email protected]:8080" }
{ "headless": false, "ignoreAllFlags": true, "disableXvfb": false, "connectOption": { "slowMo": 100, "devtools": false } }
Using real_click with options:
{ "selector": "#submit-button", "options": { "button": "left", "clickCount": 2, "delay": 150 } }
Using real_cursor with coordinates:
{ "x": 500, "y": 300, "options": { "steps": 30 } }
For advanced users, you can modify the server behavior by editing the source code:
initializeBrowser
function"command not found" or "syntax error" when using npx
npx puppeteer-real-browser-mcp-server@latest
npm install -g puppeteer-real-browser-mcp-server@latest
npm install -g puppeteer-real-browser-mcp-server
npm config get prefix
Browser won't start
sudo apt-get install -y chromium-browser
headless: true
firstClaude doesn't see the MCP server
claude_desktop_config.json
is in the correct locationPermission denied errors
sudo npm install -g puppeteer-real-browser-mcp-server
Detection issues
real_click
and real_cursor
instead of basic clickhuman_like_click
, human_like_type
random_scroll
proxy: "http://proxy.example.com:8080"
Memory leaks
browser_close
when doneTimeout errors
{ "timeout": 60000 }
wait
tool before interacting with elementsQ: Does this work with headless browsers?
A: Yes, set headless: true
in browser_init options.
Q: Can I use multiple browsers at once? A: Currently supports one browser instance. Close the current one before starting a new one.
Q: What captchas can it solve? A: Supports reCAPTCHA, hCaptcha, and Cloudflare Turnstile through puppeteer-real-browser.
Q: Is this detectable by websites? A: puppeteer-real-browser includes anti-detection features, but no solution is 100% undetectable.
Q: Can I use custom Chrome extensions?
A: Yes, through the plugins
option in browser_init.
Q: Does it work on all operating systems? A: Yes, tested on Windows, macOS, and Linux.
To enable debug logging:
DEBUG=true npm start
Or when running from source:
DEBUG=true npm run dev
If you're still having issues:
node --version
)npm --version
)puppeteer-real-browser-mcp-server/ ├── src/ │ ├── index.ts # Main server implementation │ └── stealth-actions.ts # Human-like interaction functions ├── test/ │ └── test-server.ts # Test script ├── package.json └── tsconfig.json
# Install dependencies npm install # Run in development mode npm run dev # Build for production npm run build # Test the server npm test
To add a new tool:
TOOLS
array in src/index.ts
CallToolRequestSchema
handlerContributions are welcome! Please feel free to submit a Pull Request.
git checkout -b feature/amazing-feature
)git commit -m 'Add some amazing feature'
)git push origin feature/amazing-feature
)This project is licensed under the MIT License - see the LICENSE file for details.