# Browser automation in Claude Code: add a browser MCP

> Give Claude Code a browser that remembers websites: one command to add the Dejo MCP server, then what to ask.

Canonical: https://dejo.run/docs/claude-code

> 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).

Give Claude Code a browser that remembers websites. The first time Claude does a task on a site, it explores and Dejo learns the route. After that, the same task is one tool call.

You need **Python 3.11 or newer** and Claude Code.

## 1. Install Dejo

```bash
pip install dejo-mcp
playwright install chromium
```

## 2. Add it to Claude Code

```bash
claude mcp add --scope user dejo -- dejo-mcp
```

`--scope user` makes Dejo available in every project. Without it, Claude Code adds the server to the current folder only.

## 3. Check it is connected

```bash
claude mcp list
```

You should see `dejo` with `✔ Connected`. Inside Claude Code, `/mcp` shows the same thing. If it says it failed to connect, run `dejo doctor`: it names anything missing and the command that fixes it.

## 4. Ask for something

Start a new Claude Code session and ask in your own words:

> Go to github.com/microsoft/playwright and tell me how many open issues it has.

Claude calls `dejo_run`. Dejo has never seen the site, so it says so and shows the page. Claude sends the steps in its next `dejo_run` call, and the route is saved when a step reads the answer.

Now start **another** new session and ask the same question. This time `dejo_run` knows the task and returns the answer in one call, with no page reading and no model calls inside Dejo.

## What to use it for

Dejo pays off on website tasks you do more than once:

- checking a number on a dashboard every morning
- downloading this month's invoice from a billing portal
- reading the status of an order, a ticket or a build
- filling the same form with new values

For a one-off look at a single page, Dejo is not cheaper than any other tool. There is nothing to remember yet.

## Sites that need a sign-in

When a site asks you to sign in, Claude calls `dejo_login` and a real browser window opens. You sign in there yourself, then tell Claude you are done. The session is kept, so you do this once per site. See [Signing in](https://dejo.run/docs/sign-in), and [can Claude log in to websites?](https://dejo.run/blog/can-claude-log-in-to-websites) for how this compares with Claude in Chrome and Playwright MCP.

## Settings

Pass settings with `-e` when adding the server. For example, to keep the browser profile in another folder:

```bash
claude mcp add --scope user dejo -e DEJO_PROFILE="$HOME/.dejo/profile-b" -- dejo-mcp
```

To remove Dejo:

```bash
claude mcp remove dejo
```

That removes it from Claude Code only. What Dejo learned stays in `~/.dejo` until you delete it.


## FAQ

## FAQ

### Why --scope user?

Without it, Claude Code adds a server to the current project folder only, and Dejo is missing when you open Claude Code anywhere else. With --scope user, Dejo is there in every project.

### Does Claude Code already have a browser?

Claude Code can fetch web pages with its WebFetch tool, and with claude --chrome it can use your own Chrome through the Claude in Chrome extension. A fetch cannot sign in, click or download, and neither one remembers a task. Dejo gives Claude Code its own browser and remembers each task, so the next run costs one call.

### Can I use Dejo and Playwright MCP together?

Yes. They are separate MCP servers. Dejo's server tells Claude to call dejo_run first for website tasks; you can still ask for the other tool by name.

## Related

- [Dejo MCP server setup: install in a minute](https://dejo.run/docs)
- [Browser automation in Codex: the config.toml setup](https://dejo.run/docs/codex)
- [Cursor browser automation with a browser MCP](https://dejo.run/docs/cursor)
- [Keep your AI agent signed in to websites](https://dejo.run/docs/sign-in)
- [When a website changes: how Dejo replays safely](https://dejo.run/docs/when-the-site-changes)
- [Dejo MCP tools reference](https://dejo.run/docs/tools)
- [Troubleshooting Dejo](https://dejo.run/docs/troubleshooting)
