Give an AI agent a real browser, get an API back.
Drive a site once and iframer hands the agent the actual request behind it, no devtools, no HAR file.
Most agent-driven browsers only replay clicks. Every visit to the same page means rendering the whole thing again, screenshot after screenshot, just to read one field off it.
iframer drives a real, stealth-patched Chromium, or your own logged-in Chrome through the extension, and while it does:
- Records the fetch and XHR calls the page makes while it drives it (not static assets), no manual devtools work
- Hands back the real request behind a login form or a button click: method, headers, auth, a working curl
- Generates typed functions ready to
import, when an agent is doing the driving - Caches the domain after the first run, so the next visit skips the browser and hits the endpoint directly, seconds down to milliseconds
The left side of the GIF above is docs/example/site/index.html: one button, one hidden API call. The right side is a real terminal, only the typing pace was staged for the recording; the command and its output are exactly what running it produces. Capturing it for real:
cd docs/example/site && python3 -m http.server 8934 &
iframer-toolkit reverse-engineer '[
{"type":"navigate","url":"http://localhost:8934/index.html"},
{"type":"click","selector":"#load"},
{"type":"wait","ms":1000}
]' --output docs/example/apiThat produced docs/example/api/captured-api.json: the exact request, headers, response body, and a curl command, all automatic, no agent required.
The rest of docs/example/api/ (getTodos.ts, transport/rest.ts, types.ts, README.md) is what an agent writes from that capture: iframer tells it the endpoint's protocol, verb, and function name, and the agent turns that into a typed function. That's what happened here, driven by Claude through the MCP reverse-engineer tool.
The whole round trip, one click to one typed endpoint, cost about 590 tokens back to the agent. This is the whole thing you get: no HAR file, no manual devtools work, a function you can call.
Most of iframer's savings come from the snapshot it hands back: capped and filtered, instead of the full accessibility tree other tools dump into context. Measured with the same tokenizer, same steps, on the same three tasks:
| Task | iframer (MCP) | iframer (CLI) | agent-browser | Playwright MCP |
|---|---|---|---|---|
| Wiki link chase (6 hops, Everest → Gojo) | 517 | 721 | 913 | 1,405 |
| Store purchase (login → sort → cart → checkout) | 552 | 697 | 851 | 2,739 |
| Heavy-page recon (GitHub: look + pull 4 facts) | 986 | 1,058 | 8,433 | 19,906 |
The gap grows with how much DOM the page has. On the GitHub page, iframer spent about 986 tokens where Playwright MCP spent about 19,900, roughly 20x. That's per-task cost. It doesn't include the roughly 5.1k tokens of MCP tool-definition overhead loaded once per session, not per task.
npm install -g iframer-toolkitThen pull in the runtime dependencies (Chrome for Testing + MCP registration):
iframer-toolkit installThis is shorthand for:
iframer-toolkit install chromium # downloads Chrome for Testing to ~/.iframer
iframer-toolkit install mcp # registers the MCP server in ~/.claude.json and ~/.codex/config.tomlRestart Claude Code or Codex and the iframer tools will be available.
To update later:
iframer-toolkit update # update via npm (also refreshes the extension if installed)
iframer-toolkit update --check # just report whether a newer version exists
iframer-toolkit --version # print the installed versionYour agent can also just run iframer-toolkit install for you; it figures out the rest.
Ships as:
- CLI (
iframer-toolkit/iframer): browse, screenshot, credentials, sessions, reverse-engineer APIs - MCP server: plugs into Claude Code or Codex so agents drive the browser themselves
- Browser extension (optional): lets the agent drive tabs in your real Chrome, on your real logged-in session
Once installed, drive the browser via the CLI directly, or ask your agent (Claude Code / Codex) to do it through the MCP.
CLI:
iframer-toolkit status # system + browser modes
iframer-toolkit browse https://example.com --extract 'document.title'
iframer-toolkit screenshot https://news.ycombinator.com -o /tmp/hn.png
iframer-toolkit credentials add github.com # interactive masked prompt
iframer-toolkit reverse-engineer https://some-spa.com # capture the APIs it calls
iframer-toolkit --cache # list cached domainsFrom Claude Code or Codex (after install mcp):
"Log into my account on example.com and extract the latest invoice."
The agent calls knowledge first to check for a cached direct-API path, falls back to credentials + execute if there isn't one, auto-escalates browser modes if a site blocks headless, and returns the result. No copying cookies, no proxies, no manual login.
Claude / Codex (MCP) ──▶ iframer MCP server ──▶ shared local server (127.0.0.1)
├─ patchright (stealth Chromium)
├─ Chrome for Testing
├─ your real Chrome (optional, via extension)
└─ SQLite at ~/.iframer: one file for
encrypted credentials, session state,
and per-domain knowledge cache
Everything runs on your machine. 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 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).
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 IFRAMER_INSTANCE, so concurrent agents never share a window, while all CLI calls share one login session.
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, run execute again with the same instanceId and act on the current page (snapshot / read / find). Don't navigate again; that reloads the page and loses state like an OTP screen. iframer instances lists the live windows and which page each is on.
One credential store for every browser mode. Stored credentials, session cookies/localStorage, and the knowledge cache all live in one SQLite file at ~/.iframer/iframer.db. Store a password once, from the CLI or the MCP, and every mode (headless, binary-headful) uses the same row.
Auto-escalation. When a pipeline is blocked in headless (bot detection, captcha), iframer retries in binary-headful without a round trip to the agent. The mode that worked is recorded in ~/.iframer/domain-modes.json, so the next run on that domain starts at the right mode.
Knowledge cache. After every successful run, iframer writes a per-domain markdown file at ~/.iframer/knowledge/<domain>.md recording which cookies, localStorage keys, and headers the site uses for auth, plus any API endpoints seen along the way. The next time an agent needs data from that domain, it reads the cache first; if there's a direct-API path, it skips the browser entirely. See Knowledge cache below.
The optional browser extension lets the agent drive a tab you already have open in your real Chrome. No relaunch, no remote-debugging port, 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.
There's no Chrome Web Store listing. You load it as an unpacked, developer-mode extension, straight from the files npm just installed on your machine.
-
Run:
iframer install extension chrome
This installs a small pairing host and prints a folder path. That folder is the extension itself.
-
Open
chrome://extensionsin Chrome. -
Turn on Developer mode, the toggle is top right.
-
Click Load unpacked.
-
In the file picker, paste the folder path from step 1 and select it.
Chrome loads the extension and pins its icon to the toolbar. That's the whole install, one time only.
Lost the path, or setting up a second machine? Run:
iframer extension pathIt prints the same folder every time.
That folder lives inside wherever npm put iframer-toolkit globally, not inside a git checkout of this repo. On most machines that's something like /usr/local/lib/node_modules/iframer-toolkit/extension or, with nvm, a path under ~/.nvm/versions/node/<version>/lib/node_modules/iframer-toolkit/extension. Run the command above instead of guessing, the exact path depends on your Node setup.
Loading it from that exact path matters: it's what lets iframer update refresh the extension files in place, then tell Chrome to reload it, no repeating the install steps after every update.
Once loaded, the extension pairs itself on macOS, Linux and Windows. The pairing host installed in step 1 hands it the same local token the CLI and MCP already use, straight from ~/.iframer/secret. Nothing to copy, nothing to type. The install command also tests the host and starts the local server, and it tells you if either one fails.
If auto-pairing ever fails, click the iframer icon in the toolbar and paste the output of this command, in any terminal:
iframer extension tokenthen Save & connect.
Either way, check the popup: the dot next to "iframer" turns green only once the running server has accepted the token. If it can't connect, the popup says why and keeps retrying.
You can repeat this whole install on more than one Chrome profile, or in Brave, Edge, or another Chromium-based browser, at the same time. Each one pairs under its own profile name, and iframer routes each task to whichever profile actually has the tab. Once paired, the agent lists your open tabs with the tabs tool and drives the one you mean. See extension/README.md for how the pipeline and multi-profile routing work under the hood.
iframer-toolkit <command> [args]
Pipeline:
execute <pipeline.json|json> Run a pipeline of browser steps
--mode <mode> Force browser mode (headless|binary-headful)
--capture-api Record XHR/fetch requests during execution
--continue-on-error Don't stop on step failure
--timeout <ms> Stale-state timeout (default: 20000)
--json Print raw PipelineResult JSON (default: compact agent-readable text)
--in-process Skip the shared warm daemon; run a private in-process browser
Quick actions:
browse <url> Headless fetch with JS rendering
--extract <js> Evaluate JS and return result
--html Return full page HTML
--wait-for <selector> Wait for element before extracting
--sessionless Skip session persistence
screenshot <url> Take a screenshot of a URL
--mode <mode> Browser mode (default: headless)
--annotate Overlay element badges with refs
reverse-engineer <url|file> Capture API calls a site makes
--output <dir> Save directory
--typed Generate TypeScript
--mode <mode> Browser mode
Reverse engineer from a browser iframer doesn't control (T3 Code, Playwright MCP, ...).
The browser only maps the site; the output is a local folder with a Node client:
kit Write the in-page kit, print the agent's tool calls
--for <t3|playwright-mcp|any> Which browser tool's steps to print (default: t3)
--mode passive No patching: URLs + form posts only
--host-filter <regex> Only record matching hosts (e.g. 'discord\.com$')
--max-calls <n> Replay calls allowed per tab session (default: 500)
--max-result <n> Chars a call returns before switching to an overview (default: 4000)
--hard-max <n> Chars a call can ever return, even with {full:true} (default: 30000)
--print Print the kit source instead (tools without upload)
bridge attach <host> Tab bridge: print the one expression that attaches a logged-in tab
--for <t3|playwright-mcp|any> Which browser tool's steps to print (default: t3)
--site <domain> Cover a parent domain too (default: the host, without www.)
--name <n> Tab name when 2 profiles use the same site (IFRAMER_BRIDGE_TAB=<n>)
--read-only Refuse anything but GET/HEAD for this tab
bridge status | stop Which sites have a tab attached / stop the bridge
bridge client [--out <file>] Write the 1-file client (bridgeFetch) for other Node scripts
ingest <file|-|--latest> Capture -> folder: index.txt, api.json, auth.json, client.mjs (Node)
--latest Newest capture in T3 Code's downloads or ~/Downloads
--out <dir> Output folder (default: ~/.iframer/apis/<host>/)
--all Keep third-party hosts and framework assets
--keep Keep the capture file (default: deleted)
--no-knowledge Don't update ~/.iframer/knowledge
--strict Refuse on any secret-looking value instead of replacing it
--json One-line JSON summary
schema <host> <path> Captured structure of a page: lists of records + keys
auth <host> [--out <dir>] Session for client.mjs -> <dir>/.env, from a logged-in browser on this machine
run <host> [recipe] [args] Same as node <dir>/client.mjs [recipe] [args]
recipe <host> [name] ... Save a learned task as a function of client.mjs (iframer --help)
Browser windows:
instances List live browser windows (instanceId → current page)
windows Alias of instances
Session:
session stop Save state + close idle browsers on the shared daemon
session clear Wipe stored session data
session status Check session state
Credentials:
credentials add <domain> Store login credentials (encrypted)
--username <user> Username or email
--password <pass> Password (interactive masked prompt if omitted)
--totp-secret <secret> TOTP secret for 2FA
credentials list List domains with stored credentials
credentials remove <domain> Delete credentials for a domain
Knowledge cache:
--cache List all cached domains
--cache <domain> Print the cached knowledge for one domain
--clear-cache Wipe all cached knowledge
--clear-cache <domain> Wipe one domain's cache
knowledge list Same as --cache
knowledge get <domain> Same as --cache <domain>
knowledge clear [domain] Same as --clear-cache [domain]
Telemetry:
telemetry Report estimated session tokens consumed by MCP tool calls
telemetry --clear Wipe the telemetry log
Setup:
install Install everything (Chromium + MCP)
install chromium Download Chrome for Testing
install mcp [--dev] Register MCP server in Claude Code and Codex
install extension chrome Install the optional browser extension pairing host
extension path Print the extension folder to load in chrome://extensions
extension token Print the pairing token (only needed to pair by hand)
update [--check] Update iframer via npm (--check: report only)
refresh Rewrite the in-page kit, the /iframer skill and every client.mjs (update runs it)
remove [chromium|mcp|extension] Remove everything, or one piece
Browser:
modes Show available browser modes
status Show system status
The binary is available as either iframer-toolkit (full name) or iframer (short alias). npx iframer-toolkit ... also works without a global install.
Once the MCP is registered, the agent has access to:
status: system health, session state, stored credentials, available browser modesknowledge: read/list/clear the per-domain knowledge cache. Agents are told to check this before everyexecuteorbrowse; if the cache already has a direct-API path, the browser never launches.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, andclickfails at 8s with Playwright's own reason (not visible, covered by another element). On failure, it returns the exact step, error type, and a screenshot of the page at the point of failure. Auto-escalates browser modes on bot-block. See Pipeline guardrails.browse: fast headless fetch with session persistence for pages that don't need a full pipelinereverse-engineer: capture the APIs a site calls (feeds the knowledge cache so future runs can skip the browser)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.tabs: list and target tabs in your real Chrome (requires the extension)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 thepastestepsession:stop(save state, close the browser),clear(wipe stored session data),restart(kill browsers and reset after a freeze or crash; credentials and knowledge are kept),capture-start/capture-stop(record XHR/fetch outside a pipeline),get-cookies(all cookies, including HttpOnly),get-auth(cookies, localStorage and sessionStorage together)credentials:store(secure form via MCP elicitation),list.storerefuses to overwrite existing credentials unless told to (force: true), which blocks the common "login failed, re-ask for password" mistake when the real problem is browser mode or bot detection.
Some calls are refused or cut short on purpose, so an agent gets a clear error instead of a hang, a stray window, or a tripped bot trap.
- Honeypots.
snapshotleaves out fields no human can reach (pushed offscreen, clipped, or made transparent by an ancestor) and marks bait-looking ones (website,fax,tabindex=-1) as[honeypot?].fillrefuses an unreachable field with an explanatory error; passforce: trueonly when you're certain the field is real. - Selectors. Use an
@eref fromsnapshot/find, an@a:anchor, or plain CSS. Playwright-only syntax (text=,:has-text(),:text-is(),>>) is rejected with a hint tofindthe element instead. - Frozen tabs. Every page probe has a time budget, so a tab whose JS stops answering fails in about 30s. In extension mode, the watchdog names the step that hung and keeps the results of the steps that finished.
- Stuck navigation. If a page never commits to the new URL,
navigatefalls back tolocation.assign.beforeunloadprompts are accepted. - No stray windows. A pipeline with no
navigatestep and no live browser to reattach to is refused, as ismode: "extension"without atabId. While the extension is connected,sessioncapture-start,capture-stop,get-cookiesandget-authalso refuse to open a new window unless you pass amodeor a matching browser is already open. - Keyboard in extension mode. Cmd/Ctrl+A selects all in every mode. Other Cmd/Ctrl shortcuts are refused in extension mode.
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 load into headless on the next run.
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 sync the key across machines.
Every successful execute run updates a plain markdown file at ~/.iframer/knowledge/<domain>.md, human-readable, grep-able, editable. Each file captures:
- Which cookies, localStorage keys, and headers are load-bearing for authentication (names only; values stay encrypted in the session store)
- Which API endpoints the site called during the run, with method, path, example curl, and status code
- Which browser mode last worked for the domain
- Notes about captcha or bot-detection behavior
The MCP knowledge tool exposes this with get, list, and clear actions. Agents are instructed to call it before every browser-touching tool; if the cache already has a direct-API path for the data, the agent hits the API directly and never launches a browser. First request takes seconds, repeat requests on the same domain take milliseconds.
Inspect the cache yourself:
iframer-toolkit --cache # list all cached domains
iframer-toolkit --cache figma.com # print the markdown for one domain
iframer-toolkit --clear-cache # wipe all cached knowledge
iframer-toolkit --clear-cache figma.com # wipe one domainAgent browsers like T3 Code's preview tabs or Playwright MCP can't see network traffic. iframer's in-page kit records the page's own API calls (shapes, never values) while the agent uses the site. The output is a local folder with the API map and client.mjs, a Node client that calls the API directly, with no browser. It's built for Next.js apps (RSC payloads, Server Actions) and works on plain JSON APIs too.
iframer kit --for t3 # writes ~/.iframer/kit/iframer-kit.js, prints the agent's 4 install calls
iframer ingest --latest --out ./api # capture -> ./api: index.txt, api.json, auth.json, client.mjs, .env.example
# (the session is taken from your logged-in browser -> ./api/.env)
node ./api/client.mjs # what it can do, which auth is missing
iframer recipe <host> <name> … # save a learned task as a function of client.mjs
node ./api/client.mjs <name> '{"team":"core"}'Without --out, everything goes to ~/.iframer/apis/<host>/.
How an agent uses it:
- Map. Install the kit in the tab, use the site,
window.__ifk.dump(), theniframer ingest. The tab isn't needed after this. - Auth, automatic.
ingesttakes the session from a browser on this machine that is logged in to the site (T3 Code tabs, iframer's own browser, then Chrome, Brave, Edge, Arc), checks it on a captured page that needs a login, and writes it to.env. When it expires,client.mjsre-reads it the same way and retries once.iframer auth <host>does it by hand;--from-filesets values by hand (an API key, or a machine with no logged-in browser). Auth headers the site sends (Authorization,x-api-key, ...) go in the same file, named after the header (AUTHORIZATION,X_API_KEY). - Learn (about 2 calls).
node client.mjs get <path> --rsc --schemalists every list of records on the page with its keys and one masked sample. Then verify:--find Comp --pick 'items.{id,status}' --where status=open --group ownerreturns{count, by}, not the list. - Save and repeat.
iframer recipe <host> <name> --path /{team}/board --rsc --find … --pick … --format "d => …"adds<name>toclient.mjs. Run it withnode client.mjs <name> '{"team":"core"}', orimport { <name> } from "./client.mjs"in your own script.
What it guarantees:
- No silent wrong answers. A
findthat matches two different kinds of object is refused with both candidates. A recipe locks to the shape it learned and returnsmatched a different listorshape changed: missing xinstead of a plausible 0. A filter with no list to run on is an error. - Small answers. CLI results over 4,000 chars come back cut, with the page's schema;
--fullstops at 30,000. - Next.js specifics. Route segments named from the app's route data (
/{org}/{project}/issues), RSC flight parsing including React's path references, server-rendered HTML as--nodes a, Server Actions called by export name (node client.mjs action <name> --approved, recipes--action) with the id re-found after deploys, inline actions via--action-prop. - Safe defaults. Same-site requests only. Actions need
--approved. Stops on 403, 429 or a captcha; retries GETs on 5xx; reports "session expired" on a login redirect or 401, with theiframer authcommand to refresh it. The.envis never printed, and is gitignored. - Not complete. Worker traffic, redirect hops, cross-origin iframes, and calls a page makes before the kit is installed are invisible to it.
- Bot walls. For sites that block requests from Node,
iframer recipe … --in-pagebuilds the same recipes as a bundle that runs inside a logged-in tab. It's a fallback, not the default. The tab bridge below is the other way: the Node client keeps running and the tab only carries its requests.
When the session can't be exported (on Windows a running T3 Code or Chrome locks its cookie store), or you don't want any cookie taken out of the browser, a Node script can send its requests through a tab that is already logged in. The tab does the fetch with its own login, HttpOnly cookies included. The browser's cookies are never exported or saved, and the agent makes no tool call per request, so scheduled scripts work.
iframer bridge attach www.example.com # starts the bridge, prints ONE expression
# evaluate that expression once in the logged-in tab -> ATTACHED
node ~/.iframer/apis/www.example.com/client.mjs <recipe> # picks the tab by itself
iframer bridge statusNode script -> POST 127.0.0.1/fetch (token) -> bridge daemon -> WebSocket -> relay in the tab -> same-site fetch
- Off unless a tab is attached. With nothing attached,
client.mjsruns exactly as before. - Any browser where one line of JS can run: T3 Code (
preview_evaluate), Playwright MCP (browser_evaluate), a DevTools console. The relay patches nothing: one WebSocket and the page's ownfetch. - Safe by construction. 127.0.0.1 only; scripts need a per-run token and web pages are refused; a tab is accepted only with the key minted for its exact origin; a request goes only to a tab of its own site and never follows a redirect off it. Nothing is stored.
- Built for tabs that misbehave. A frozen background tab is detected in 5 s, remembered and skipped. At most 4 reads per site are in flight, the rest wait in line. A read may move to another tab; a write is never sent twice (the tab holds it until the bridge says go), and the error says whether it may have reached the site. A run decides once, tab or saved session, and never switches half-way.
- Limits. Sites whose CSP forbids connecting to 127.0.0.1 answer
CSP_BLOCKED(useiframer auth, in-page replay or the extension there). A page reload drops the relay: evaluate the expression again. A bridge restart does not: the tab reconnects by itself. Responses are capped at 32 MB and streams are refused. Redirects are not followed (a script sees "session expired, or the page moved"). It carries requests only: no clicks, navigation or screenshots. - Other scripts.
iframer bridge client --out tab-bridge.mjswrites a 1-file module:(await bridgeFetch(url, init)) ?? <your own request>.
iframer can try to solve reCAPTCHA and hCaptcha with Claude's vision API, in any browser mode. Treat it as best effort: it fails on many challenges, and when someone is at the screen it's more reliable to have them solve it in a binary-headful window. To try it, use the solve-captcha step in a pipeline:
{ "type": "solve-captcha" }Requires ANTHROPIC_API_KEY in the environment that starts the iframer server: your shell for the CLI, or the env block of your MCP config. If the server is already running, stop it first so it picks up the key. With a key set, navigate also tries automatically when it lands on a captcha, and each attempt uses API credit.
If it can't solve the captcha, the run fails with captcha-unsolvable and the reason.
| Variable | Required | Description |
|---|---|---|
ANTHROPIC_API_KEY |
For captcha | Used for vision-based captcha solving |
IFRAMER_CAPTCHA_MODEL |
No | Claude model the solver uses (default: claude-haiku-4-5-20251001). |
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. |
IFRAMER_TELEMETRY |
No | Set to 0 in the MCP env to disable the local token-telemetry log (iframer telemetry reads it). |
IFRAMER_LOCAL_PORT |
No | Base port for the shared local server (default: 3022, loopback only). |
IFRAMER_DATA_DIR |
No | Override the data directory. Default: ~/.iframer. |
IFRAMER_BRIDGE |
No | off makes client.mjs ignore the tab bridge. |
IFRAMER_BRIDGE_TAB |
No | Name of the attached tab to use (tabs attached with --name). |
IFRAMER_BRIDGE_PORT |
No | Tab bridge port (default: 47625, loopback only). |
| Component | Technology |
|---|---|
| Browser engine | patchright (stealth-patched Playwright fork) |
| Browser binary | Chrome for Testing (downloaded to ~/.iframer/chrome/) |
| Local server | One shared warm server per machine (loopback only, discovered via ~/.iframer/server.json), on-disk browser PID registry, idle auto-exit |
| Extension mode | Chrome extension relaying CDP over WebSocket (chrome.debugger → connectOverCDP), drives tabs in your real Chrome |
| Stealth | Fingerprint injection, WebRTC leak prevention, worker patching |
| Credential store | SQLite at ~/.iframer/iframer.db, AES-256-GCM encrypted, shared by every browser mode |
| Session persistence | Same SQLite file, cookies + localStorage re-injected across runs and modes |
| Knowledge cache | Plain markdown at ~/.iframer/knowledge/<domain>.md |
| Captcha solving | Anthropic vision API (@anthropic-ai/sdk) |
| MCP server | @modelcontextprotocol/sdk |
| Runtime | Node.js ≥18 (Bun for development) |
src/lib/ core: pipeline executor, actions, auth, screenshot, knowledge cache
src/mcp/ MCP server + tool definitions
bin/cli.js CLI entry point
extension/ Chrome extension (manifest v3, CDP relay)
docs/example/ the demo in this README: site/ + captured api/
benchmark/ token-cost benchmark harness vs agent-browser and Playwright MCP (gitignored, local only)
- Stealth fingerprinting is injected right after the page loads, not at browser-context creation, so a site checking for it in the first tick of navigation can still catch it. This is the main remaining cause of false bot-blocks.
- The knowledge cache's markdown merge can drop an endpoint's description or example fields when the same domain is captured a second time.
- Consent banners rendered inside a cross-origin iframe (common with some CMPs) aren't recognized as an obstacle yet.
- Element anchors (
remember) still have to be saved by hand after a successful run; auto-saving the selectors that worked isn't wired up. - A few internal modules (the SQLite adapter, the stealth/humanize helpers) still carry loose
anytypes.
git clone https://github.com/EduardoFazolo/iframer-toolkit.git
cd iframer-toolkit
bun install
# Run the CLI from source (no build needed, bun runs .ts directly)
bun run bin/cli.js status
# Run the MCP server from source
bun run src/mcp/server.ts
# Run the local server from source
bun run start # bun run index.ts
# Rebuild the distributable bundles (dist/cli.js, dist/mcp-server.cjs, dist/local-server.cjs)
bun run build
# Use the working tree as the global `iframer` (no publishing): link the dev launcher.
# It rebuilds dist/ and refreshes the kit, the skill and every client.mjs whenever the source changed.
ln -sfn "$PWD" "$(npm prefix -g)/lib/node_modules/iframer-toolkit"
ln -sfn ../lib/node_modules/iframer-toolkit/bin/iframer-dev "$(npm prefix -g)/bin/iframer"prepublishOnly runs bun run build automatically, so npm publish always ships a fresh bundle.
MIT