Skip to content
Back to search

servo-fetch

A self-contained browser engine that fetches, renders, and extracts web content as Markdown, JSON, or screenshots — no Chromium, no API key, no setup.

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today

Check it deeper on your machine

It has changed since its scan on 11 Nov 2026.

As a Claude Code plugin, install it and then ask Claude Code:

/plugin marketplace add keithmackay/mackayi/plugin install scanskillsafety@mackayiDo a deep scan of https://github.com/konippi/servo-fetch with scanskillsafety

Or from a terminal, clone it and run it:

git clone https://github.com/keithmackay/scanskillsafety-skill ~/.claude/skills/scanskillsafetynode ~/.claude/skills/scanskillsafety/cli.cjs --deep 'https://github.com/konippi/servo-fetch'

It checks the exact commit: every file, its packages against OSV (api.osv.dev), how it compares with this page's scan (findsafeskills.com receives the repository's address), and, if you agree, Claude reading every file with your own Claude subscription. It never runs the code.

Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/konippi--servo-fetch/badge.svg)](/listings/konippi--servo-fetch)

HTML

<a href="/listings/konippi--servo-fetch"><img src="/api/listings/konippi--servo-fetch/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

These steps run a script from the network that findsafeskills does not scan.

| Interface | Install | Docs | | --------- | ------- | ---- | | **CLI** | `curl -fsSL https://raw.githubusercontent.com/konippi/servo-fetch/main/install.sh \| sh` | [CLI docs](crates/servo-fetch-cli/README.md) | | **Rust** | `cargo add servo-fetch` | [Library docs](crates/servo-fetch/README.md) | | **Python** | `pip install servo-fetch` | [Python docs](bindings/python/README.md) | | **Node.js** | `npm install servo-fetch` | [Node docs](bindings/node/README.md) |

<details> <summary><b>CLI install alternatives</b></summary>

cargo binstall servo-fetch-cli   # prebuilt binary
cargo install servo-fetch-cli    # build from source

Or download from [GitHub Releases](https://github.com/konippi/servo-fetch/releases).

**Linux** — install runtime deps and use `xvfb-run` on headless servers:

sudo apt install -y libegl1 libfontconfig1 libfreetype6
xvfb-run --auto-servernum servo-fetch "https://example.com"

**Windows** — `cargo binstall` does not copy sidecar files ([cargo-binstall#353](https://github.com/cargo-bins/cargo-binstall/issues/353)), so the installed `servo-fetch.exe` fails at startup with a missing `libEGL.dll`. Download the `.zip` from [Releases](https://github.com/konippi/servo-fetch/releases) instead — it bundles `libEGL.dll` and `libGLESv2.dll`.

**macOS** — no extra setup needed.

</details>

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 305 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

This file has changed since it was scanned, so this is not exactly the text that was scanned, and no line is marked. The findings are listed with the safety scan above.

  1. <div align="center">
  2. <h1 align="center">servo-fetch</h1>
  3. <p align="center">A self-contained browser engine that fetches, renders, and extracts web content as Markdown, JSON, or screenshots — no Chromium, no API key, no setup.</p>
  4. <p>
  5. <a href="https://github.com/konippi/servo-fetch/actions"><img src="https://github.com/konippi/servo-fetch/workflows/CI/badge.svg" alt="CI"></a>
  6. <a href="https://crates.io/crates/servo-fetch"><img src="https://img.shields.io/crates/v/servo-fetch.svg" alt="crates.io"></a>
  7. <img src="https://img.shields.io/badge/Rust-1.88.0-blue?color=fc8d62&logo=rust" alt="MSRV">
  8. <img src="https://img.shields.io/badge/license-MIT%2FApache--2.0-blue.svg" alt="MIT OR Apache-2.0">
  9. </p>
  10. <img src="assets/demo.gif" alt="servo-fetch demo" width="900">
  11. </div>
  12. servo-fetch embeds the [Servo](https://servo.org/) browser engine. It executes JavaScript, computes CSS layout,
  13. captures screenshots with a software renderer, and extracts clean content — available as a CLI, a Rust library,
  14. a Python SDK, and a Node.js SDK.
  15. ```bash
  16. # CLI
  17. servo-fetch "https://example.com" # clean Markdown
  18. servo-fetch "https://example.com" --format png -o page.png # PNG screenshot
  19. ```
  20. ```rust
  21. // Rust
  22. let md = servo_fetch::markdown("https://example.com").await?;
  23. ```
  24. ```python
  25. # Python
  26. page = servo_fetch.fetch("https://example.com")
  27. print(page.markdown)
  28. ```
  29. ```ts
  30. // Node.js
  31. import { fetch } from "servo-fetch";
  32. const md = await fetch("https://example.com");
  33. ```
  34. ## Why servo-fetch
  35. - **Zero dependencies** — single binary, no Chromium, no API key
  36. - **Real JS execution** — SpiderMonkey runs JavaScript, parallel CSS engine computes layout
  37. - **Layout- and visibility-aware extraction** — strips navbars, sidebars, footers by rendered position, plus cookie banners, modals, and CSS-hidden content (`opacity:0`, `aria-hidden`, sr-only)
  38. - **Schema-driven JSON** — declarative CSS-selector schema pulls structured data
  39. - **Parallel batch fetch** — multiple URLs fetched concurrently
  40. - **Isolated browser sessions** — one-use worker process per session keeps cookies and storage fully separated
  41. - **Site crawling** — BFS link traversal with robots.txt, same-site scope, and rate limiting
  42. - **URL discovery** — sitemap-based URL mapping without rendering (fast, lightweight)
  43. - **Screenshots without GPU** — software renderer captures PNG/full-page screenshots anywhere
  44. - **Accessibility tree** — AccessKit integration with roles, names, and bounding boxes
  45. - **Agent-ready** — drop-in web tool for AI agents: a built-in MCP server, or wrap the Python API as a tool in any agent framework
  46. ## Performance and quality
  47. Apple M3 Pro, versus Playwright (the typical AI-agent stack):
  48. | Benchmark | servo-fetch | playwright:optimized |
  49. | ------------------- | ----------: | -------------------: |
  50. | Time — static-small | ~231 ms | ~645 ms |
  51. | Time — spa-heavy | ~331 ms | ~798 ms |
  52. | Memory (peak RSS) | 51–64 MB | 300–328 MB |
  53. Extraction quality: mean word-F1 0.819 vs Readability's 0.728 across
  54. eight page-type fixtures, with `without[]` boilerplate removal at 95.0%
  55. vs 78.6%. Direct-binary engine peers (chrome-headless-shell, Lightpanda,
  56. curl) are opt-in.
  57. Methodology, three-axis breakdown, per-fixture F1, and raw JSON:
  58. [`benchmarks/README.md`](benchmarks/README.md) +
  59. [`benchmarks/results/`](benchmarks/results/).
  60. ## Install
  61. | Interface | Install | Docs |
  62. | --------- | ------- | ---- |
  63. | **CLI** | `curl -fsSL https://raw.githubusercontent.com/konippi/servo-fetch/main/install.sh \| sh` | [CLI docs](crates/servo-fetch-cli/README.md) |
  64. | **Rust** | `cargo add servo-fetch` | [Library docs](crates/servo-fetch/README.md) |
  65. | **Python** | `pip install servo-fetch` | [Python docs](bindings/python/README.md) |
  66. | **Node.js** | `npm install servo-fetch` | [Node docs](bindings/node/README.md) |
  67. <details>
  68. <summary><b>CLI install alternatives</b></summary>
  69. ```bash
  70. cargo binstall servo-fetch-cli # prebuilt binary
  71. cargo install servo-fetch-cli # build from source
  72. ```
  73. Or download from [GitHub Releases](https://github.com/konippi/servo-fetch/releases).
  74. **Linux** — install runtime deps and use `xvfb-run` on headless servers:
  75. ```bash
  76. sudo apt install -y libegl1 libfontconfig1 libfreetype6
  77. xvfb-run --auto-servernum servo-fetch "https://example.com"
  78. ```
  79. **Windows** — `cargo binstall` does not copy sidecar files ([cargo-binstall#353](https://github.com/cargo-bins/cargo-binstall/issues/353)), so the installed `servo-fetch.exe` fails at startup with a missing `libEGL.dll`. Download the `.zip` from [Releases](https://github.com/konippi/servo-fetch/releases) instead — it bundles `libEGL.dll` and `libGLESv2.dll`.
  80. **macOS** — no extra setup needed.
  81. </details>
  82. ## Quick Start
  83. ### CLI
  84. ```bash
  85. servo-fetch "https://example.com" # Markdown (default)
  86. servo-fetch "https://example.com" --format json # Structured JSON
  87. servo-fetch "https://example.com" --format png -o page.png # PNG screenshot
  88. servo-fetch "https://example.com" --js "document.title" # Run JavaScript
  89. servo-fetch "https://example.com" --schema schema.json # Schema-driven JSON
  90. servo-fetch "https://example.com" --cookies cookies.txt # Send session cookies
  91. servo-fetch "https://example.com" --cookie-jar cookies.txt # Save cookies (Netscape format)
  92. servo-fetch "https://example.com" -H "X-Api-Key: KEY" # Custom request header
  93. servo-fetch URL1 URL2 URL3 # Parallel batch
  94. servo-fetch "https://example.com" --output page.md # Save to a single file
  95. servo-fetch URL1 URL2 --output-dir ./out/ # Save each URL to its own file
  96. servo-fetch crawl "https://docs.example.com" --limit 20 # Crawl a site
  97. servo-fetch crawl URL --output-dir ./pages/ # Save each crawled page to its own file
  98. servo-fetch map "https://example.com" # Discover URLs via sitemap
  99. servo-fetch mcp # MCP server (stdio)
  100. servo-fetch serve # HTTP API server
  101. ```
  102. Full CLI reference → [`servo-fetch-cli`](crates/servo-fetch-cli/README.md)
  103. ### Exit status
  104. Batch fetch attempts every URL and exits non-zero for any fetch failure servo-fetch detects. Crawl exits non-zero for page failures only when every attempted page fails. Command-level failures remain fatal; a closed output pipe is treated as success. See the [CLI exit-code reference](crates/servo-fetch-cli/README.md#exit-codes) for exact codes.
  105. ### Rust
  106. ```bash
  107. cargo add servo-fetch
  108. ```
  109. ```rust
  110. // URL → Markdown in one line (async by default; use `blocking::*` for sync)
  111. let md = servo_fetch::markdown("https://example.com").await?;
  112. // Fetch with options
  113. use servo_fetch::{fetch, FetchOptions};
  114. use std::time::Duration;
  115. let page = fetch(&FetchOptions::new("https://example.com").timeout(Duration::from_secs(60))).await?;
  116. println!("{}", page.url); // Final URL after redirects or script navigation
  117. println!("{}", page.html);
  118. let md = page.markdown()?;
  119. // Crawl a site
  120. servo_fetch::crawl_each(
  121. &servo_fetch::CrawlOptions::new("https://docs.example.com")
  122. .limit(100)
  123. .user_agent("MyBot/1.0"),
  124. |result| match &result.outcome {
  125. Ok(page) => println!("{}: {} chars", result.url, page.content.len()),
  126. Err(e) => eprintln!("{}: {e}", result.url),
  127. },
  128. ).await?;
  129. // Discover URLs via sitemap (no rendering)
  130. let urls = servo_fetch::map(
  131. &servo_fetch::MapOptions::new("https://example.com").limit(1000),
  132. ).await?;
  133. for u in &urls {
  134. println!("{}", u.url);
  135. }
  136. ```
  137. Full API reference → [`servo-fetch`](crates/servo-fetch/README.md)
  138. ### Python
  139. Requires Python 3.11 or later.
  140. ```bash
  141. pip install servo-fetch
  142. ```
  143. ```python
  144. import servo_fetch
  145. page = servo_fetch.fetch("https://example.com")
  146. print(page.markdown)
  147. # Schema extraction
  148. from servo_fetch import Schema, Field
  149. schema = Schema(
  150. base_selector=".product",
  151. fields=[
  152. Field(name="title", selector="h2", type="text"),
  153. Field(name="price", selector=".price", type="text"),
  154. ],
  155. )
  156. page = servo_fetch.fetch("https://shop.example.com", schema=schema)
  157. print(page.extracted)
  158. ```
  159. Full API reference → [`bindings/python`](bindings/python/README.md)
  160. ### Node.js
  161. ```bash
  162. npm install servo-fetch
  163. ```
  164. ```ts
  165. import { fetch, crawl } from "servo-fetch";
  166. const md = await fetch("https://example.com");
  167. for await (const page of crawl("https://docs.example.com", { limit: 50 })) {
  168. if (page.ok) console.log(page.url, page.title);
  169. }
  170. ```
  171. Or run the bundled CLI without installing:
  172. ```bash
  173. npx servo-fetch "https://example.com"
  174. ```
  175. Full API reference → [`bindings/node`](bindings/node/README.md)
  176. ## MCP Server
  177. Built-in [Model Context Protocol](https://modelcontextprotocol.io/) server with six tools: `fetch`,
  178. `batch_fetch`, `crawl`, `map`, `screenshot`, and `execute_js`.
  179. ```json
  180. {
  181. "mcpServers": {
  182. "servo-fetch": {
  183. "command": "servo-fetch",
  184. "args": ["mcp"]
  185. }
  186. }
  187. }
  188. ```
  189. Streamable HTTP: `servo-fetch mcp --port 8080`
  190. Full MCP tool reference → [`servo-fetch-cli` README](crates/servo-fetch-cli/README.md)
  191. Prefer in-process tools? Wrap the Python API as agent tools — see [`bindings/python/examples/strands_agent.py`](bindings/python/examples/strands_agent.py).
  192. ## HTTP API
  193. REST endpoints for containerized deployments and HTTP clients:
  194. ```bash
  195. servo-fetch serve # 127.0.0.1:3000
  196. servo-fetch serve --host 0.0.0.0 --port 80 # expose to network
  197. curl -X POST http://127.0.0.1:3000/v1/fetch \
  198. -H 'content-type: application/json' \
  199. -d '{"url":"https://example.com"}'
  200. ```
  201. Endpoints: `GET /health`, `GET /version`, `POST /v1/fetch`, `POST /v1/batch_fetch`, `POST /v1/screenshot`, `POST /v1/execute_js`, `POST /v1/crawl`, `POST /v1/map`.
  202. Full HTTP API reference → [`servo-fetch-cli` README](crates/servo-fetch-cli/README.md#http-api-server)
  203. ## Docker
  204. Multi-arch image on GitHub Container Registry (`linux/amd64`, `linux/arm64`):
  205. ```bash
  206. docker run --rm -p 3000:3000 ghcr.io/konippi/servo-fetch:latest
  207. curl -X POST http://127.0.0.1:3000/v1/fetch \
  208. -H 'content-type: application/json' \
  209. -d '{"url":"https://example.com"}'
  210. ```
  211. Runs as non-root (UID 1001). Images are signed with [cosign](https://github.com/sigstore/cosign) (keyless) and published with SLSA provenance and SBOM attestations.
  212. ## Agent Skills
  213. servo-fetch ships with an [Agent Skills](https://agentskills.io/) package for AI coding agents:
  214. ```bash
  215. npx skills add https://github.com/konippi/servo-fetch/tree/main/skills/servo-fetch
  216. ```
  217. ## Security
  218. servo-fetch blocks all private and reserved IP ranges ([RFC 6890](https://datatracker.ietf.org/doc/html/rfc6890))
  219. for pages and the resources they load, refuses local schemes such as `file:`, strips credentials from URLs, and
  220. sanitizes all output against terminal escape injection ([CVE-2021-42574](https://www.cve.org/CVERecord?id=CVE-2021-42574)).
  221. See [SECURITY.md](./SECURITY.md) for details.
  222. ## Limitations
  223. - Sites behind CAPTCHAs are not supported.
  224. ## Contributing
  225. See [CONTRIBUTING.md](./CONTRIBUTING.md) for development setup, commit conventions, and PR guidelines.
  226. ## License
  227. [MIT](./LICENSE-MIT) OR [Apache-2.0](./LICENSE-APACHE)

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.