PyPen MCP
Provides capabilities for bypassing Cloudflare Turnstile captchas and interacting with Cloudflare-protected sites.
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., "@PyPen MCP Capture network requests from the login page and check for security issues"
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.
PyPen MCP
Model Context Protocol server for browser-based penetration testing using PyDoll.
Overview
PyPen MCP provides a comprehensive set of tools for LLM-powered browser automation and security testing. It leverages PyDoll's Chrome DevTools Protocol integration for reliable, webdriver-free browser control.
Related MCP server: nodriver-proxy-mcp
Features
Browser Management
Launch/close browser instances with configurable options
Navigation control (navigate, back, forward, refresh)
Headless mode, proxy support, custom user agents
Incognito mode and resource blocking
Network Operations
Monitoring: Capture all HTTP traffic, analyze requests/responses
Interception: Block, modify, or mock requests in real-time
Authenticated Requests: Make API calls that inherit browser session/cookies
DOM Manipulation
Find elements by CSS selector, XPath, or attributes
Click, type, scroll, and interact with elements
Extract page source, element text, and HTML
Human-like scrolling with physics simulation
JavaScript Execution
Execute arbitrary JavaScript in browser context
Access localStorage and sessionStorage
Extract global variables, forms, and links
Session Management
Cookie manipulation (get, set, delete, clear)
Import/export cookies in multiple formats
Session-aware HTTP requests
Captcha Handling
Turnstile Bypass: Automatic Cloudflare Turnstile interaction
Human Intervention: Request human help for unsolvable captchas (ReCAPTCHA v2, hCaptcha)
Detection: Identify captcha types on the page
Debugging
Screenshots (full page or elements)
Viewport control
Performance metrics
Element highlighting
Installation
pip install pypen-mcpOr install from source:
git clone https://github.com/your-repo/pypen-mcp
cd pypen-mcp
pip install -e .Configuration
Add to your MCP client configuration:
{
"mcpServers": {
"pypen": {
"command": "pypen-mcp"
}
}
}For development:
{
"mcpServers": {
"pypen": {
"command": "/path/to/pypen-mcp/.venv/bin/pypen-mcp"
}
}
}Usage Examples
Basic Browser Automation
# Launch browser
browser_launch(headless=True)
# Navigate to target
browser_navigate(url="https://example.com")
# Extract page content
dom_get_source()
# Find and interact with elements
dom_find_element(css_selector="#username")
dom_type(selector="#username", text="admin")
dom_click(selector="button[type=submit]")
# Take screenshot for documentation
debug_screenshot(path="/tmp/screenshot.png")
# Close when done
browser_close()Network Monitoring
# Enable traffic capture
network_enable_monitoring()
# Navigate and capture
browser_navigate(url="https://api.example.com")
# Get captured requests
network_get_logs(filter_url="/api/")
# Get response body for specific request
network_get_response_body(request_id="abc123")
# Disable when done
network_disable_monitoring()Request Interception
# Set up interception rules
network_setup_handler(
block_patterns=["analytics", "tracking", "ads"],
modify_headers={"Authorization": "Bearer token123"},
mock_responses={"/api/config": {"status": 200, "body": {"debug": true}}}
)
# Navigate with interception active
browser_navigate(url="https://example.com")Session-Based Requests
# Login via UI (handles complex auth)
browser_navigate(url="https://app.com/login")
dom_type(selector="#email", text="user@example.com")
dom_type(selector="#password", text="password123")
dom_click(selector="button[type=submit]")
# Make authenticated API calls
session_make_request(
url="https://app.com/api/user/profile",
method="GET"
)Captcha Handling
# Enable automatic Turnstile bypass
captcha_enable_turnstile_bypass(time_to_wait_captcha=10.0)
# Navigate to protected site
browser_navigate(url="https://protected-site.com")
# Wait for captcha processing
# ... automation continues ...
# For unsolvable captchas, request human help
captcha_detect_type() # Check what's on page
captcha_request_human_intervention(
captcha_type="recaptcha_v2",
message="Please solve the ReCAPTCHA to continue"
)
# Wait for human to solve
captcha_wait_for_resolution(request_id="abc123", timeout=300)Tool Reference
Browser Tools
Tool | Description |
| Launch browser with options (headless, proxy, etc.) |
| Close the browser instance |
| Navigate to a URL |
| Navigate back in history |
| Navigate forward in history |
| Refresh current page |
| Get current URL and title |
Network Tools
Tool | Description |
| Start capturing HTTP traffic |
| Stop traffic capture |
| Get captured requests (with optional filter) |
| Get response body for a request |
| Enable request interception |
| Disable interception |
| Configure auto interception rules |
DOM Tools
Tool | Description |
| Find element by selector |
| Find multiple elements |
| Get element text content |
| Get element HTML |
| Click an element |
| Type text into input |
| Scroll the page |
| Get full page HTML |
| Wait for element to appear |
JavaScript Tools
Tool | Description |
| Execute JavaScript code |
| Get console logs |
| Extract global variables |
| Get localStorage data |
| Get sessionStorage data |
| Set localStorage value |
| Get all forms with inputs |
| Get all links on page |
Session Tools
Tool | Description |
| Get all cookies |
| Get specific cookie |
| Set a cookie |
| Delete a cookie |
| Clear all cookies |
| Export cookies (json/netscape/header) |
| Import cookies from JSON |
| Make session-authenticated HTTP request |
Captcha Tools
Tool | Description |
| Enable auto Turnstile handling |
| Disable Turnstile handling |
| Detect captcha type on page |
| Auto-handle detected captcha |
| Request human help |
| Get unresolved requests |
| Mark intervention as resolved |
| Wait for human to solve |
Debug Tools
Tool | Description |
| Take page screenshot |
| Get viewport size |
| Set viewport size |
| Get performance metrics |
| Highlight matching elements |
Important Notes
Browser Session Persistence
The browser session persists until explicitly closed with
browser_closeAll operations (DOM, JS, network) use the same active session
Cookies and session state are maintained across navigations
Captcha Success Factors
Turnstile bypass success depends on:
IP Reputation: Use residential proxies with good reputation
Browser Fingerprint: Configure realistic browser options
Behavioral Patterns: Add realistic delays and interactions
Human Intervention Workflow
Detect captcha:
captcha_detect_type()Try auto-handling:
captcha_handle_auto()If fails, request help:
captcha_request_human_intervention()Wait for resolution:
captcha_wait_for_resolution()Continue automation
License
MIT
Available Tools
52 toolsbrowser_closeA
Close the browser instance
Inputs: no named parameters.
browser_get_infoA
Get information about the current page (URL, title)
Inputs: no named parameters.
browser_go_backA
Navigate back in browser history
Inputs: no named parameters.
browser_go_forwardA
Navigate forward in browser history
Inputs: no named parameters.
browser_launchB
Launch a new browser instance with optional configuration (headless, proxy, user agent, etc.)
Inputs: headless, proxy, user_agent, binary_location, +4 more.
browser_refreshA
Refresh the current page
Inputs: no named parameters.
captcha_detect_typeB
Detect what type of captcha is present on the current page. Scans for Cloudflare Turnstile, reCAPTCHA, hCaptcha, and image challenge indicators.
Inputs: no named parameters.
captcha_disable_turnstile_bypassA
Disable automatic Turnstile bypass
Inputs: no named parameters.
captcha_enable_turnstile_bypassA
Enable automatic Cloudflare Turnstile bypass. Uses PyDoll's built-in mechanism to detect and click the Turnstile checkbox. Success depends on IP reputation and browser fingerprint - this is NOT a magic bypass. Use residential proxies for best results.
Inputs: time_to_wait_captcha.
captcha_get_pending_interventionsA
Get all pending human intervention requests that have not been resolved
Inputs: no named parameters.
captcha_handle_autoA
Attempt to automatically handle any detected captcha. For Turnstile: uses built-in bypass. For others (ReCAPTCHA v2, hCaptcha, image challenges): returns need for human intervention.
Inputs: timeout.
captcha_request_human_interventionA
Request human intervention for an unsolvable captcha (e.g., ReCAPTCHA v2 image challenges, hCaptcha puzzles). Creates an intervention request with screenshot. The automation should wait for human to solve.
Inputs: captcha_type (required), message (required), take_screenshot.
captcha_resolve_interventionA
Mark an intervention request as resolved after human has solved the captcha. This allows the automation to continue.
Inputs: request_id (required), resolution.
captcha_wait_for_resolutionA
Block until a human intervention is resolved or timeout expires. Use this to pause automation while waiting for human to solve captcha.
Inputs: request_id (required), timeout, poll_interval.
debug_get_performanceB
Get performance metrics from the page
Inputs: no named parameters.
debug_get_viewportA
Get the current viewport size
Inputs: no named parameters.
debug_highlightB
Highlight all elements matching a selector
Inputs: selector (required), color.
debug_screenshotA
Take a screenshot of the current page. Returns the image directly. MUST be called after every dom_click to observe the result.
Inputs: no named parameters.
debug_set_viewportB
Set the viewport size
Inputs: width (required), height (required).
dom_clickB
Click on an element. IMPORTANT: You SHOULD either call debug_screenshot or view the source after every click to observe the result of the interaction.
Inputs: selector (required), timeout.
dom_find_elementC
Find an element on the page using various selectors
Inputs: tag_name, id, class_name, name, +4 more.
dom_find_elementsC
Find multiple elements on the page
Inputs: tag_name, class_name, css_selector, xpath, +1 more.
dom_get_htmlB
Get the outer HTML of an element
Inputs: selector (required), timeout.
dom_get_sourceB
Get the full page HTML source
Inputs: no named parameters.
dom_get_textB
Get the text content of an element
Inputs: selector (required), timeout.
dom_scrollB
Scroll the page
Inputs: direction, amount.
dom_typeC
Type text into an input element
Inputs: selector (required), text (required), clear_first, timeout.
dom_wait_forB
Wait for an element to appear on the page
Inputs: selector (required), timeout.
js_executeB
Execute JavaScript in the browser context
Inputs: script (required).
js_get_console_logsB
Get console logs from the browser
Inputs: no named parameters.
js_get_formsA
Get all forms on the page with their inputs
Inputs: no named parameters.
js_get_global_varsA
Extract global JavaScript variables
Inputs: no named parameters.
js_get_linksA
Get all links on the page
Inputs: no named parameters.
js_get_local_storageA
Get all localStorage data
Inputs: no named parameters.
js_get_session_storageA
Get all sessionStorage data
Inputs: no named parameters.
js_set_local_storageC
Set a localStorage value
Inputs: key (required), value (required).
network_disable_interceptionB
Disable request interception
Inputs: no named parameters.
network_disable_monitoringB
Disable network event monitoring
Inputs: no named parameters.
network_enable_interceptionB
Enable request/response interception
Inputs: resource_type, request_stage.
network_enable_monitoringB
Enable network event monitoring to capture all HTTP traffic
Inputs: no named parameters.
network_get_logsA
Get captured network logs, optionally filtered by URL pattern
Inputs: filter_url.
network_get_response_bodyB
Get the response body for a specific request ID
Inputs: request_id (required).
network_setup_handlerB
Set up automatic interception handler with blocking, modification, and mocking rules
Inputs: block_patterns, modify_headers, mock_responses.
session_clear_cookiesC
Clear all cookies
Inputs: no named parameters.
session_delete_cookieB
Delete a cookie by name
Inputs: name (required), domain.
session_export_cookiesB
Export cookies in various formats (json, netscape, header)
Inputs: format.
session_get_cookieB
Get a specific cookie by name
Inputs: name (required).
session_get_cookiesB
Get all cookies from the browser
Inputs: no named parameters.
session_import_cookiesB
Import cookies from JSON string
Inputs: cookies_json (required).
session_make_requestC
Make an HTTP request using the browser's session (inherits cookies/auth)
Inputs: url (required), method, headers, body, +1 more.
session_set_cookieC
Set a cookie in the browser
Inputs: name (required), value (required), domain, path, +2 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 52 tools
Each tool has a clear, distinct purpose, with prefixes like browser_, captcha_, debug_, dom_, js_, network_, session_ grouping related functionality. No two tools perform the same action, and even within groups, tools are well-differentiated.
All tool names follow a consistent snake_case convention with a prefix indicating the functional domain. This makes it easy for an agent to predict tool names and understand their roles.
52 tools is on the high side, but the server covers a broad scope of browser automation features (browser control, DOM, JS, network, sessions, captchas). The count is appropriate for the comprehensive capability set, though slightly above the ideal range.
The tool surface is remarkably complete: browser lifecycle, navigation, DOM interactions, debugging, JavaScript execution, network monitoring/interception, cookie/session management, and captcha handling all have dedicated tools. No obvious gaps for the intended domain.
Related MCP Connectors
Cloud browser, web extraction, screenshots, and remote CDP tools for AI agents.
Browser agents and stealth cloud browsers for AI: run web tasks, fill forms, extract data.
Cloud browsers for AI agents: saved logins, residential IPs, live human takeover, 57 browser tools.
Undetectable cloud browser sessions for AI agents and scrapers. Navigate, extract, click, captcha.
Related MCP Servers
- AlicenseBqualityDmaintenanceEnables LLMs to interact with web pages, take screenshots, and execute JavaScript in a real browser environment10264 npm297MIT
- AlicenseAqualityDmaintenanceGives AI agents a browser that bypasses bot detection, a MITM proxy for traffic interception, and a Python sandbox to autonomously write and execute security exploits.393MIT
- FlicenseNot gradedqualityDmaintenanceEnables AI agents to automate and debug real Chromium browsers with capabilities like screenshots, video recording, performance analysis, visual regression testing, and OCR text extraction.13-
- AlicenseAqualityCmaintenanceEnables AI agents to fully control a browser for web automation, including navigation, clicking, typing, scrolling, screenshots, and DOM inspection, with session persistence and anti-bot bypass.4043 npmMIT