Powerful MCP server for real-time browser automation and debugging via Patchright (Playwright stealth fork).
Built on Patchright and exposing 69 tools via Model Context Protocol — from basic click/screenshot to route interception, raw Chrome DevTools Protocol, multi-tab orchestration, fingerprint spoofing, and token-cheap WebSocket/HTTP capture to disk.
- Native stealth — Patchright bypasses bot detection by default (webdriver=false, plugins, fingerprint)
- Automatic capture — every HTTP request/response, WS frame and console log written to JSONL per session
- Token-cheap — query tools (
tail_ws,query_network,list_endpoints,ws_summary) return only what matters - Batch execution —
fill_formandbatch_actionsreduce N round-trips to 1 - Raw CDP — any Chrome DevTools Protocol command (
Network.*,Page.*,Runtime.*,Emulation.*,Fetch.*) - Session forge — cookies, localStorage, sessionStorage, headers, UA, geo, timezone, device emulation
- Multi-tab — multiple tabs with own IDs, switch/close/list
npx -y @devadminhu/patchright-mcpOr global:
npm i -g @devadminhu/patchright-mcpAdd to your MCP config (.mcp.json or equivalent):
{
"mcpServers": {
"patchright-mcp": {
"command": "npx",
"args": ["-y", "@devadminhu/patchright-mcp"]
}
}
}Tools will appear as mcp__patchright-mcp__*.
launch_browser sessionId="x" headless=false
Cloudflare / anti-bot bypass (passes JS challenge even in headless):
launch_browser
sessionId="x"
headless=true
cfBypass=true
userDataDir="/path/to/profile"
cfBypass=true applies:
channel="chrome"(real installed Chrome, not Chromium)- Anti-detect args (
--disable-blink-features=AutomationControlled, etc) ignoreDefaultArgs=["--enable-automation"]- Real Chrome 147 UA (no "Headless")
- Auto
stealth_inject(webdriver=undefined, plugins, hardware)
userDataDir + lockProfile (default true) persists cf_clearance across runs with fcntl-style lock to prevent two instances corrupting LevelDB.
Or connect to an already-running Chrome via CDP:
google-chrome --remote-debugging-port=9222 &ws_connect_local sessionId="x"
stealth_inject sessionId="x"
navigate sessionId="x" url="https://example.com"
ws_summary sessionId="x" # WS URL summary + counts
tail_ws sessionId="x" limit=20 evt=send # last 20 sent WS messages
list_endpoints sessionId="x" # unique HTTP hosts/paths
query_network sessionId="x" urlPattern="api/login" limit=5
session_storage_info sessionId="x" # captured file sizes
export_session sessionId="x" # full dump as JSON
start_debug_session— create session (with or without wsEndpoint)ws_connect_local— connect to local Chrome on port 9222launch_browser— launch Chrome (headful/headless, viewport, userDataDir)list_sessions— list active sessionsget_session_info— detailed session infoclose_session— close and cleanup
navigate— go to URL (customizable waitUntil)reload,go_back,go_forwardwait_for_navigation— wait for load to completewait_for_response— wait for response matching pattern
click_element,hover,type_text,set_inputpress_key(Enter, Escape, Ctrl+a, etc)scroll_to,select_option,drag_dropupload_file,download_filefill_form— batch fill multiple fields in one callbatch_actions— action sequence (fill/click/wait/eval/press/select/hover/screenshot)
inspect_dom— HTML, styles, rect, attributesquery_all— all matching elementsfind_by_text— search by visible textget_html,get_text,get_page_statewait_for_element,evaluate_script
intercept_route— abort/continue/fulfill (mock response, modify headers/body)remove_route,block_resourcesdebug_network,get_full_network,get_response_body
list_endpoints— unique hosts/paths/methods with countquery_network— filters (urlPattern, method, status, phase) + paginationtail_ws— last N WS messages with filtersws_summary— counts per URL (create/send/recv/close)session_storage_info,clear_session_storage,export_session
get_cookies,set_cookies,clear_cookiesget_storage,set_storage,save_storage_state
stealth_inject— webdriver=false, plugins, hardware maskingset_user_agent,set_geolocation,set_timezoneset_extra_headers,emulate_device
new_tab,list_tabs,switch_tab,close_tab
capture_screenshot,save_pdfstart_video,stop_video
cdp_command— raw Chrome DevTools Protocol command
debug_console,get_performance_metrics,exec_accessibility_audit
Everything is automatically written to /tmp/mcp-patchright/<sessionId>/:
network.jsonl # all HTTP requests + responses
ws.jsonl # all WebSocket frames (create/send/recv/close)
console.jsonl # all console logs
Use query tools to search without dumping everything into context. Or export_session to get a single JSON file ready for external analysis.
- PDF (
save_pdf) only works in headless mode (Chromium limitation) - Raw CDP (
cdp_command) is dev mode — no validation, any CDP method accepted
MIT — devadminhu