foxfetch
Read a page the way a browser does — only when plain HTTP is not enough.
foxfetch drives a real Firefox engine (SpiderMonkey + Necko, no window, no renderer) to run a site's own JavaScript: pass a bot check, read a DOM that only exists after the scripts run, find the signature and the real API host. When a screenshot or a click is needed, it hands the identity it earned to Chromium.
It speaks the Model Context Protocol, so one service serves every agent host — Pi, Claude Code, Codex, DeepSeek Harness.
The rule that saves the most time
| Situation | Use |
|---|---|
| Static HTML, JSON endpoints, RSS | plain HTTP — do not call foxfetch |
| Content appears after JS runs | run |
| 403 / Cloudflare / DataDome / Kasada | probe, then run |
| Someone needs to see the page | handoff → the generated Playwright script |
probe answers the first two questions with evidence, so the choice is not a guess:
probe("https://shop.example/item")
→ verdict: blocked
evidence: HTTP 403, DataDome (matched 'datadome'), 512 bytes, 0 visible text
suggestion: use run — the engine's TLS and JS profile match a real Firefox
Most pages do not need the engine. Reaching for it anyway costs ~90 MB of RAM and ~3 s per
open, and buys nothing on a document curl could have fetched.
Tools
| Tool | What it does |
|---|---|
probe |
Classify a URL: plain_http / needs_engine / blocked, with the evidence |
run |
Evaluate JavaScript in the engine; returns the value, console and request log |
net |
Read the request log and console of a live context |
handoff |
Export cookies (including HttpOnly), localStorage, UA; write a Playwright script |
close |
Close one context (by id or origin) or all of them |
cleanup |
Delete every artifact except the ones in keep, close contexts, sweep temp scratch dirs |
status |
Live contexts, artifact usage, environment check |
Contexts
One engine world per origin, kept alive between calls so a multi-step flow is several small calls instead of one giant script:
run("window.step = 1", url="https://x.test") # opens the page
run("window.step + 1") # → 2, same document
run("fetch('/api/me').then(r => r.text())",
advance_ms=800, read="window.__last") # carries the cookies earned above
A context dies on close, after FOXFETCH_IDLE_SECONDS (default 60) of silence, or when the
pool exceeds FOXFETCH_MAX_CONTEXTS (default 2) — the least recently used goes first.
Install
pip install foxfetch
python -m foxfetch doctor # python, ruyijs, mcp, chromium, artifacts
Then wire it into a host — see SETUP.md for the per-host steps. The short version:
# Pi, Claude Code, Codex and other MCP clients
php -r '' 2>/dev/null; # (no shell hook needed) — add an mcpServers entry:
# "command": "python", "args": ["-m", "foxfetch", "serve"]
# DeepSeek Harness: install the plugin in dsh/, which forwards to the same service
Chromium is optional: without it handoff still exports the identity, it just cannot write
the screenshot script.
Configuration
| Variable | Default | Meaning |
|---|---|---|
FOXFETCH_HOME |
%LOCALAPPDATA%\foxfetch |
Artifact root (credentials pass through it) |
FOXFETCH_MAX_CONTEXTS |
2 | Live engine contexts before LRU eviction |
FOXFETCH_IDLE_SECONDS |
60 | Silence before a context is killed |
FOXFETCH_TIMEOUT_MS |
30000 | Default navigation budget |
FOXFETCH_MAX_BYTES |
65536 | Output cap before spilling to a file |
FOXFETCH_ARTIFACT_TTL |
86400 | Seconds before an artifact is deleted automatically |
FOXFETCH_REMIND_AFTER |
600 | Seconds before tool results start mentioning pending artifacts (0 disables) |
FOXFETCH_PY |
— | Interpreter the DSH plugin should use |
Safety
handoff writes live credentials — cookies including the HttpOnly ones page script cannot
read. They land under FOXFETCH_HOME, owner-only, and expire after FOXFETCH_ARTIFACT_TTL.
Call cleanup when the task is delivered, and pass keep=[...] for the screenshot or token
the user still needs to look at.
You do not have to remember on your own: every tool response carries the artifact state, and
once a file is older than FOXFETCH_REMIND_AFTER (default 600 s) the response grows a reminder
saying how many files are still on disk and that they may hold credentials. The field vanishes
the moment cleanup runs, so a stale reminder is a visible bug, not a silent one.
Development
pip install -e '.[dev]'
pytest -q
mypy src
The tests encode the bugs this rewrite exists to prevent: a clip that split UTF-8 sequences,
a URL compare that ignored the trailing slash, sameSite: "Default" rejected by Playwright,
and a runaway browser left behind when the screenshot threw.
Licence
MIT. The engine (ruyijs) is a separate project under AGPL-3.0; foxfetch only calls it.
Metadata
Release files for foxfetch 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| foxfetch-0.1.0.tar.gz | 36.6 kB | Without provenance | Details for foxfetch-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| foxfetch-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for foxfetch-0.1.0-py3-none-any.whl |
Total release size: 64.3 kB
Release files / foxfetch-0.1.0.tar.gz
| Download URL | foxfetch-0.1.0.tar.gz |
|---|---|
| Size | 36.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
febad161e3bb642968b3eb97415ef1daf64da0cd1822912518cade735155ffbd
|
|
BLAKE2b-256 checksum How to use checksums |
387f2113e0bd2c9623f9ac0924853e017b8cf090d4003264f36574bffdd7b284
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.6
|
Release files / foxfetch-0.1.0-py3-none-any.whl
| Download URL | foxfetch-0.1.0-py3-none-any.whl |
|---|---|
| Size | 27.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
043a20483acfc1428a0f14fdd4684398da2c736c6799e85b37984544ab50adaa
|
|
BLAKE2b-256 checksum How to use checksums |
6595df9ea77db3eac21e3659f0bfe486a731f7f8c989f13d75c65379e0e71e1a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.6
|
Security for foxfetch 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.