# Stagehand alternative: Dejo vs Stagehand

> Stagehand is Browserbase's SDK where a model finds elements and caches them on its servers; Dejo is a local browser MCP with no model that replays whole tasks for your agent. Side by side, and when to pick which.

Canonical: https://dejo.run/compare/stagehand
Last updated: 2026-11-13

> For AI agents: the index of this site is https://dejo.run/llms.txt, and every page is also served as markdown (add .md to its address, or send Accept: text/markdown).

**The short answer:** Stagehand is an **SDK** from Browserbase for people writing browser automation as code. Its `act`, `observe` and `extract` calls ask a model to find the element or read the page. Dejo is an **MCP server** with no model: it works under the agent you already use (Claude Code, Codex, Cursor) and remembers each website task, so every run after the first is one tool call with zero model calls. If you are writing browser automation as code, look at Stagehand. If your agent keeps redoing the same website work, look at Dejo.

## Side by side

| | Dejo | Stagehand |
|---|---|---|
| what it is | MCP server for your agent | SDK you call from your code |
| who decides what to click | your agent, writing steps like `click button "Log in"` | a model, from a sentence like `act("click log in")` |
| needs a model API key | no | yes, for `act`, `observe` and `extract` |
| repeat a task without the model | **yes**, the whole task replays with zero model calls | yes, a planned action or a cache hit skips the model |
| where that memory lives | a local SQLite file in `~/.dejo` | v4: Browserbase's servers, on by default (v3's local cache folder was removed) |
| when a selector stops working | stops at the one step that moved; your agent fixes it | `selfHeal: true` (off by default) asks the model again |
| MCP server | yes, local, 5 tools | Browserbase's server: archived repo, hosted, 6 tools, cloud only |
| captchas and bot blocks | stops and hands over to you, by design | Browserbase's stealth and proxy options |
| license | MIT | MIT |
| tokens, our real-site benchmark | 251K first run, 89K after | not measured yet |

The Stagehand column comes from its [README](https://github.com/browserbase/stagehand), [docs](https://docs.stagehand.dev) and source code, read 13 November 2026. Every row, with a link to its source, is in Dejo's [capability list](https://github.com/dejohq/dejo-mcp/blob/main/docs/CAPABILITIES.md#stagehand). Stagehand has not been through our benchmark yet, so there is no token number for it here.

## Two ways to stop paying the model twice

Both projects agree that a model should not decide the same click again on every run. They solve it in different places.

**Stagehand** caches inside its SDK. You write `act("click the login button")`, a model finds the element, and the result can be cached so the next call skips the model. In v4 that cache lives on Browserbase's servers and is on by default. If a cached selector breaks and you turned on `selfHeal`, Stagehand asks the model again.

**Dejo** remembers a whole task. Your agent explores a site once through `dejo_run`, and Dejo saves every step with a check that proves it worked: the page changed, the file arrived, the field holds the value. Every run after, one `dejo_run` call walks the steps in plain code, on your machine. If a step's element is gone, Dejo stops at that step, and your agent fixes that one line.

On our [benchmark](https://dejo.run/benchmark) of 19 tasks on 11 real websites, Dejo's runs after the first averaged 89K tokens against 409K for Playwright MCP, and 17 of the 19 tasks replayed in a single call.


## When Stagehand is the better choice

- **You are writing automation as code.** Stagehand is an SDK with a page API, typed extraction and a schema. Dejo's steps are lines your agent sends, not a library you import.
- **You want a model to find elements from plain English** inside your own program. That is `act` and `observe`. Dejo leaves that to your agent.
- **You run on Browserbase.** Stagehand is built by Browserbase, and its cache, stealth and proxies are part of that cloud.
- **You need typed data from messy pages.** `extract` with a schema hands back structured data that a model read for you.

## When Dejo is the better choice

- **You already use Claude Code, Codex or Cursor** and want them to use websites, with no code to write and no second model bill.
- **The same website work comes back**: a weekly number, a report download, an admin form.
- **You want the memory on your machine.** Trails live in `~/.dejo`, Dejo calls no model and sends nothing to us.
- **You want to know a run really worked.** Every replayed step is checked; a run that cannot prove a step stops instead of handing back a wrong answer.

## Set up Dejo

```bash
pip install dejo-mcp
playwright install chromium
claude mcp add --scope user dejo -- dejo-mcp
```

Then ask your agent for something on a website, in your own words. Other agents: [Codex](https://dejo.run/docs/codex), [Cursor](https://dejo.run/docs/cursor).

More comparisons: [Dejo vs browser-use](https://dejo.run/compare/browser-use), [Playwright MCP alternative](https://dejo.run/compare/playwright-mcp) and [Chrome DevTools MCP vs Playwright MCP](https://dejo.run/compare/chrome-devtools-mcp).

## FAQ

## FAQ

### What is the difference between Stagehand and Dejo?

Stagehand is an SDK from Browserbase: you write code, and its act, observe and extract calls ask a model to find elements and read pages. Dejo has no model. It is an MCP server for the agent you already use, and it remembers each website task so the next run is one tool call with zero model calls.

### Does Stagehand cache actions?

Yes. In Stagehand v4 the cache is server side, on Browserbase, and on by default; the local cache folder from v3 was removed. Dejo keeps every learned task in a local SQLite file in ~/.dejo and replays it on your own machine.

### Is there a Stagehand MCP server?

Browserbase's MCP server uses Stagehand. Its GitHub repo is archived and has the same 6 tools as the hosted server at mcp.browserbase.com; it runs on Browserbase's cloud and needs a model. Dejo's MCP server runs locally and needs no model.

### Can I use Stagehand and Dejo together?

Yes. Stagehand lives in your code and Dejo is an MCP server for your agent, so they do not get in each other's way. Use Stagehand when you are writing an automation as code, and Dejo when your agent does the same website task again and again.

## Related

- [Playwright MCP token usage: measured on 19 real tasks](https://dejo.run/benchmark)
- [Playwright MCP alternative that remembers websites](https://dejo.run/compare/playwright-mcp)
- [Chrome DevTools MCP vs Playwright MCP (measured)](https://dejo.run/compare/chrome-devtools-mcp)
- [Browser Use alternative: Dejo vs browser-use](https://dejo.run/compare/browser-use)
- [Browser MCP alternative: Dejo vs Browser MCP](https://dejo.run/compare/browser-mcp)
- [Dejo vs agent-browser (Vercel), compared](https://dejo.run/compare/agent-browser)
- [Dejo MCP server setup: install in a minute](https://dejo.run/docs)
