Stagehand ships this experimental integration from the repository rather than publishing it as a standalone adapter.
Prerequisites
- Node.js 24 or newer
- pnpm 11.10.0
- An OpenAI API key for the example agent
- A current Google Chrome installation for local browser mode
Quickstart
1
Clone and build Stagehand
2
Configure the Mastra agent
MASTRA_STAGEHAND_MODEL to select another model supported by the example.3
Choose the browser
The example uses local Chrome by default. To use Browserbase instead:
4
Run a browser task
Configuration
Keep the browser session alive
The example creates one MCP client and one facade MCP server for the entire model loop. Preserve that lifetime if you adapt the integration; a new process per tool call starts a new browser. The MCP child receives only Stagehand and Browserbase configuration plus the process values required to launch Node. The host’s model credential remains in the Mastra process.Mastra integration source
Read the MCP client setup, agent prompt, and contract tests.

