Skip to main content
The Deep Agents integration provides two deployment patterns with the same run, snapshot, and screenshot tools.
Stagehand ships this experimental integration from the repository rather than publishing it as a standalone adapter.

Run locally

The local example requires Python 3.11–3.13, uv, a provider credential for the Deep Agent, and a current Google Chrome installation for local browser mode.
1

Clone Stagehand and install the Python projects

2

Configure the agent

Open examples/local/agent.py and edit its model, instruction, and optional Pydantic response_format. Then export the matching model-provider credential:
3

Choose the browser

The MCP server launches visible local Chrome by default. To use Browserbase instead:
Set STAGEHAND_HEADLESS=true to run local Chrome without a visible window.
4

Run the agent

Run agents2.py for a structured-output form-filling example that uses mock data and does not submit the form.

Local server configuration

The server and client use separate Python environments. Stagehand and the current LangGraph SDK require incompatible websockets versions, so stdio keeps their dependency sets isolated.
Keep one persistent MCP ClientSession. Stateless tool loading starts a new stdio process for each call, which loses the browser and snapshot IDs.

Deploy with Managed Deep Agents

The managed example uses native Python tools and Browserbase. It requires a Deep Agents model credential and a Browserbase API key.
1

Install the managed project

2

Configure deployment secrets

Use examples/managed/.env.example as the list of required names and set them through your shell or deployment secret manager. At minimum, configure:Configure DEEPAGENTS_MODEL and its matching provider credential, BROWSERBASE_API_KEY, and either STAGEHAND_API_URL for Model Gateway or STAGEHAND_MODEL with STAGEHAND_MODEL_API_KEY for direct-provider BYOK.
3

Develop and deploy

Browser state remains available while the managed worker is warm. Stagehand does not yet support durable reconnection after a worker replacement.
run executes model-authored JavaScript in the browser. Use Browserbase for untrusted tasks and review the integration security boundary.

Deep Agents integration source

Browse the local MCP server, managed tools, and example agents.