mcp-stealth-chrome 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,451 @@
1
+ Metadata-Version: 2.3
2
+ Name: mcp-stealth-chrome
3
+ Version: 0.1.0
4
+ Summary: Stealth Chrome MCP server — nodriver + Chromium + 80+ tools with Cloudflare/Turnstile bypass, CapSolver, storage-state reuse
5
+ Keywords: mcp,model-context-protocol,nodriver,stealth,anti-detection,cloudflare-bypass,turnstile,browser-automation,chromium,chrome,claude,captcha
6
+ Author: RobithYusuf
7
+ Author-email: RobithYusuf <robithdev@gmail.com>
8
+ License: MIT
9
+ Classifier: Development Status :: 4 - Beta
10
+ Classifier: Environment :: Console
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: License :: OSI Approved :: MIT License
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Programming Language :: Python :: 3.11
15
+ Classifier: Programming Language :: Python :: 3.12
16
+ Classifier: Programming Language :: Python :: 3.13
17
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
18
+ Classifier: Topic :: Internet :: WWW/HTTP :: Browsers
19
+ Requires-Dist: mcp>=1.2.0
20
+ Requires-Dist: nodriver>=0.40
21
+ Requires-Dist: pydantic>=2.5
22
+ Requires-Dist: httpx>=0.27
23
+ Requires-Dist: opencv-python>=4.8
24
+ Requires-Dist: curl-cffi>=0.7
25
+ Requires-Python: >=3.11
26
+ Project-URL: Homepage, https://github.com/RobithYusuf/mcp-stealth-chrome
27
+ Project-URL: Repository, https://github.com/RobithYusuf/mcp-stealth-chrome
28
+ Project-URL: Issues, https://github.com/RobithYusuf/mcp-stealth-chrome/issues
29
+ Description-Content-Type: text/markdown
30
+
31
+ <div align="center">
32
+
33
+ # MCP Stealth Chrome
34
+
35
+ **94 tools** for AI agents that bypass Cloudflare, Turnstile, reCAPTCHA, and modern anti-bot systems.
36
+
37
+ [![PyPI version](https://img.shields.io/pypi/v/mcp-stealth-chrome.svg)](https://pypi.org/project/mcp-stealth-chrome/)
38
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
39
+ [![Python 3.11+](https://img.shields.io/badge/python-3.11+-blue.svg)](https://www.python.org)
40
+
41
+ Browser stealth when you need eyes. TLS-perfect HTTP when you need speed.
42
+
43
+ </div>
44
+
45
+ ---
46
+
47
+ Built on [nodriver](https://github.com/ultrafunkamsterdam/nodriver) (direct CDP, no WebDriver leak) + [curl_cffi](https://github.com/lexiforest/curl_cffi) (TLS fingerprint spoofing) + [FastMCP](https://github.com/modelcontextprotocol/python-sdk).
48
+
49
+ One-line install with `uvx`:
50
+
51
+ ```bash
52
+ claude mcp add stealth-chrome -- uvx mcp-stealth-chrome@latest
53
+ ```
54
+
55
+ ## Proven on Real Sites
56
+
57
+ | Site | Challenge | Result |
58
+ |------|-----------|--------|
59
+ | `bot.sannysoft.com` | All fingerprint tests | ✅ 100% pass |
60
+ | `dash.cloudflare.com/login` | Turnstile visible | ✅ Passed via `click_turnstile()` |
61
+ | `tls.browserleaks.com` | TLS JA3/JA4 fingerprint | ✅ Real Chrome/Firefox/Safari |
62
+ | `httpbin.org` | Multi-instance isolation | ✅ Two browsers parallel |
63
+ | `google.com/recaptcha/api2/demo` | **reCAPTCHA v2 image challenge** | ✅ **5/5 = 100%** via `solve_recaptcha_ai()` |
64
+
65
+ ### 🏆 reCAPTCHA v2 Benchmark (5 consecutive runs)
66
+
67
+ Fresh profile + mouse drift warmup + gpt-5.4 via patungin.id (OpenAI-compat):
68
+
69
+ ```
70
+ Run 1: ✅ 2169ch token, tiles=[3,4,7], 146s
71
+ Run 2: ✅ 2126ch token, tiles=[0,2,4,7], 80s
72
+ Run 3: ✅ 2169ch token, tiles=[1,2,4,8], 143s
73
+ Run 4: ✅ 2148ch token, tiles=[1,4,5,6,8,9], 126s
74
+ Run 5: ✅ 2169ch token, tiles=[0,3,4], 69s
75
+
76
+ Success rate: 5/5 = 100%
77
+ Avg solve: 113s
78
+ Token range: 2126–2169 chars (all Google-accepted)
79
+ ```
80
+
81
+ **First OSS MCP with proven 100% reCAPTCHA v2 bypass via BYO-API-key** — works with
82
+ Claude, gpt-4o, gpt-5.x, Gemini, Groq, local Ollama, any OpenAI-compatible vision model.
83
+
84
+ Method: neutral prompt language bypasses LLM safety filter + auto-refresh challenge
85
+ when vision returns empty + dynamic 3x3/4x4 grid detection + humanized mouse behavior.
86
+
87
+ ## Key Differentiators
88
+
89
+ Compared to the leading Python stealth MCP ([vibheksoni/stealth-browser-mcp](https://github.com/vibheksoni/stealth-browser-mcp), 476⭐):
90
+
91
+ | Feature | mcp-stealth-chrome | vibheksoni |
92
+ |---------|:-------------------:|:-----------:|
93
+ | Tools | **94** | 90 |
94
+ | `click_turnstile` one-liner | ✅ **Proven bypass** | ❌ |
95
+ | Dual-mode HTTP (curl_cffi TLS) | ✅ **Unique** | ❌ |
96
+ | AI Vision reCAPTCHA solver (Claude) | ✅ **Unique** | ❌ |
97
+ | Precision Mouse Kit (11 tools) | ✅ **Unique** | ❌ |
98
+ | Multi-instance + idle reaper | ✅ | ✅ |
99
+ | Install | `uvx` zero-setup | `git clone + pip` |
100
+ | Sister Firefox package | ✅ [mcp-camoufox](https://github.com/RobithYusuf/mcp-camoufox) | ❌ |
101
+ | Network interception hooks | ⚠️ basic | ✅ **AI-generated Python hooks** |
102
+ | Pixel-perfect element cloning | ⚠️ basic | ✅ **300+ CSS + events** |
103
+
104
+ **Different niches**: we focus on anti-bot bypass, they focus on UI reverse-engineering. Both MCPs work great together.
105
+
106
+ ## Quick Install (3 commands per OS)
107
+
108
+ **macOS:**
109
+ ```bash
110
+ curl -LsSf https://astral.sh/uv/install.sh | sh # install uv
111
+ brew install --cask google-chrome # install Chrome (skip if already installed)
112
+ claude mcp add stealth-chrome --scope user -- uvx mcp-stealth-chrome@latest
113
+ ```
114
+
115
+ **Linux (Ubuntu/Debian):**
116
+ ```bash
117
+ curl -LsSf https://astral.sh/uv/install.sh | sh
118
+ sudo apt install -y google-chrome-stable # or chromium-browser
119
+ claude mcp add stealth-chrome --scope user -- uvx mcp-stealth-chrome@latest
120
+ ```
121
+
122
+ **Windows (PowerShell):**
123
+ ```powershell
124
+ powershell -c "irm https://astral.sh/uv/install.ps1 | iex"
125
+ winget install Google.Chrome
126
+ claude mcp add stealth-chrome --scope user -- uvx mcp-stealth-chrome@latest
127
+ ```
128
+
129
+ No Chrome? Server gives a friendly error with install instructions before failing.
130
+
131
+ See [INSTALL.md](INSTALL.md) for detailed per-client setup (Claude Code / Desktop / Cursor). TL;DR below:
132
+
133
+ <details>
134
+ <summary><b>Claude Code CLI</b></summary>
135
+
136
+ ```bash
137
+ # Global (available in all projects):
138
+ claude mcp add stealth-chrome --scope user -- uvx mcp-stealth-chrome@latest
139
+
140
+ # Project only:
141
+ claude mcp add stealth-chrome -- uvx mcp-stealth-chrome@latest
142
+ ```
143
+ </details>
144
+
145
+ <details>
146
+ <summary><b>Claude Desktop</b></summary>
147
+
148
+ Add to `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS):
149
+
150
+ ```json
151
+ {
152
+ "mcpServers": {
153
+ "stealth-chrome": {
154
+ "command": "uvx",
155
+ "args": ["mcp-stealth-chrome@latest"]
156
+ }
157
+ }
158
+ }
159
+ ```
160
+ </details>
161
+
162
+ <details>
163
+ <summary><b>Cursor</b></summary>
164
+
165
+ `~/.cursor/mcp.json`:
166
+
167
+ ```json
168
+ {
169
+ "mcpServers": {
170
+ "stealth-chrome": {
171
+ "command": "uvx",
172
+ "args": ["mcp-stealth-chrome@latest"]
173
+ }
174
+ }
175
+ }
176
+ ```
177
+ </details>
178
+
179
+ ### Optional: API Keys for CAPTCHA Solvers
180
+
181
+ `solve_recaptcha_ai` works with **Claude OR any OpenAI-compatible vision API** (gpt-4o, gpt-5.x, Groq, Ollama local, patungin.id, Together.ai, etc). Pick one:
182
+
183
+ **Anthropic Claude:**
184
+ ```json
185
+ "env": {
186
+ "ANTHROPIC_API_KEY": "sk-ant-xxxxx",
187
+ "CAPSOLVER_KEY": "CAP-xxxxx"
188
+ }
189
+ ```
190
+
191
+ **OpenAI-compatible (any provider with `/v1/chat/completions`):**
192
+ ```json
193
+ "env": {
194
+ "AI_VISION_BASE_URL": "https://ai.patungin.id/v1",
195
+ "AI_VISION_API_KEY": "your-key-here",
196
+ "AI_VISION_MODEL": "gpt-5.4"
197
+ }
198
+ ```
199
+
200
+ Or vanilla OpenAI (inherits default base URL):
201
+ ```json
202
+ "env": {
203
+ "OPENAI_API_KEY": "sk-xxxxx",
204
+ "AI_VISION_MODEL": "gpt-4o"
205
+ }
206
+ ```
207
+
208
+ Provider priority: explicit args to tool > `AI_VISION_*` env > `OPENAI_API_KEY` > `ANTHROPIC_API_KEY`.
209
+
210
+ ## Requirements
211
+
212
+ - Python 3.11+
213
+ - `uv` installed: `curl -LsSf https://astral.sh/uv/install.sh | sh`
214
+ - Chrome or Chromium browser (auto-detected by nodriver)
215
+
216
+ ## Tool Categories (94)
217
+
218
+ ### ⭐⭐⭐ Dual-Mode HTTP (unique)
219
+ | Tool | Purpose |
220
+ |------|---------|
221
+ | `http_request` | TLS-perfect HTTP via curl_cffi (chrome/firefox/safari impersonation) |
222
+ | `http_session_cookies` | Inspect which browser cookies match a URL |
223
+ | `session_warmup` | Natural browsing pattern (homepage/referer/scroll) before target |
224
+ | `detect_anti_bot` | Identify CF/DataDome/PerimeterX/Kasada/Imperva on current page |
225
+
226
+ ### ⭐⭐ Precision Mouse Kit (unique)
227
+ | Tool | Purpose |
228
+ |------|---------|
229
+ | `click_turnstile` | One-liner CF Turnstile bypass (proven) |
230
+ | `click_element_offset` | Click at % position inside element (not center) |
231
+ | `click_at_corner` | Click top-left/right/bottom-left/right of element |
232
+ | `find_by_image` | OpenCV template match → coordinates |
233
+ | `click_at_image` | Find image + click its center |
234
+ | `mouse_drift` | Random Bezier wandering (pass behavioral ML) |
235
+ | `mouse_record` / `mouse_replay` | Capture real human mouse patterns, replay |
236
+
237
+ ### ⭐⭐ AI Vision Solver (unique)
238
+ | Tool | Purpose |
239
+ |------|---------|
240
+ | `solve_recaptcha_ai` | Claude vision picks matching tiles — solve image challenges |
241
+
242
+ ### ⭐ Stealth Toolkit
243
+ | Tool | Purpose |
244
+ |------|---------|
245
+ | `storage_state_save` / `storage_state_load` | Portable session export — bypass Turnstile via reuse |
246
+ | `solve_captcha` | CapSolver API — Turnstile/reCAPTCHA/hCaptcha |
247
+ | `verify_cf` | Cloudflare checkbox via OpenCV template match |
248
+ | `fingerprint_rotate` | UA/lang/platform/timezone via CDP |
249
+ | `humanize_click` / `humanize_type` | Bezier+Gaussian for single actions |
250
+
251
+ ### Multi-Instance
252
+ | Tool | Purpose |
253
+ |------|---------|
254
+ | `spawn_browser` | New named instance (parallel profiles) |
255
+ | `list_instances` / `switch_instance` | Manage multiple browsers |
256
+ | `close_instance` / `close_all_instances` | Clean shutdown |
257
+
258
+ ### Standard Browser Automation (lifecycle/navigation/DOM/interaction/scraping)
259
+ | Count | Examples |
260
+ |-------|----------|
261
+ | Lifecycle: 2 | browser_launch, browser_close |
262
+ | Navigation: 4 | navigate, go_back, go_forward, reload |
263
+ | DOM/Content: 6 | browser_snapshot, screenshot, get_text, get_html, get_url, save_pdf |
264
+ | Interaction: 9 | click, click_text, click_role, hover, fill, select_option, check, uncheck, upload_file |
265
+ | Keyboard: 2 | type_text, press_key |
266
+ | Mouse: 3 | mouse_click_xy, mouse_move, drag_and_drop |
267
+ | Wait: 4 | wait_for, wait_for_navigation, wait_for_url, wait_for_response |
268
+ | Tabs: 4 | tab_list, tab_new, tab_select, tab_close |
269
+ | Cookies/Storage: 8 | cookie_list/set/delete, localstorage_get/set/clear, sessionstorage_get/set |
270
+ | JavaScript: 2 | evaluate, inject_init_script |
271
+ | Inspection: 4 | inspect_element, get_attribute, query_selector_all, get_links |
272
+ | Frames: 2 | list_frames, frame_evaluate |
273
+ | Batch: 3 | batch_actions, fill_form, navigate_and_snapshot |
274
+ | Viewport/Scroll/Dialog/A11y: 5 | get/set_viewport_size, scroll, dialog_handle, accessibility_snapshot |
275
+ | Console/Network: 4 | console_start/get, network_start/get |
276
+ | Debug: 3 | server_status, get_page_errors, export_har |
277
+ | Scraping: 4 | detect_content_pattern, extract_structured, extract_table, scrape_page |
278
+
279
+ ## Example Workflows
280
+
281
+ ### One-liner Cloudflare Turnstile bypass
282
+
283
+ ```
284
+ browser_launch(url="https://site-with-turnstile.com")
285
+ mouse_drift(duration_seconds=2) # natural behavior
286
+ click_turnstile() # ✅ proven bypass
287
+ # Login button now enabled, fill form, submit
288
+ ```
289
+
290
+ ### Bypass Turnstile via saved session (most reliable)
291
+
292
+ ```
293
+ # Once — manual:
294
+ browser_launch(url="https://target.com/login", headless=false)
295
+ # [user logs in manually in browser window]
296
+ storage_state_save(filename="target-session.json")
297
+ browser_close()
298
+
299
+ # Every time after — automated:
300
+ browser_launch(
301
+ url="https://target.com/dashboard",
302
+ headless=true, # can go headless
303
+ storage_state_path="~/.mcp-stealth/storage-states/target-session.json"
304
+ )
305
+ # Turnstile never triggers — session is valid
306
+ ```
307
+
308
+ ### Solve reCAPTCHA v2 image challenge via Claude
309
+
310
+ ```
311
+ browser_launch(url="https://site-with-recaptcha.com")
312
+ click_element_offset(ref="recaptcha-checkbox-ref", x_percent=8)
313
+ # Image challenge appears
314
+ solve_recaptcha_ai(max_rounds=3) # uses ANTHROPIC_API_KEY
315
+ # Token injected, form ready to submit
316
+ ```
317
+
318
+ ### Multi-account scraping in parallel
319
+
320
+ ```
321
+ browser_launch(url="https://site.com", headless=true) # main instance
322
+ spawn_browser("account_2", url="https://site.com", headless=true)
323
+ spawn_browser("account_3", url="https://site.com", headless=true)
324
+
325
+ list_instances() # see all 3 running
326
+ switch_instance("account_2")
327
+ # All subsequent tool calls target account_2
328
+ click(ref="login-btn")
329
+ ...
330
+ switch_instance("main") # back to main
331
+ ```
332
+
333
+ ### Browser login + fast API scraping
334
+
335
+ ```
336
+ # Login with browser (renders JS, solves challenges)
337
+ browser_launch(url="https://api-site.com/login")
338
+ click_turnstile()
339
+ fill(ref="email-ref", value="you@example.com")
340
+ fill(ref="password-ref", value="...")
341
+ click(ref="submit-ref")
342
+
343
+ # Scrape API 10x faster with TLS-perfect HTTP
344
+ http_request(
345
+ url="https://api-site.com/v1/data",
346
+ impersonate="chrome",
347
+ use_browser_cookies=true # reuse login session
348
+ )
349
+ ```
350
+
351
+ ### Auto-detect anti-bot + recommended strategy
352
+
353
+ ```
354
+ browser_launch(url="https://unknown-site.com")
355
+ detect_anti_bot()
356
+ # Returns: {"detected": ["Cloudflare", "reCAPTCHA"],
357
+ # "recommended_tools": [...]}
358
+ ```
359
+
360
+ ## Architecture
361
+
362
+ ```
363
+ uvx mcp-stealth-chrome → Python 3.11 → FastMCP → nodriver → Chrome/Chromium
364
+ ↓
365
+ curl_cffi (TLS)
366
+ ```
367
+
368
+ Data locations:
369
+ - Profile (main): `~/.mcp-stealth/profile/`
370
+ - Profiles (multi-instance): `~/.mcp-stealth/profiles/<instance_id>/`
371
+ - Screenshots: `~/.mcp-stealth/screenshots/`
372
+ - Exports (PDF, HAR): `~/.mcp-stealth/exports/`
373
+ - Storage states: `~/.mcp-stealth/storage-states/`
374
+
375
+ ## Environment Variables
376
+
377
+ | Variable | Default | Purpose |
378
+ |----------|---------|---------|
379
+ | `BROWSER_IDLE_TIMEOUT` | `600` | Auto-close browsers after idle seconds (0 = never) |
380
+ | `BROWSER_IDLE_REAPER_INTERVAL` | `60` | How often reaper checks idle state |
381
+ | `CAPSOLVER_KEY` | — | Enable `solve_captcha` tool |
382
+ | `ANTHROPIC_API_KEY` | — | `solve_recaptcha_ai` via Claude |
383
+ | `AI_VISION_BASE_URL` | — | `solve_recaptcha_ai` via OpenAI-compat API |
384
+ | `AI_VISION_API_KEY` | — | API key for OpenAI-compat provider |
385
+ | `AI_VISION_MODEL` | `claude-opus-4-7` or `gpt-4o` | Vision model name |
386
+ | `AI_VISION_PROVIDER` | auto-detect | Force `anthropic` or `openai` |
387
+ | `OPENAI_API_KEY` | — | Shortcut for OpenAI (default base URL) |
388
+
389
+ ## Stealth Details
390
+
391
+ Underlying tech stack:
392
+ - **nodriver** — Python CDP client with no WebDriver/Runtime.Enable leaks
393
+ - **curl_cffi** — libcurl with CFFI, matches Chrome/Firefox/Safari TLS handshake exactly (JA3/JA4 authenticity)
394
+ - **OpenCV** — template matching for visual CAPTCHA checkbox detection
395
+
396
+ Bypass layer vs detection:
397
+
398
+ | Detection | Bypass |
399
+ |-----------|--------|
400
+ | `navigator.webdriver` | nodriver doesn't set it |
401
+ | `Runtime.Enable` CDP leak | nodriver avoids it |
402
+ | Automation flags | No `--enable-automation` |
403
+ | Headless fingerprint | `headless=false` recommended for hard targets |
404
+ | TLS/JA3/JA4 | `http_request(impersonate='chrome')` |
405
+ | Turnstile checkbox | `click_turnstile()` |
406
+ | reCAPTCHA v2 image | `solve_recaptcha_ai()` or `solve_captcha()` |
407
+ | Behavioral ML | `mouse_drift`, `mouse_record/replay`, `humanize_click/type` |
408
+
409
+ **Honest limits** — these are HARDEST OSS bypass targets and require commercial services for production:
410
+ - DataDome (real-time behavioral ML across 50+ signals)
411
+ - Kasada (proprietary JS, rotates daily)
412
+ - PerimeterX/HUMAN (ML-based request scoring)
413
+ - ChatGPT managed Turnstile (checks React internal state)
414
+
415
+ For these, `storage_state_save/load` (manual-login-once, reuse) is the most reliable OSS approach.
416
+
417
+ ## Sister Package
418
+
419
+ [mcp-camoufox](https://github.com/RobithYusuf/mcp-camoufox) — Firefox stealth with same API. Use when you need:
420
+ - Hardest anti-bot bypass (Camoufox C++ level patches = stealth score 6% CreepJS)
421
+ - Firefox-specific rendering
422
+ - Node.js ecosystem
423
+
424
+ Both packages share tool names, snapshot format, ref system — switch seamlessly.
425
+
426
+ ## Development
427
+
428
+ ```bash
429
+ git clone https://github.com/RobithYusuf/mcp-stealth-chrome
430
+ cd mcp-stealth-chrome
431
+ uv sync
432
+ uv run mcp-stealth-chrome # run stdio server locally
433
+ ```
434
+
435
+ Testing:
436
+ ```bash
437
+ uv run python /tmp/smoke-test.py # full smoke test (see /tmp/ examples)
438
+ ```
439
+
440
+ ## Credits
441
+
442
+ - [nodriver](https://github.com/ultrafunkamsterdam/nodriver) by ultrafunkamsterdam — undetected Chrome via CDP
443
+ - [curl_cffi](https://github.com/lexiforest/curl_cffi) by lexiforest — TLS browser impersonation
444
+ - [FastMCP](https://github.com/modelcontextprotocol/python-sdk) — Python MCP SDK
445
+ - [Camoufox](https://github.com/daijro/camoufox) by daijro — sister Firefox stealth (via [mcp-camoufox](https://github.com/RobithYusuf/mcp-camoufox))
446
+ - [CapSolver](https://capsolver.com) — CAPTCHA solving API
447
+ - [vibheksoni/stealth-browser-mcp](https://github.com/vibheksoni/stealth-browser-mcp) — complementary MCP for UI cloning & network hooks
448
+
449
+ ## License
450
+
451
+ MIT — see [LICENSE](LICENSE).