mirror of
https://github.com/hanzoai/python-sdk.git
synced 2026-10-23 20:23:00 +00:00
In auto mode any extension error fell through to headless Playwright, so a slow page in the user's own browser came back as Playwright's missing executable. A connected browser's failure is now the answer; Playwright stands in only when no browser is on the router. hanzo-tools-browser 0.5.16.
hanzo-tools-browser
Browser tools for Hanzo MCP: browser drives the user's own browser through
the Hanzo extension (headless Playwright when none is connected), playwright
is the same tool pinned to Playwright, and cdp sends a raw DevTools method.
Installation
pip install hanzo-tools-browser
pip install 'hanzo-tools-browser[playwright]' && playwright install chromium # headless fallback
The loop
browser(action="navigate", url="https://example.com")
browser(action="snapshot", interactive=True) # - button "Sign in" [ref=e2]
browser(action="click", selector="@e2")
browser(action="fill", selector="@e3", text="[email protected]")
browser(action="press", key="Enter")
browser(action="read", outline=True) # the page as markdown
browser(action="screenshot", annotate=True) # labels [N] = @eN, with a legend
selector takes a ref from the last snapshot or a CSS selector. A stale ref,
or a click on an element covered by a banner or modal, is refused with what to
do next.
Progressive surface
The schema carries the core actions: navigate, snapshot, click, fill, type,
press, read, screenshot, evaluate, wait, tabs, help. browser(action="help")
lists the rest by topic, and their parameters go in args:
browser(action="select", selector="@e4", args={"value": "Weekly"})
License
MIT