LeanTab

Let AI agents read and operate your real Chrome as compact text: every frame, refs to click, diffs after each action.

Documentação

LeanTab logo

LeanTab

npm MCP Registry License: MIT

Let your AI use your browser for you, as lean text instead of screenshots.

LeanTab is a Chrome extension plus a small local MCP server. Together they let an AI agent (Claude, or any MCP client) read and operate the web pages you choose, in your real Chrome. It gets your logins and tabs, and it sees every frame of the page, as compact text instead of screenshots.

Why

Before AI agents, doing a task across a few web apps meant you: open the tab, find the field, copy, paste, click Save, check it worked, repeat. Browser automation scripts helped, but they broke whenever a page changed.

AI agents can now do that work. Screenshot-driven agents pay for an image after every click, and many page readers see only the top frame, which misses the iframes where many business apps keep their actual forms and reports.

LeanTab gives the agent a lean, structured text view of the whole page, every frame included, in the Chrome you already use:

# Order entry | https://app.example.com/orders/new | tab 12 | 3 frames
[nav "Main menu"]
 - [e1 link "Dashboard"]
 - [e2 link "Orders"]
[frame f2 "New order" app.example.com]
 Customer | [f2e1 input]
 Ship date | [f2e2 input ="12/04/2026"]
 Status | [f2e3 select ="Draft" opts:Draft / Open / Closed]
 [f2e4 btn "Save"] [f2e5 btn "Cancel"]

The agent acts on refs (f2e1 is element 1 in frame 2), and each action returns only what changed:

act fill f2e1 "Rivera Plumbing", click f2e4
step 1 fill f2e1: ok
step 2 click f2e4: ok
changes (1 added, 1 removed):
- Status | [f2e3 select ="Draft" ...]
+ Status | [f2e3 select ="Open" ...]
+ [role=status "Order 1042 saved"]

No screenshot was needed to know the save worked.

Measured: on an app-style page, one LeanTab view was about 10× smaller than one screenshot, and the result of an action came back in about 70 tokens. On long reading pages a full text snapshot can cost more than a screenshot. See bench/RESULTS.md for the method, all five pages, and the script to measure your own.

What it does

Every frame, one viewA content script runs in each frame, including cross-origin, nested and about:blank frames. The results are stitched into one tree in page order.
Diffs, not re-readsact returns the lines that changed, usually a handful.
Batch stepsFill a whole form and click Save in one call with steps.
Pop-up dialogs handledconfirm() and alert() raised during an action are answered and reported instead of freezing the agent.
Big tablestable pages rows as CSV, and find searches every frame, even rows the snapshot left out.
Your browser, your loginsIt works in the Chrome you already use. No separate headless browser, and no passwords handed to anyone.
Many agents, one browserSeveral MCP clients can share one browser. Each agent keeps its own tab, and commands on a tab run one at a time.

Safety model

LeanTab gives software control of a logged-in browser, so it is strict about who can connect. It is also honest about what it can't stop.

What LeanTab enforces

  • Paired, not open. The server and extension share a secret pairing code. Every connection proves it holds the code (an HMAC challenge in both directions) before any command runs. Web pages and other extensions can't connect. Programs running as your own user account can read the code file, as with any local secret.
  • Local only. The server listens on 127.0.0.1, checks the Host header, limits message sizes and drops unauthenticated connections after 3 seconds.
  • You approve every upload. Upload is off until you list allowed folders (LEANTAB_UPLOAD_ROOTS). Each upload then opens a window showing the file and the destination site, and only a real click on Allow sends it, or mark a site as trusted from the approval window; trusted sites (listed and removable in the popup) upload from your allowed folders without asking. Agents can't read or click LeanTab's own windows.
  • Nothing injected while idle. LeanTab adds nothing to pages until an agent sends a command. Dialog handling exists only for the length of an action.
  • One tab per agent. Each agent session works in its own pinned tab. If that tab is closed, the agent gets an error instead of falling through to whatever tab you're looking at.
  • http(s) only. Agents can't open or act on file://, chrome:// or extension pages.
  • Stale refs fail. A ref from a page that has since changed is refused, never re-aimed at a different element.

What LeanTab reduces, but can't guarantee

  • Sensitive fields are masked in text views: password, card, one-time-code and similar fields, detected by type, autocomplete, name and label. Detection is heuristic, and screenshots show whatever is on screen.
  • Page text is labeled untrusted. Every tool result is wrapped in a marked block, telling the agent not to follow instructions inside it. Common hidden-text tricks are dropped, and page text can't imitate LeanTab's own control lines. This lowers the risk of prompt injection; it does not remove it.
  • Query strings are stripped from the URLs LeanTab prints, so tokens in links don't reach the model.

What only you and your AI client can control

  • The agent acts as you, on sites where you're logged in. It can click "Send", "Pay" or "Delete", and it can navigate to any http(s) site. Use your client's tool-approval prompts for actions that matter.
  • Anything the agent reads is sent to your AI provider under its terms. LeanTab itself has no servers, analytics or accounts, and sends nothing to its author.

Install

Requires Chrome 116 or newer and Node.js 18 or newer.

  1. Extension. Install LeanTab from the Chrome Web Store. Or, from source: open chrome://extensions, turn on Developer mode, click "Load unpacked" and pick the extension folder.
  2. Server. Add it to your MCP client. For Claude Code:
    claude mcp add leantab -- npx -y leantab-mcp@0.2.1
    
    For Claude Desktop or another client, use the command npx with the args ["-y", "leantab-mcp@0.2.1"].
  3. Pair them. Run npx leantab-mcp pair, copy the LT-... code, open the LeanTab popup, paste it and click Save. Then click Allow LeanTab on all sites. LeanTab only touches a page when your agent sends a command.
  4. Try it. Open any page and ask your agent: "Use LeanTab to snapshot this page and tell me what's on it."

To allow uploads, set LEANTAB_UPLOAD_ROOTS to the folders the agent may upload from, separated by ; on Windows or : elsewhere, for example C:\Users\you\Pictures\to-upload.

Tools

ToolUse
snapshotCompact view of the page. mode=interactive (controls only, cheapest), full (default) or text. Takes scope=<ref>, frame=<id>, maxRows, maxChars.
actclick, fill, type, select, check, uncheck, press, hover, focus, clear, scroll. Batch with steps. Returns a diff.
uploadAttach a file from an allowed folder to an upload field, after your approval.
findSearch every frame for text.
tablePage through any table as CSV or JSON.
navigateURL, back, forward or reload. Waits for frames to finish loading.
wait_forWait for text to appear or disappear.
tabs_listList open http(s) tabs.
tabsOpen, select or close a tab.
framesThe frame tree (rarely needed).
screenshotLast resort. ref=<element> crops to one element, even inside nested frames.

Known limits

  • Clicks and keys are synthetic events. Nearly all web apps accept them, but a page that insists on a real user gesture, such as opening a native file picker, needs a human click or the upload tool.
  • Closed shadow DOM, canvas-drawn content and PDFs inside frames can't be read as text.
  • "Leave site?" prompts can't be answered automatically.
  • Refs belong to one version of a page. After the page changes, take a new snapshot.
  • Very long text lines and table cells are cut, and marked with how much was cut.
  • Native dialogs raised in an iframe created during an action aren't intercepted.

Author

Made by Alex Estrella. Issues and ideas are welcome.

LeanTab is an independent project. It is not affiliated with or endorsed by Google or Anthropic. Chrome is a trademark of Google LLC.

License

MIT