You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/ai/mcp-server.md
+12-1Lines changed: 12 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ The **Scrapling MCP Server** is a new feature that brings Scrapling's powerful W
6
6
7
7
## Features
8
8
9
-
The Scrapling MCP Server provides nine powerful tools for web scraping:
9
+
The Scrapling MCP Server provides ten powerful tools for web scraping:
10
10
11
11
### 🚀 Basic HTTP Scraping
12
12
-**`get`**: Fast HTTP requests with browser fingerprint impersonation, generating real browser headers matching the TLS version, HTTP/3, and more!
@@ -20,6 +20,9 @@ The Scrapling MCP Server provides nine powerful tools for web scraping:
20
20
-**`stealthy_fetch`**: Uses our Stealthy browser to bypass Cloudflare Turnstile/Interstitial and other anti-bot systems with complete control over the request/browser!
21
21
-**`bulk_stealthy_fetch`**: An async version of the above tool that allows stealth scraping of multiple URLs in different browser tabs at the same time!
22
22
23
+
### 📸 Screenshots
24
+
-**`screenshot`**: Capture a PNG or JPEG screenshot of a page using an open browser session, returned as an image content block the model can actually see (not a base64 string blob). Supports full-page captures, JPEG quality, and the usual readiness controls (`wait`, `wait_selector`, `network_idle`).
25
+
23
26
### 🔌 Session Management
24
27
-**`open_session`**: Create a persistent browser session (dynamic or stealthy) that stays open across multiple fetch calls, avoiding the overhead of launching a new browser each time.
25
28
-**`close_session`**: Close a persistent browser session and free its resources.
@@ -331,6 +334,14 @@ This protection runs automatically on all MCP tool responses. Keep `main_content
331
334
- Always close sessions with `close_session` when done to free resources
332
335
- Use `list_sessions` to check which sessions are still active
333
336
- A `session_id` from a dynamic session can only be used with `fetch`/`bulk_fetch`, and a stealthy session can only be used with `stealthy_fetch`/`bulk_stealthy_fetch`
337
+
- Pass a custom `session_id` to `open_session` to give sessions meaningful names (e.g. `"search"`, `"checkout"`) instead of the random hex default. `open_session` raises if the chosen ID is already in use, so you can detect collisions up front
338
+
339
+
### 7. Capturing Screenshots
340
+
- `screenshot` only works through an existing browser session, so call `open_session` first (either `dynamic` or `stealthy` works)
341
+
- The image is returned as a real `ImageContent` block, not a base64 string in JSON, so the model sees the page directly
342
+
- Use `full_page=True` when you need everything below the fold; the default captures only the visible viewport
343
+
- Pick `image_type="jpeg"` with a `quality` value (0-100) for smaller payloads when pixel-perfect color isn't needed
344
+
- The same `wait`, `wait_selector`, `network_idle`, and `timeout` controls used by `fetch` are available here too
0 commit comments