Metadata-Version: 2.4
Name: zenpilot
Version: 0.9.0
Summary: MCP server that lets Claude drive a running Zen Browser over WebDriver BiDi
Keywords: mcp,claude,zen-browser,firefox,webdriver-bidi,browser-automation
Author: beSaif
Author-email: beSaif <hishamkolikara@gmail.com>
License-Expression: MIT
License-File: LICENSE
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Operating System :: MacOS
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Internet :: WWW/HTTP :: Browsers
Requires-Dist: mcp>=2.3,<3
Requires-Dist: websockets>=15,<18
Requires-Python: >=3.12
Project-URL: Homepage, https://github.com/beSaif/zenpilot
Project-URL: Issues, https://github.com/beSaif/zenpilot/issues
Description-Content-Type: text/markdown

<h1>
  <picture>
    <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/beSaif/zenpilot/main/docs/logo-wordmark-dark.svg">
    <img alt="zenpilot" src="https://raw.githubusercontent.com/beSaif/zenpilot/main/docs/logo-wordmark.svg" height="56">
  </picture>
</h1>

<!-- mcp-name: io.github.beSaif/zenpilot -->

[![CI](https://github.com/beSaif/zenpilot/actions/workflows/ci.yml/badge.svg)](https://github.com/beSaif/zenpilot/actions/workflows/ci.yml)
[![PyPI](https://img.shields.io/pypi/v/zenpilot)](https://pypi.org/project/zenpilot/)
[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)

Let Claude use your [Zen browser](https://zen-browser.app). Works with Claude Desktop and
Claude Code, kind of like Claude in Chrome but for Zen. More at
[zenpilot.codesaif.dev](https://zenpilot.codesaif.dev).

![zenpilot demo: Claude fills in a Mozilla job application in Zen from a CV, then stops before Submit](https://raw.githubusercontent.com/beSaif/zenpilot/main/docs/demo.gif)

## Install

### Claude Desktop

Download `zenpilot-<version>.mcpb` from the
[latest release](https://github.com/beSaif/zenpilot/releases/latest) and open it. That's it.

### Claude Code

With [uv](https://docs.astral.sh/uv/) installed, run:

```sh
uv tool install zenpilot
zenpilot setup
```

Setup asks which Zen profile and sites Claude may use, connects zenpilot to Claude Code (and
Claude Desktop, if you have it; restart it afterwards) and opens Zen.

Either way, zenpilot updates itself to the newest release each time Claude starts it. To stay
on one version with uv, install it pinned: `uv tool install zenpilot==0.9.0`.

<details>
<summary>What you need, and Linux notes</summary>

zenpilot is alpha, built and tested on macOS and NixOS (Wayland) with Zen 1.23.

You need Zen in `/Applications` on a Mac, or on Linux on `PATH`, in `/opt/zen`,
`~/.local/share/zen` or as the Flatpak. If zenpilot can't find it on Linux, set `ZENPILOT_ZEN`
to the command that starts it.

**Linux:** popups use `zenity` (or `kdialog`) and `notify-send`. Without them zenpilot can't
ask you, so allow sites ahead of time with `zenpilot allow <site>`. Claude Desktop has no Linux
app, so use Claude Code.

</details>

## Use it

Just ask Claude: *"order a large pizza with bacon on httpbin.org/forms/post for Sam, then submit it"*.

The first time, a few popups may show up. Only you see them, not Claude:

- **Which profile?** `zenpilot` is a fresh profile that isn't logged in to anything. Pick
  your own profile if you want Claude to use sites you're logged into.
- **Restart Zen?** If Zen is already open without remote control, zenpilot offers to restart
  it. Your tabs come back on a Mac; on Linux, tabs you opened in the last few seconds may not.
- **Allow this site?** Choose *Don't Allow*, *Always Allow* or *Allow for 12 Hours*. Enter
  picks *Allow for 12 Hours*; Esc or closing it picks *Don't Allow*. If you miss it, Claude asks
  again next time. After *Don't Allow* it waits 10 minutes, or run `zenpilot allow <site>`.

In the other popups, Enter and Esc pick the safe answer.

While Claude works in a tab, an orange glow goes around the page and a zenpilot badge in the
bottom-left corner says what it's doing. Click its text to see the last few steps. Press
**Pause** and Claude's actions wait until you press **Resume**; it can still read pages
meanwhile. Press **Stop** and Claude stops and asks you what to do. If it tries again anyway,
a popup asks whether to let it continue.

## Staying safe

- **Allowlist.** Claude only works on sites you've allowed. Add one with
  `zenpilot allow github.com`.
- **Stick to the `zenpilot` profile if you can.** It's logged out of everything. On your main
  profile, a shady page could try to trick Claude into doing stuff in your accounts, so only
  allow sites you trust.
- **Read-only mode.** Set `read_only = true` and Claude can look but not click, type or resize
  the page.
- **Log.** Everything Claude does is written to `~/.local/state/zenpilot/audit.jsonl`, with
  what it clicked. Typed text isn't logged, only its length. `zenpilot log` shows it as a timeline.
- **Remote control is open while Zen runs this way.** Other apps on your computer could connect
  to it too, and some sites (banks, Cloudflare checks) may think you're a bot. Some CAPTCHAs
  (hCaptcha, as on Lever job forms) fail however well you solve them; use another browser for
  those. When you're done, quit Zen and open it normally.
- **Zen keeps its protections.** Remote control would switch off Safe Browsing, the popup
  blocker and so on. zenpilot keeps them on.

## What Claude can do

- **Browse:** open, switch and close tabs; go to a URL, back, forward or reload; read the
  page or one part of it; find a control or some text; scroll; wait for text, a URL or a quiet
  network; take screenshots.
- **Act:** click (double and right click too), type, fill in a whole form, pick from dropdowns,
  hover, drag and drop, press keys and answer a page's alerts and prompts. It can upload files,
  but only from folders you list in `upload_dirs`. Claude is told when a click starts a download,
but zenpilot never opens or moves the file.
- **Debug:** read console errors and network requests with their responses, save them as a HAR
  file in `~/.local/state/zenpilot/har/`, and resize a tab's page to check phone and tablet
  layouts (your window keeps its size). With `allow_request_mocking = true`, it can make a
  request to one exact URL fail or return stub data.

Network requests are only recorded on sites you've allowed, kept in memory and stripped of
cookie and authorization headers. Mocking only works on allowed sites and ends when zenpilot
disconnects. Claude can't read cookies or passwords, and, unless mocking is on, it can't put
its own JavaScript in a page.

## When it gets stuck

zenpilot is far from perfect, and every site is different. When Claude can't do something
(say, draw on a canvas), it notes what it tried. zenpilot also notes tool calls that failed or
took over 5 seconds. If anything went wrong, a notification at the end of the session points
you to a report in `~/.local/state/zenpilot/reports/`.

```sh
zenpilot report           # show the latest report
zenpilot report --issue   # open a GitHub issue with it filled in
```

What you typed and the pages' text stay out of it, Claude is asked to leave out personal data,
and URLs lose their `?query` part. Still, read it before you submit.

## Commands

| Command | What it does |
|---|---|
| `zenpilot setup` | Set everything up (see above) |
| `zenpilot allow [site...]` | Allow sites. `--remove` takes them off (12-hour ones too). No sites lists them. |
| `zenpilot launch` | Open Zen with remote control on |
| `zenpilot doctor` | Check your setup and say how to fix anything that's broken. `--json` for scripts. |
| `zenpilot config` | Show or change settings: `path`, `get [key]`, `set key value`, `edit` |
| `zenpilot report` | Show the latest session report. `--issue` files it on GitHub, `--list` lists them all. |
| `zenpilot log` | Show what Claude did lately. `-n 200` for more, `--errors` for failures only |
| `zenpilot uninstall` | Undo setup (see [Uninstall](#uninstall)) |
| `zenpilot --version` | Show which version you have |

## Settings

They live in `~/.config/zenpilot/config.toml`, and changes apply right away. The easy way to
change one is `zenpilot config set read_only true`. See
[all settings](https://github.com/beSaif/zenpilot/blob/main/docs/configuration.md).

In Claude Desktop, the extension's settings screen has **Allowed sites**, **Read-only mode**
and **Upload folders**. They add to what's in `config.toml`.

## Good to know

- There's no browser extension. zenpilot opens Zen with its remote control turned on and
  talks to it directly.
- Only one Claude can drive Zen at a time. zenpilot lets go after 2 minutes of doing
  nothing, so Claude Desktop and Claude Code can take turns.
- Zen can be hidden or behind other windows. It still works.
- Zen loads restored tabs lazily, so Claude only sees an old tab once you've opened it.
- Stuck? Run `zenpilot doctor`. If Zen says it already has a session after a crash, restart Zen.

## Uninstall

```sh
zenpilot uninstall
uv tool uninstall zenpilot
```

`zenpilot uninstall` disconnects zenpilot from Claude Code and Claude Desktop and takes its
settings out of your Zen profile. It asks first (`--yes` skips that). `--purge` also deletes your zenpilot settings,
log and reports; `--delete-profile` deletes the `zenpilot` Zen profile.

In Claude Desktop, remove the extension in Settings → Extensions.

## Hacking on it

Setup and test commands are in [docs/dev/hacking.md](https://github.com/beSaif/zenpilot/blob/main/docs/dev/hacking.md).

## License

[MIT](LICENSE)
