foxfetch 0.1.0__tar.gz → 0.1.2__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,243 @@
1
+ # Install
2
+
3
+ > The same content lives in [README.md](README.md) (English) and [README.zh.md](README.zh.md)
4
+ > (简体中文), which is what most people want. This file is the longer reference: it keeps the
5
+ > doctor output, the interpreter-path note and the troubleshooting table in one place.
6
+
7
+ Two pieces, always two:
8
+
9
+ | Piece | What it is | Where it comes from |
10
+ |---|---|---|
11
+ | **the service** | all the logic — 7 tools over MCP | `pip install foxfetch` |
12
+ | **a host entry** | how your agent finds the service | one config file per agent host |
13
+
14
+ The service is the same for every host. Only the wiring differs.
15
+
16
+ > **One entry per host.** Never register both the DSH plugin and an MCP entry in the same
17
+ > host: you would expose the same seven tools twice (`foxfetch_run` and
18
+ > `mcp__foxfetch__run`) and the model would have to guess.
19
+
20
+ ---
21
+
22
+ ## Step 1 — install the service (once per machine)
23
+
24
+ **Windows (PowerShell):**
25
+
26
+ ```powershell
27
+ python -m pip install --upgrade foxfetch
28
+ python -m foxfetch doctor
29
+ ```
30
+
31
+ **macOS / Linux:**
32
+
33
+ ```bash
34
+ python3 -m pip install --upgrade foxfetch
35
+ python3 -m foxfetch doctor
36
+ ```
37
+
38
+ `doctor` prints a JSON report and exits non-zero when something required is missing. Success
39
+ looks like this (abridged — the real report also lists Chromium builds, Playwright, the artifact
40
+ directory and the active settings):
41
+
42
+ ```
43
+ {
44
+ "ok": true,
45
+ "python": { "version": "3.14.6", "ok": true },
46
+ "ruyijs": { "version": "0.4.5", "ok": true, "min": "0.4.5" },
47
+ "mcp": { "version": "1.30.0", "ok": true, "constraint": ">=1.30,<2" },
48
+ "chromium": { "found": true, "path": "…/chrome-headless-shell.exe" },
49
+ "warnings": [],
50
+ "fixes": []
51
+ }
52
+ ```
53
+
54
+ If `ok` is `false`, run the commands in `fixes` and re-run `doctor`. Three matter:
55
+
56
+ | Report says | Run this |
57
+ |---|---|
58
+ | `ruyijs` missing or < 0.4.5 | `python -m pip install -U "ruyijs>=0.4.5"` |
59
+ | `mcp` version is 2.x | `python -m pip install "mcp>=1.30,<2"` — 2.x renamed `FastMCP` and this server cannot import it |
60
+ | `chromium: found: false` | optional — `npx playwright install chromium`, only needed for screenshots |
61
+
62
+ **Note the interpreter path.** Every host entry below needs to start the *same* Python that
63
+ `pip install` used. Find it once:
64
+
65
+ ```powershell
66
+ (Get-Command python).Source
67
+ # C:\Users\you\AppData\Local\Programs\Python\Python314\python.exe
68
+ ```
69
+
70
+ ```bash
71
+ which python3
72
+ ```
73
+
74
+ If you have several Pythons, use that absolute path in the config instead of plain `python`.
75
+
76
+ ---
77
+
78
+ ## Step 2 — wire one host
79
+
80
+ Pick the row that matches the agent you actually use.
81
+
82
+ ### Pi
83
+
84
+ Config file: `~/.pi/agent/mcp.json` (create it if absent):
85
+
86
+ ```json
87
+ {
88
+ "mcpServers": {
89
+ "foxfetch": {
90
+ "command": "python",
91
+ "args": ["-m", "foxfetch", "serve"],
92
+ "description": "Firefox-engine page fetching: pass bot checks, run the page's own JS, hand identity to Chromium.",
93
+ "timeout": 180
94
+ }
95
+ }
96
+ }
97
+ ```
98
+
99
+ Or from the shell, which writes the same file:
100
+
101
+ ```bash
102
+ pi mcp add foxfetch -- python -m foxfetch serve
103
+ ```
104
+
105
+ Verify:
106
+
107
+ ```bash
108
+ pi mcp list
109
+ # foxfetch: connected, 7 tools
110
+ ```
111
+
112
+ ### Claude Code
113
+
114
+ ```bash
115
+ claude mcp add foxfetch -- python -m foxfetch serve
116
+ claude mcp list
117
+ ```
118
+
119
+ ### Codex
120
+
121
+ Append to `~/.codex/config.toml`:
122
+
123
+ ```toml
124
+ [mcp_servers.foxfetch]
125
+ command = "python"
126
+ args = ["-m", "foxfetch", "serve"]
127
+ ```
128
+
129
+ Restart Codex, then ask it for its tool list.
130
+
131
+ ### DeepSeek Harness (DSH)
132
+
133
+ DSH has a native plugin API, and the plugin is published on npm. It holds **no logic** — it
134
+ starts the service once and reshapes results for the DSH UI.
135
+
136
+ ```powershell
137
+ $profile = "$env:USERPROFILE\.dsh\profiles\desktop"
138
+
139
+ # 1. install the plugin into the profile
140
+ Push-Location $profile
141
+ pnpm add dsh-foxfetch
142
+ Pop-Location
143
+
144
+ # 2. register the bundle (keep the entries already there)
145
+ $pkg = Get-Content "$profile\package.json" -Raw | ConvertFrom-Json
146
+ if ($pkg.dsh.profile.bundles -notcontains "dsh-foxfetch") {
147
+ $pkg.dsh.profile.bundles += "dsh-foxfetch"
148
+ }
149
+ $pkg | ConvertTo-Json -Depth 20 | Set-Content "$profile\package.json"
150
+
151
+ # 3. restart DSH
152
+ ```
153
+
154
+ `~/.dsh/profiles/desktop/package.json` should end up looking like this:
155
+
156
+ ```json
157
+ {
158
+ "name": "dsh-profile-desktop",
159
+ "private": true,
160
+ "dependencies": {
161
+ "dsh-foxfetch": "^0.1.1"
162
+ },
163
+ "dsh": {
164
+ "profile": {
165
+ "bundles": [
166
+ "@deepseek-ai/dsh-base",
167
+ "@deepseek-ai/dsh-web-app",
168
+ "dsh-foxfetch"
169
+ ]
170
+ }
171
+ }
172
+ }
173
+ ```
174
+
175
+ **`pnpm` is not on PATH?** DSH ships its own:
176
+
177
+ ```powershell
178
+ $dsh = "$env:USERPROFILE\.dsh\dsh-runtimes\dsh-primary-runtime\dependencies"
179
+ $node = Join-Path $dsh "node\bin\node.exe"
180
+ $pnpm = Join-Path $dsh "pnpm\bin\pnpm.cjs"
181
+ & $node $pnpm add dsh-foxfetch
182
+ ```
183
+
184
+ **Editing the plugin itself?** Link a checkout instead of the published package — replace the
185
+ dependency with `"dsh-foxfetch": "link:C:/Users/<you>/.dsh/plugins/dsh-foxfetch"` after
186
+ `git clone https://github.com/zhuchongba-01/foxfetch` anywhere you like.
187
+
188
+ ### Anything else (opencode, gemini, zcode, custom)
189
+
190
+ Most clients take a stdio server entry. The two values they all need:
191
+
192
+ ```
193
+ command: python (or the absolute path from step 1)
194
+ args: ["-m", "foxfetch", "serve"]
195
+ ```
196
+
197
+ ---
198
+
199
+ ## Step 3 — prove it works
200
+
201
+ Ask the host (not a shell) to run these two calls:
202
+
203
+ ```
204
+ foxfetch_status
205
+ → ok: true, ruyijs 0.4.5, chromium: yes
206
+ ```
207
+
208
+ ```
209
+ foxfetch_run(js="navigator.userAgent", url="https://example.com")
210
+ → "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:160.0) Gecko/20100101 Firefox/160.0"
211
+ ```
212
+
213
+ A user agent that says `Python-urllib` or `HeadlessChrome` means the call never reached the
214
+ engine — fix that before trusting any other result.
215
+
216
+ Finally, close what you opened:
217
+
218
+ ```
219
+ foxfetch_cleanup(scope="all")
220
+ ```
221
+
222
+ ---
223
+
224
+ ## Troubleshooting
225
+
226
+ | Symptom | Cause | Fix |
227
+ |---|---|---|
228
+ | `cannot start the Python service` (DSH plugin) | the plugin found a different interpreter | set `FOXFETCH_PY` to the absolute path from step 1 |
229
+ | `ModuleNotFoundError: mcp.server.fastmcp` | `mcp` 2.x installed | `pip install "mcp>=1.30,<2"` |
230
+ | `no live context for that origin` | the context idled out (60 s) or was evicted | pass `url` again, or hold `context_id` from the previous call |
231
+ | `navigation produced an empty document` | slow page, or one that needs a real renderer | raise `timeout_ms`, or use `handoff` + Chromium |
232
+ | tools appear twice | two entries in one host | remove one — see the note at the top |
233
+ | `doctor` says chromium missing | Playwright browsers not installed | `npx playwright install chromium` (optional) |
234
+
235
+ ## Uninstall
236
+
237
+ ```bash
238
+ pip uninstall foxfetch
239
+ rm -rf "$HOME/.local/share/foxfetch" # artifacts; %LOCALAPPDATA%\foxfetch on Windows
240
+ ```
241
+
242
+ Then remove the host entry (the `mcpServers` block, the `[mcp_servers.foxfetch]` table, or the
243
+ `dsh-foxfetch` dependency + bundle line).
@@ -0,0 +1,367 @@
1
+ Metadata-Version: 2.5
2
+ Name: foxfetch
3
+ Version: 0.1.2
4
+ Summary: Fetch pages through a real Firefox engine (ruyijs) for AI agents: pass bot checks, run the page's own JavaScript, then hand the identity to Chromium when a screenshot is needed.
5
+ Project-URL: Homepage, https://github.com/zhuchongba-01/foxfetch
6
+ Project-URL: Repository, https://github.com/zhuchongba-01/foxfetch
7
+ Project-URL: Issues, https://github.com/zhuchongba-01/foxfetch/issues
8
+ Project-URL: Changelog, https://github.com/zhuchongba-01/foxfetch/commits/master
9
+ License: MIT License
10
+
11
+ Copyright (c) 2026 foxfetch contributors
12
+
13
+ Permission is hereby granted, free of charge, to any person obtaining a copy
14
+ of this software and associated documentation files (the "Software"), to deal
15
+ in the Software without restriction, including without limitation the rights
16
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
17
+ copies of the Software, and to permit persons to whom the Software is
18
+ furnished to do so, subject to the following conditions:
19
+
20
+ The above copyright notice and this permission notice shall be included in all
21
+ copies or substantial portions of the Software.
22
+
23
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
24
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
26
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
28
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
29
+ SOFTWARE.
30
+
31
+ Note: `ruyijs`, the Firefox engine this package drives, is a separate project
32
+ under AGPL-3.0. foxfetch only imports and calls it; no ruyijs code is bundled.
33
+ License-File: LICENSE
34
+ Keywords: agent,anti-bot,firefox,mcp,playwright,ruyijs,scraping
35
+ Classifier: Environment :: Console
36
+ Classifier: Intended Audience :: Developers
37
+ Classifier: License :: OSI Approved :: MIT License
38
+ Classifier: Operating System :: Microsoft :: Windows
39
+ Classifier: Operating System :: POSIX :: Linux
40
+ Classifier: Programming Language :: Python :: 3
41
+ Classifier: Topic :: Internet :: WWW/HTTP :: Browsers
42
+ Requires-Python: >=3.10
43
+ Requires-Dist: mcp<2,>=1.30
44
+ Requires-Dist: ruyijs>=0.4.5
45
+ Provides-Extra: dev
46
+ Requires-Dist: mypy>=1.10; extra == 'dev'
47
+ Requires-Dist: pytest>=8; extra == 'dev'
48
+ Description-Content-Type: text/markdown
49
+
50
+ # foxfetch
51
+
52
+ **Read pages that block plain HTTP — by running them in a real Firefox engine.**
53
+
54
+ [English](README.md) · [简体中文](README.zh.md)
55
+
56
+ [![PyPI](https://img.shields.io/pypi/v/foxfetch?logo=pypi&label=PyPI)](https://pypi.org/project/foxfetch/)
57
+ [![Python](https://img.shields.io/pypi/pyversions/foxfetch?logo=python&logoColor=white)](https://pypi.org/project/foxfetch/)
58
+ [![npm plugin](https://img.shields.io/npm/v/dsh-foxfetch?logo=npm&label=dsh-foxfetch)](https://www.npmjs.com/package/dsh-foxfetch)
59
+ [![License](https://img.shields.io/pypi/l/foxfetch)](LICENSE)
60
+
61
+ `curl` gets a 403. Headless Chrome gets fingerprinted. foxfetch uses a real Firefox engine
62
+ (SpiderMonkey + Necko, no window, no renderer) to run the site's own JavaScript, pass the bot
63
+ check, and read what only a browser can see. When a screenshot is needed, it hands the identity
64
+ it earned to Chromium.
65
+
66
+ ---
67
+
68
+ ## Install in 30 seconds
69
+
70
+ **1. Install the service** (once per machine):
71
+
72
+ ```bash
73
+ pip install foxfetch
74
+ ```
75
+
76
+ **2. Check it** — should print `"ok": true`:
77
+
78
+ ```bash
79
+ python -m foxfetch doctor
80
+ ```
81
+
82
+ **3. Connect your agent** — pick one line, copy it:
83
+
84
+ | Your agent | Run this |
85
+ |---|---|
86
+ | **Pi** | `pi mcp add foxfetch -- python -m foxfetch serve` |
87
+ | **Claude Code** | `claude mcp add foxfetch -- python -m foxfetch serve` |
88
+ | **Codex** | see [`[mcp_servers.foxfetch]` below](#codex) |
89
+ | **DeepSeek Harness** | see [DSH below](#deepseek-harness) |
90
+ | **Other MCP client** | `command: python`, `args: ["-m", "foxfetch", "serve"]` |
91
+
92
+ **4. Prove it works** — ask your agent:
93
+
94
+ ```
95
+ foxfetch_run(js="navigator.userAgent", url="https://example.com")
96
+ ```
97
+
98
+ You must see `Firefox/160.0` in the answer. If you see `Python-urllib` or `HeadlessChrome`, the
99
+ agent is not talking to the engine — nothing else will work until you fix it.
100
+
101
+ > **One entry per host.** Never add both an MCP entry and the DSH plugin to the same agent:
102
+ > you would get the same seven tools twice (`foxfetch_run` and `mcp__foxfetch__run`).
103
+
104
+ ---
105
+
106
+ ## Detailed install
107
+
108
+ ### Requirements
109
+
110
+ - **Python 3.10+** — that is all. Chromium is optional (screenshots only).
111
+ - The `ruyijs` engine (44 MB wheel) comes in automatically as a dependency.
112
+
113
+ If `doctor` reports a problem, run the command it prints. The three that happen:
114
+
115
+ | `doctor` says | Fix |
116
+ |---|---|
117
+ | `ruyijs` missing or `< 0.4.5` | `pip install -U "ruyijs>=0.4.5"` |
118
+ | `mcp` is 2.x | `pip install "mcp>=1.30,<2"` — 2.x renamed `FastMCP`; this server cannot import it |
119
+ | `chromium: found: false` | optional: `npx playwright install chromium` |
120
+
121
+ **Which Python?** The agent must start the same interpreter that `pip install` used:
122
+
123
+ ```powershell
124
+ (Get-Command python).Source # Windows
125
+ which python3 # macOS / Linux
126
+ ```
127
+
128
+ ```bash
129
+ # If it is not plain `python`, put the absolute path in the config:
130
+ # "command": "C:/Users/you/AppData/Local/Programs/Python/Python314/python.exe"
131
+ ```
132
+
133
+ ### Pi
134
+
135
+ `pi mcp add foxfetch -- python -m foxfetch serve`
136
+
137
+ Or write `~/.pi/agent/mcp.json` yourself:
138
+
139
+ ```json
140
+ {
141
+ "mcpServers": {
142
+ "foxfetch": {
143
+ "command": "python",
144
+ "args": ["-m", "foxfetch", "serve"],
145
+ "timeout": 180
146
+ }
147
+ }
148
+ }
149
+ ```
150
+
151
+ Verify: `pi mcp list` → `foxfetch: connected, 7 tools`.
152
+ Inside a running Pi session, `/reload` picks it up.
153
+
154
+ ### Claude Code
155
+
156
+ `claude mcp add foxfetch -- python -m foxfetch serve`
157
+
158
+ Verify: `claude mcp list`.
159
+
160
+ ### Codex
161
+
162
+ Append to `~/.codex/config.toml`, then restart Codex:
163
+
164
+ ```toml
165
+ [mcp_servers.foxfetch]
166
+ command = "python"
167
+ args = ["-m", "foxfetch", "serve"]
168
+ ```
169
+
170
+ ### DeepSeek Harness
171
+
172
+ DSH has a native plugin API, so it gets a real plugin instead of an MCP entry. The plugin holds
173
+ no logic — it starts the same Python service and reshapes results for the DSH UI.
174
+
175
+ ```powershell
176
+ # 1. service (same as everyone else)
177
+ pip install foxfetch
178
+
179
+ # 2. plugin, into the DSH profile
180
+ cd "$env:USERPROFILE\.dsh\profiles\desktop"
181
+ pnpm add dsh-foxfetch
182
+
183
+ # 3. register it (keep the entries already in the file)
184
+ $pkg = Get-Content package.json -Raw | ConvertFrom-Json
185
+ if ($pkg.dsh.profile.bundles -notcontains "dsh-foxfetch") {
186
+ $pkg.dsh.profile.bundles += "dsh-foxfetch"
187
+ }
188
+ $pkg | ConvertTo-Json -Depth 20 | Set-Content package.json
189
+
190
+ # 4. restart DSH
191
+ ```
192
+
193
+ The result should look like this:
194
+
195
+ ```json
196
+ {
197
+ "name": "dsh-profile-desktop",
198
+ "private": true,
199
+ "dependencies": {
200
+ "dsh-foxfetch": "^0.1.1"
201
+ },
202
+ "dsh": {
203
+ "profile": {
204
+ "bundles": [
205
+ "@deepseek-ai/dsh-base",
206
+ "@deepseek-ai/dsh-web-app",
207
+ "dsh-foxfetch"
208
+ ]
209
+ }
210
+ }
211
+ }
212
+ ```
213
+
214
+ `pnpm` not on PATH? DSH ships its own:
215
+
216
+ ```powershell
217
+ $dsh = "$env:USERPROFILE\.dsh\dsh-runtimes\dsh-primary-runtime\dependencies"
218
+ $node = Join-Path $dsh "node\bin\node.exe"
219
+ $pnpm = Join-Path $dsh "pnpm\bin\pnpm.cjs"
220
+ & $node $pnpm add dsh-foxfetch
221
+ ```
222
+
223
+ After restarting DSH the tool list shows `foxfetch_probe`, `foxfetch_run`, `foxfetch_net`,
224
+ `foxfetch_handoff`, `foxfetch_close`, `foxfetch_cleanup`, `foxfetch_status` — and no
225
+ `mcp__foxfetch__*` entries.
226
+
227
+ ### Any other MCP client
228
+
229
+ Most clients take the same stdio block:
230
+
231
+ ```json
232
+ {
233
+ "mcpServers": {
234
+ "foxfetch": {
235
+ "command": "python",
236
+ "args": ["-m", "foxfetch", "serve"]
237
+ }
238
+ }
239
+ }
240
+ ```
241
+
242
+ ---
243
+
244
+ ## What you get
245
+
246
+ Seven tools:
247
+
248
+ | Tool | What it does |
249
+ |---|---|
250
+ | `probe` | Classify a URL — `plain_http` / `needs_engine` / `blocked` — with the evidence |
251
+ | `run` | Evaluate JavaScript in the engine; returns the value, console and request log |
252
+ | `net` | Read the request log and console of a live context |
253
+ | `handoff` | Export cookies (incl. HttpOnly), localStorage, UA; write a Playwright script |
254
+ | `close` | Close one context (by id or origin) or all of them |
255
+ | `cleanup` | Delete artifacts, close contexts, sweep temp scratch dirs |
256
+ | `status` | Live contexts, artifact usage, environment check |
257
+
258
+ ### Use the cheapest layer
259
+
260
+ | Situation | Use |
261
+ |---|---|
262
+ | Static HTML, JSON endpoints, RSS | plain HTTP — **do not call foxfetch** |
263
+ | Content appears only after JS runs | `run` |
264
+ | 403 / Cloudflare / DataDome / Kasada | `probe`, then `run` |
265
+ | Someone needs to *see* the page | `handoff` → the generated Playwright script |
266
+
267
+ ```
268
+ probe("https://shop.example/item")
269
+ → verdict: blocked
270
+ evidence: HTTP 403, DataDome (matched 'datadome'), 512 bytes, 0 visible text
271
+ suggestion: use run — the engine's TLS and JS profile match a real Firefox
272
+ ```
273
+
274
+ The engine costs ~90 MB of RAM and ~3 s per open. On a page `curl` could have fetched, that buys
275
+ nothing — hence `probe`.
276
+
277
+ ### Contexts
278
+
279
+ One engine world per origin, kept alive between calls, so a multi-step flow is several small
280
+ calls instead of one giant script:
281
+
282
+ ```python
283
+ run("window.step = 1", url="https://x.test") # opens the page
284
+ run("window.step + 1") # → 2, same document
285
+ run("fetch('/api/me').then(r => r.text())",
286
+ advance_ms=800, read="window.__last") # carries the cookies earned above
287
+ ```
288
+
289
+ A context dies on `close`, after `FOXFETCH_IDLE_SECONDS` (default 60) of silence, or when the pool
290
+ exceeds `FOXFETCH_MAX_CONTEXTS` (default 2) — least recently used first.
291
+
292
+ ---
293
+
294
+ ## Configuration
295
+
296
+ | Variable | Default | Meaning |
297
+ |---|---|---|
298
+ | `FOXFETCH_HOME` | `%LOCALAPPDATA%\foxfetch` | Artifact root (credentials pass through it) |
299
+ | `FOXFETCH_MAX_CONTEXTS` | 2 | Live contexts before LRU eviction |
300
+ | `FOXFETCH_IDLE_SECONDS` | 60 | Silence before a context is killed |
301
+ | `FOXFETCH_TIMEOUT_MS` | 30000 | Default navigation budget |
302
+ | `FOXFETCH_MAX_BYTES` | 65536 | Output cap before spilling to a file |
303
+ | `FOXFETCH_ARTIFACT_TTL` | 86400 | Seconds before an artifact is deleted |
304
+ | `FOXFETCH_ARTIFACT_MAX` | 67108864 | Artifact directory byte budget |
305
+ | `FOXFETCH_REMIND_AFTER` | 600 | Seconds before responses start reminding about pending artifacts (0 disables) |
306
+ | `FOXFETCH_PY` | — | Interpreter the DSH plugin starts |
307
+
308
+ ## Safety
309
+
310
+ `handoff` writes **live credentials** — cookies including the HttpOnly ones page script cannot
311
+ read. They land under `FOXFETCH_HOME`, owner-only, and expire after `FOXFETCH_ARTIFACT_TTL`.
312
+
313
+ Every tool response reports what is still on disk, and once a file is older than
314
+ `FOXFETCH_REMIND_AFTER` the response grows a `reminder` telling the agent to call `cleanup` and to
315
+ pass `keep=[...]` for anything the user still needs to look at. The field disappears the moment
316
+ cleanup runs, so a stale reminder is a visible bug rather than a silent one.
317
+
318
+ ## What it is not
319
+
320
+ - Not a screenshot tool, not a clicker, not a layout engine — Chromium does that, once it has the
321
+ identity `handoff` exported.
322
+ - Not a session store: every context is fresh, nothing survives `close`.
323
+ - Not a fingerprint randomiser: guessing a profile that matches nobody is worse than sending a
324
+ real Firefox.
325
+
326
+ ## Development
327
+
328
+ ```bash
329
+ pip install -e '.[dev]'
330
+ pytest -q # 45 tests, no network
331
+ mypy src # strict
332
+ ```
333
+
334
+ ```bash
335
+ # when github.com:443 is reset but api.github.com answers, push through the API
336
+ python tools/push_via_api.py --repo <owner>/<name> --dry-run
337
+ ```
338
+
339
+ The tests encode the bugs this rewrite exists to prevent: a clip that split UTF-8 sequences, a URL
340
+ compare that ignored the trailing slash, `sameSite: "Default"` rejected by Playwright, a `cleanup`
341
+ that only deleted expired files, and a runaway browser left behind when the screenshot threw.
342
+
343
+ ## Troubleshooting
344
+
345
+ | Symptom | Cause | Fix |
346
+ |---|---|---|
347
+ | `cannot start the Python service` (DSH) | the plugin found a different interpreter | set `FOXFETCH_PY` to the absolute path |
348
+ | `ModuleNotFoundError: mcp.server.fastmcp` | `mcp` 2.x installed | `pip install "mcp>=1.30,<2"` |
349
+ | `no live context for that origin` | context idled out (60 s) or was evicted | pass `url` again, or keep `context_id` |
350
+ | `navigation produced an empty document` | slow page, or one that needs a real renderer | raise `timeout_ms`, or use `handoff` + Chromium |
351
+ | tools appear twice | two entries in one host | remove one |
352
+ | `pip install` stops mid-download | flaky network to `files.pythonhosted.org` | retry, or `pip install --proxy http://127.0.0.1:7897 foxfetch` |
353
+
354
+ ## Uninstall
355
+
356
+ ```bash
357
+ pip uninstall foxfetch
358
+ ```
359
+
360
+ Artifacts: `%LOCALAPPDATA%\foxfetch` (Windows) or `~/.local/share/foxfetch`. Then delete the host
361
+ entry — the `mcpServers` block, the `[mcp_servers.foxfetch]` table, or the `dsh-foxfetch`
362
+ dependency plus its bundle line.
363
+
364
+ ## Licence
365
+
366
+ MIT. The engine (`ruyijs`) is a separate project under AGPL-3.0; foxfetch only calls it — no
367
+ ruyijs code is bundled.