LockerGnomeFor serious tech professionals with a silly side.
Subscribe

Search

Softwareai agentswebmcpjavascriptopen source

Latch is one script tag that hands AI browsers your site's search box, cart button and forms as WebMCP tools

Paste one line and Latch finds your search box, buy buttons, forms and nav, then offers them to AI browsers as WebMCP tools they can call. About 6 KB gzipped, MIT, and it does nothing at all in a browser without WebMCP.

Chris leaning in a small shop doorway, arms folded, watching a dotted cursor path run from the door to a shopping basket on the counter, with a paper tag tied to the basket's handle
Illustration: LockerGnome

The whole install is <script src="https://latch.tools/latch.js" defer></script>, and the pitch on the Latch site is the obvious one: “One line makes your site work inside AI browsers.”

The problem it goes after is real. AI browsers like ChatGPT Atlas and Perplexity Comet, plus Chrome’s WebMCP origin trial and Edge, “can now operate web pages through WebMCP,” the README says, “But out of the box they have to guess at your buttons and forms, and they often fail.” WebMCP is the fix Google is proposing. Chrome’s docs call it “a proposed web standard to help you build and expose structured tools for AI agents,” so instead of an agent squinting at a screenshot of your checkout, your page tells it there’s a tool called add_to_cart and what it takes.

Latch writes that declaration for you. It looks for four things and registers a tool for each one it finds. search_site wants an input with type="search", name="q" or role="searchbox". add_to_cart wants a button. submit_form wants a contact, booking, signup or quote form. navigate wants the links in your <nav> or header. Each tool gets a JSON Schema the agent can read. When the agent calls one, Latch fires the same native input and change events a person’s typing would, then requestSubmit(), “so your existing validation and handlers still run.” Call Latch.inspect() in the console and it shows you the agent’s-eye view of your own page.

Version 0.1.1, the one served today, is 16,836 bytes and 5,527 gzipped, so the “~6 KB” claim holds once it’s compressed. The repo has six commits and, as of this writing, zero stars. Nobody’s name is on the site.

The buy-button finder is the giveaway. It reads the button’s text and checks it against “add to cart,” “add to bag,” “add to basket” or “buy now,” then calls click() on the match. A site whose button says “Add to order” gets no add_to_cart tool at all.

WebMCP itself isn’t settled. Chrome’s origin trial starts in Chrome 149, and the docs say the API is “primarily designed for local browser workflows with a human in the loop,” gated behind a tools Permissions Policy, with a way for a site to ask for a confirmation dialog before a sensitive action. Latch’s own code already carries a fallback for the older navigator.modelContext name, which tells you how fast the target is moving.

That’s what makes a shim like this interesting rather than permanent. If the standard lands, the sites that care will annotate their own forms with the declarative API, and the tag that guessed for them becomes the thing they delete. If it doesn’t land, the 6 KB costs nothing, because Latch is a no-op wherever WebMCP isn’t there. The money side is analytics: add a data-key and it reports which agent tools got called, free for a live view and €19 a month per project for history.

More Software

Every Software story →