Favicon of Stagehand

Stagehand

Open-source browser agent SDK for local Chrome or Browserbase cloud browsers, with natural-language actions and structured extraction. MIT licensed.

Screenshot of Stagehand website

Stagehand is an open-source browser automation SDK for developers building AI agents that interact with websites and extract structured data. It can run with Chrome on your own machine or use Browserbase's cloud browsers. Local runs require Chrome. The project uses the MIT license and supports TypeScript, Python, and Go.

Its natural-language methods let agents act on a page, identify available actions, and extract data into a defined schema. Self-healing actions refresh how they find and interact with page elements when a website changes. Developers can combine these methods with familiar Playwright-style browser controls for clicks, screenshots, and element selection.

Stagehand runs its browser driver as an extension alongside the page to reduce delays between commands and browser actions. It trims the page's accessibility tree to reduce the context an agent sends to its model. Support for nested iframes and closed Shadow DOMs lets agents reach elements inside complex page structures. Batched commands, clipboard access, and WebMCP support cover further browser tasks, while domain allowlists and blocklists control which sites agents can access. OpenTelemetry tracing records their activity.

Browserbase is the hosted route, with persistent browser contexts, session recordings, and server-side caching for repeated actions. Its hosted MCP server also gives Cursor, Codex, and other MCP clients browser actions without a local browser. Separate Fetch and Search capabilities retrieve URL content as Markdown and return web search results without opening a browser session.

Similar to Stagehand