mirror of
https://github.com/hanzoai/python-sdk.git
synced 2026-10-23 20:23:00 +00:00
hanzo-mcp said HELLO as consumer:hanzo-mcp/<pid> to a separate zapd daemon, which the router that replaced it refuses as bad_id. Every process that speaks ZAP now embeds the router (zapd 1.1 on PyPI) and the kernel lock elects one; hanzo-mcp stands for it at startup and takes the seat mcp/hanzo-<pid>. A browser is a browser/<host>/<name> node, found by engine or name and reached with Node.call, and the extension's command codec is unchanged. hanzo-mcp pair prints the code the extension's popup takes. The daemon spawn and socket probing are gone, and so is the zap-proto dependency.
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