MCP server

WebSkrap ships a Model Context Protocol server. MCP clients such as Claude Desktop, Claude Code, and Codex can call it to drive a real browser directly. It runs over stdio and exposes three tools.

Built for LLMs. Both fetch and stealth_fetch run the same CDP-leak-free Patchright stealth path the CLI uses (headless Chrome, networkidle wait), so JS-heavy and anti-bot pages that block naive scrapers still load. They return clean visible page text by default — no HTML tags, scripts, or CSS noise — so the model spends tokens on content, not markup (typically 5-10x fewer tokens than raw HTML). Use stealth_fetch for finer fingerprint/WebRTC/UA control. Pass text_only=false when you actually need the HTML.

Install

pip install webskrap
webskrap install

Run the server:

webskrap-mcp

You can also run it as a module:

python -m webskrap.mcp_server

Tools

ToolPurpose
fetchFetch a URL with the Patchright stealth driver (waits for networkidle).
stealth_fetchSame stealth driver with finer fingerprint/WebRTC/UA controls.
doctorCheck that Playwright and Chromium can launch.

Both fetch tools return status, final_url, title, ok, headers, and the page content in text (capped by max_chars, with text_length and text_truncated reporting the full size). By default text is clean visible text; set text_only to false to get raw HTML.

Tool arguments

fetch accepts:

ArgumentDefaultNotes
urlrequiredURL to load.
profiledesktop-chromeBundled profile name.
channelchromeBrowser channel; use chromium on Linux ARM64.
wait_untilnetworkidlecommit, domcontentloaded, load, or networkidle.
resource_policyallall, lite, or documents.
timeout_ms60000Navigation timeout.
max_chars20000Maximum returned text characters.
text_onlytrueReturn clean visible text; set false for raw HTML.

Example arguments:

{
  "url": "https://example.com",
  "profile": "desktop-chrome",
  "resource_policy": "lite",
  "wait_until": "load",
  "max_chars": 5000
}

stealth_fetch accepts the same URL/profile/timeout/output-size controls plus Patchright options:

{
  "url": "https://example.com",
  "channel": "chrome",
  "headless": false,
  "patchright_context_profile": false,
  "reduce_fingerprint_surface": false,
  "mask_headless_user_agent": false,
  "webrtc_ip_handling_policy": null
}

Register with a client

Claude Code

claude mcp add webskrap -- webskrap-mcp

Claude Desktop

{
  "mcpServers": {
    "webskrap": {
      "command": "webskrap-mcp"
    }
  }
}

Codex

Add a server entry to ~/.codex/config.toml:

[mcp_servers.webskrap]
command = "webskrap-mcp"
args = []

Stealth

stealth_fetch uses the Patchright driver and accepts the same controls as the Stealth guide, including channel, headless, user_data_dir, patchright_context_profile, reduce_fingerprint_surface, mask_headless_user_agent, and webrtc_ip_handling_policy.

For headless best-effort stealth from MCP, use real Chrome and opt in only to the native browser controls you need:

{
  "url": "https://example.com",
  "channel": "chrome",
  "headless": true,
  "user_data_dir": ".webskrap/headless-profile",
  "mask_headless_user_agent": true,
  "patchright_context_profile": true,
  "webrtc_ip_handling_policy": "disable_non_proxied_udp"
}

The MCP server does not solve CAPTCHA challenges, bypass login walls, bypass credential checks, or circumvent access controls.