iframer-toolkit 0.10.1 → 0.10.5

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.
package/README.md CHANGED
@@ -1,6 +1,10 @@
1
1
  # iframer-toolkit
2
2
 
3
- Browser access for AI agents when normal fetching fails. Give Claude, Codex, or any MCP-compatible agent a real browser — with session persistence, stealth fingerprinting, encrypted credential storage, and automatic captcha solving, and most af all, API Reverse Engineering.
3
+ Browser access for AI agents when normal fetching fails. Give Claude, Codex, or any MCP-compatible agent a real browser: with session persistence, stealth fingerprinting, encrypted credential storage, and automatic captcha solving, and most of all, API Reverse Engineering.
4
+
5
+ ### Is this AI slop?
6
+ No. This is a tool I use almost EVERY SINGLE DAY and I have put a lot of thought and real engineering to actually make this a tool I am proud of.
7
+ Why did I develop this? Because I felt like the other agentic browsers didn't give me enough power and felt very expensive token-wise.
4
8
 
5
9
  ## Example:
6
10
  <img width="2962" height="1116" alt="image" src="https://github.com/user-attachments/assets/c937b39c-5dba-4d6a-892d-71243ecf8146" />
@@ -10,8 +14,11 @@ Resulting rev API example:
10
14
  Ships as:
11
15
  - **CLI** (`iframer-toolkit` / `iframer`) — browse, screenshot, credentials, sessions, reverse-engineer APIs
12
16
  - **MCP server** — plugs directly into Claude Code or Codex so agents can drive the browser themselves
17
+ - **Browser extension** (optional) — lets the agent drive tabs in **your real Chrome**, on your real logged-in session
13
18
  - **Self-hosted Docker server** (optional) — adds live headful browsing over noVNC for remote/multi-user setups
14
19
 
20
+ The rest of this description is AI generated, bad for humans, good for LLMs:
21
+
15
22
  ## Install
16
23
 
17
24
  ```sh
@@ -21,19 +28,26 @@ npm install -g iframer-toolkit
21
28
  Then pull in the runtime dependencies (Chrome for Testing + MCP registration):
22
29
 
23
30
  ```sh
24
- iframer-toolkit install deps
31
+ iframer-toolkit install
25
32
  ```
26
33
 
27
34
  This is shorthand for:
28
35
 
29
36
  ```sh
30
37
  iframer-toolkit install chromium # downloads Chrome for Testing to ~/.iframer
31
- iframer-toolkit install-mcp # registers the MCP server in ~/.claude.json and ~/.codex/config.toml
38
+ iframer-toolkit install mcp # registers the MCP server in ~/.claude.json and ~/.codex/config.toml
32
39
  ```
33
40
 
34
41
  Restart Claude Code or Codex and the `iframer` tools will be available.
35
42
 
36
- > **Note:** If you prefer, your agent can run `iframer-toolkit install deps` for you — it'll figure the rest out.
43
+ To update later:
44
+
45
+ ```sh
46
+ iframer-toolkit update # update via npm (also refreshes the extension if installed)
47
+ iframer-toolkit update --check # just report whether a newer version exists
48
+ ```
49
+
50
+ > **Note:** If you prefer, your agent can run `iframer-toolkit install` for you — it'll figure the rest out.
37
51
 
38
52
  ## Quick start
39
53
 
@@ -50,7 +64,7 @@ iframer-toolkit reverse-engineer https://some-spa.com # capture the APIs i
50
64
  iframer-toolkit --cache # list cached domains
51
65
  ```
52
66
 
53
- **From Claude Code or Codex** (after `install-mcp`):
67
+ **From Claude Code or Codex** (after `install mcp`):
54
68
 
55
69
  > "Log into my account on example.com and extract the latest invoice."
56
70
 
@@ -59,15 +73,20 @@ The agent will call `knowledge` first (to see if a direct-API path is cached), f
59
73
  ## How it works
60
74
 
61
75
  ```
62
- Claude / Codex (MCP) ──→ iframer MCP server ──→ Iframer (local)
76
+ Claude / Codex (MCP) ──→ iframer MCP server ──→ shared local server (127.0.0.1)
63
77
  ├─ patchright (stealth Chromium)
64
78
  ├─ Chrome for Testing
79
+ ├─ your real Chrome (optional, via extension)
65
80
  └─ SQLite at ~/.iframer — one file for
66
81
  encrypted credentials, session state,
67
82
  and per-domain knowledge cache
68
83
  ```
69
84
 
70
- By default, `install-mcp` runs in **local mode**: no Docker needed. The MCP spawns a stealth-patched Chromium (via [patchright](https://github.com/Kaliiiiiiiiii-Vinyzu/patchright)) on your machine. `install-mcp` registers the server in both Claude Code (`~/.claude.json`) and Codex (`~/.codex/config.toml`).
85
+ By default, `install mcp` runs in **local mode**: no Docker needed. Both the MCP clients and the `iframer execute` CLI talk to **one shared local server** (discovered via `~/.iframer/server.json`, loopback-only) that keeps a stealth-patched Chromium (via [patchright](https://github.com/Kaliiiiiiiiii-Vinyzu/patchright)) warm between calls, tracks every browser it spawns in an on-disk PID registry so nothing leaks, and idle-exits when no one needs it. `install mcp` registers the server in both Claude Code (`~/.claude.json`) and Codex (`~/.codex/config.toml`).
86
+
87
+ **Warm CLI.** `iframer execute` routes to that shared daemon instead of launching a cold browser per invocation, so after the first call it's as fast as the MCP (pass `--in-process` to force a private throwaway browser). Each agent gets its own browser instance (keyed off `CLAUDE_CODE_SESSION_ID` / `TERM_SESSION_ID`, or set `IFRAMER_INSTANCE`), so concurrent agents never share a window, while all CLI calls share one login session.
88
+
89
+ **Resuming a task.** The browser and its page persist in the daemon between calls and survive an interrupt (Ctrl-C). Name a multi-step or human-in-the-loop task's browser with a stable `instanceId`, and to resume just run `execute` again with the same `instanceId` and act on the current page (`snapshot`/`read`/`find`) — don't navigate again, which would reload and lose the state (e.g. an OTP screen). `iframer instances` lists the live windows and which page each is on.
71
90
 
72
91
  **One credential store for every browser mode.** Stored credentials, session cookies/localStorage, and the knowledge cache all live in a single SQLite file at `~/.iframer/iframer.db`. Store a password once (via CLI or MCP) and every mode — `headless`, `binary-headful`, `docker-headful` — uses the same row. No split-brain between modes.
73
92
 
@@ -77,6 +96,17 @@ By default, `install-mcp` runs in **local mode**: no Docker needed. The MCP spaw
77
96
 
78
97
  For live remote viewing, multi-user, or Linux server deployments, see [Self-hosting with Docker](#self-hosting-with-docker) below.
79
98
 
99
+ ## Extension mode — drive your real Chrome
100
+
101
+ The optional browser extension lets the agent drive **a tab you already have open in your real Chrome** — no relaunch, no remote-debugging port, on your real logged-in session. The extension dials out to iframer's local server and relays the CDP protocol via `chrome.debugger`, so your live tab is driven by the exact same pipeline engine (find / click / snapshot / obstacle handling / API capture) as every other mode, with real trusted input. While a run is active, Chrome shows its yellow "started debugging" bar.
102
+
103
+ ```sh
104
+ iframer install extension chrome # installs the pairing host, prints the folder to load
105
+ iframer extension path # prints it again
106
+ ```
107
+
108
+ Then load it once: `chrome://extensions` → Developer mode → **Load unpacked** → the printed folder. Once paired, the agent lists your open tabs with the `tabs` tool and drives the one you mean. Multiple Chrome profiles/browsers can be paired at once — each identifies itself with a profile name, and iframer routes work to the profile that owns the target tab. See [`extension/README.md`](extension/README.md) for details.
109
+
80
110
  ## CLI reference
81
111
 
82
112
  ```
@@ -88,6 +118,8 @@ Pipeline:
88
118
  --capture-api Record XHR/fetch requests during execution
89
119
  --continue-on-error Don't stop on step failure
90
120
  --timeout <ms> Stale-state timeout (default: 20000)
121
+ --json Print raw PipelineResult JSON (default: compact agent-readable text)
122
+ --in-process Skip the shared warm daemon; run a private in-process browser
91
123
 
92
124
  Quick actions:
93
125
  browse <url> Headless fetch with JS rendering
@@ -102,8 +134,12 @@ Quick actions:
102
134
  --output <dir> Save directory
103
135
  --typed Generate TypeScript
104
136
 
137
+ Browser windows:
138
+ instances List live browser windows (instanceId → current page)
139
+ windows Alias of instances
140
+
105
141
  Session:
106
- session stop Stop and save cookies/localStorage
142
+ session stop Save state + close idle browsers on the shared daemon
107
143
  session clear Wipe stored session data
108
144
  session status Check session state
109
145
 
@@ -124,12 +160,18 @@ Knowledge cache:
124
160
  knowledge get <domain> Same as --cache <domain>
125
161
  knowledge clear [domain] Same as --clear-cache [domain]
126
162
 
163
+ Telemetry:
164
+ telemetry Report estimated session tokens consumed by MCP tool calls
165
+ telemetry --clear Wipe the telemetry log
166
+
127
167
  Setup:
168
+ install Install everything (Chromium + MCP)
128
169
  install chromium Download Chrome for Testing
129
- install mcp Register MCP server in Claude Code and Codex
130
- install deps Run both of the above
131
- install-mcp [--dev] Same as `install mcp`
132
- remove-mcp [--dev] Remove iframer MCP from Claude Code and Codex
170
+ install mcp [--dev] Register MCP server in Claude Code and Codex
171
+ install extension chrome Install the optional browser extension pairing host
172
+ extension path Print the extension folder to load in chrome://extensions
173
+ update [--check] Update iframer via npm (--check: report only)
174
+ remove [chromium|mcp|extension] Remove everything, or one piece
133
175
 
134
176
  Browser:
135
177
  modes Show available browser modes
@@ -144,9 +186,12 @@ Once the MCP is registered, the agent has access to:
144
186
 
145
187
  - **`status`** — system health, session state, stored credentials, available browser modes
146
188
  - **`knowledge`** — read / list / clear the per-domain knowledge cache. Agents are told to check this **before** every `execute` or `browse` — if the cache has a direct-API path for the data, the browser doesn't launch at all.
147
- - **`execute`** — run a pipeline of browser steps (navigate, click, fill, human-click, human-type, scroll, wait, evaluate, extract, keyboard, login, solve-captcha, screenshot, snapshot, find). Each step has a 20s stale-state timeout. On failure, returns the exact step, error type, and a screenshot of the page at the point of failure. Auto-escalates browser modes transparently on bot-block.
189
+ - **`execute`** — run a pipeline of browser steps (navigate, click, right-click, fill, select, human-click, human-type, type-code, read, evaluate, extract, wait, wait-for, scroll, keyboard, upload, paste, download, login, solve-captcha, recaptcha, screenshot, snapshot, find). Each step has a 20s stale-state timeout. On failure, returns the exact step, error type, and a screenshot of the page at the point of failure. Auto-escalates browser modes transparently on bot-block.
148
190
  - **`browse`** — fast headless fetch with session persistence for pages that don't need a full pipeline
149
191
  - **`reverse-engineer`** — capture the APIs a site calls (feeds into the knowledge cache so future runs can skip the browser)
192
+ - **`remember`** — per-domain **element anchors**: save a selector once under a name, then target it as `@a:<name>` in any later pipeline — no re-finding the element on every visit. Anchors self-heal (a failed anchor triggers re-discovery, not blind retries) and the tool also records per-site quirks.
193
+ - **`tabs`** — list and target tabs in your real Chrome (requires the [extension](#extension-mode--drive-your-real-chrome))
194
+ - **`clipboard`** — read/write the machine's clipboard (the same one your Chrome uses): read a code a site just copied, or stage text to paste into a field via the `paste` step
150
195
  - **`session`** — `stop` (save state) or `clear` (wipe)
151
196
  - **`credentials`** — `store` (secure form via MCP elicitation), `list`. The `store` action will **refuse to overwrite** existing credentials unless explicitly told to (`force: true`) — this blocks the common "login failed, re-ask for password" anti-pattern when the real problem is browser mode / bot detection.
152
197
 
@@ -154,7 +199,7 @@ Once the MCP is registered, the agent has access to:
154
199
 
155
200
  Session data (cookies + localStorage) and credentials are stored in SQLite at `~/.iframer/iframer.db` and encrypted with AES-256-GCM. Data is automatically re-injected on the next `execute` or `browse` so agents stay logged in across restarts — and across browser modes: a session captured in `binary-headful` will transparently load into `headless` on the next run.
156
201
 
157
- The encryption key lives at `~/.iframer/secret` (0600 permissions), generated on first `install-mcp`. Set `IFRAMER_SECRET` in your environment to override it — useful if you want to synchronize the key across multiple machines.
202
+ The encryption key lives at `~/.iframer/secret` (0600 permissions), generated on first `install mcp`. Set `IFRAMER_SECRET` in your environment to override it — useful if you want to synchronize the key across multiple machines.
158
203
 
159
204
  ## Knowledge cache
160
205
 
@@ -191,7 +236,9 @@ Requires `ANTHROPIC_API_KEY` in your environment.
191
236
  | Variable | Required | Description |
192
237
  |---------------------|----------|-------------|
193
238
  | `ANTHROPIC_API_KEY` | For captcha | Used for vision-based captcha solving |
194
- | `IFRAMER_SECRET` | No | Encryption key for sessions & credentials. Defaults to the value at `~/.iframer/secret` (auto-generated on first `install-mcp`). Override in the shell or in `.env` to pin a specific key. |
239
+ | `IFRAMER_SECRET` | No | Encryption key for sessions & credentials. Defaults to the value at `~/.iframer/secret` (auto-generated on first `install mcp`). Override in the shell or in `.env` to pin a specific key. |
240
+ | `IFRAMER_TELEMETRY` | No | Set to `0` in the MCP env to disable the local token-telemetry log (`iframer telemetry` reads it). |
241
+ | `IFRAMER_LOCAL_PORT`| No | Base port for the shared local server (default: `3022`, loopback only). |
195
242
  | `IFRAMER_DATA_DIR` | No | Override the data directory. Default: `~/.iframer`. The Docker container sets this to `/iframer-data` so a bind mount makes host and container share one database. |
196
243
  | `IFRAMER_MODE` | No | `local` (default) or `docker`. Force a mode regardless of what's running. |
197
244
  | `IFRAMER_URL` | No | Docker API URL when self-hosting (default: `http://localhost:3021`). |
@@ -224,7 +271,7 @@ bun run stop:docker # stop containers
224
271
  If you're running Docker on a remote machine and the MCP on a different machine, install the MCP with the remote URL:
225
272
 
226
273
  ```sh
227
- IFRAMER_URL=https://your-host:3021 iframer-toolkit install-mcp --dev
274
+ IFRAMER_URL=https://your-host:3021 iframer-toolkit install mcp --dev
228
275
  ```
229
276
 
230
277
  When Docker is on the same host as the MCP, no extra setup is needed — the local MCP server will auto-detect the Docker API on `localhost:3021` and route only `docker-headful` requests through it.
@@ -245,6 +292,8 @@ Or run `iframer-toolkit watch` to auto-open it.
245
292
  |--------------------|------------|
246
293
  | Browser engine | [patchright](https://github.com/Kaliiiiiiiiii-Vinyzu/patchright) (stealth-patched Playwright fork) |
247
294
  | Browser binary | Chrome for Testing (downloaded to `~/.iframer/chrome/`) |
295
+ | Local server | One shared warm server per machine (loopback-only, discovered via `~/.iframer/server.json`), on-disk browser PID registry, idle auto-exit |
296
+ | Extension mode | Chrome extension relaying CDP over WebSocket (`chrome.debugger` → `connectOverCDP`) — drives tabs in your real Chrome |
248
297
  | Stealth | Fingerprint injection, WebRTC leak prevention, worker patching |
249
298
  | Credential store | SQLite at `~/.iframer/iframer.db`, AES-256-GCM encrypted, shared by every browser mode |
250
299
  | Session persistence| Same SQLite file — cookies + localStorage re-injected across runs and modes |