Metadata-Version: 2.4
Name: browser-director
Version: 0.3.0
Summary: The browser MCP server that operates a site and directs a narrated demo of it
Author-email: Abhinav Nigam <abhinav.nigam86@gmail.com>
License-Expression: MIT
Project-URL: Homepage, https://github.com/abhinav-nigam/agent-browser
Project-URL: Documentation, https://github.com/abhinav-nigam/agent-browser#readme
Project-URL: Repository, https://github.com/abhinav-nigam/agent-browser
Project-URL: Issues, https://github.com/abhinav-nigam/agent-browser/issues
Keywords: browser,automation,playwright,testing,ai,agent,mcp,claude-code,cursor,demo,voiceover,browser-director
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Testing
Classifier: Topic :: Internet :: WWW/HTTP :: Browsers
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: playwright>=1.40.0
Requires-Dist: pillow>=10.0.0
Requires-Dist: mcp<3,>=2
Requires-Dist: pydantic>=2.12.0
Requires-Dist: aiohttp>=3.9.0
Provides-Extra: dev
Requires-Dist: pytest>=7.0.0; extra == "dev"
Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
Requires-Dist: pytest-asyncio; extra == "dev"
Provides-Extra: video
Requires-Dist: openai>=1.0.0; extra == "video"
Requires-Dist: elevenlabs>=1.0.0; extra == "video"
Requires-Dist: mutagen>=1.47.0; extra == "video"
Dynamic: license-file

# browser-director

<!-- mcp-name: io.github.abhinav-nigam/browser-director -->

The browser MCP server that lets an agent operate a site and then direct a narrated demo of it — spotlight, camera zoom, voiceover, and cursor — from one server.

<!-- tool-count: 71 -->

[![PyPI version](https://img.shields.io/pypi/v/browser-director.svg)](https://pypi.org/project/browser-director/)
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
[![Python 3.10+](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/)

The repository is still `abhinav-nigam/agent-browser` until the owner renames it. The installable name is `browser-director`.

## Demo

<!-- Replace this block with a recording that browser-director makes of itself:
     open this README, spotlight the install command, zoom, narrate, render_demo. -->

**Demo video:** not recorded yet. This is the slot for a tour the server produces of itself.

## Install

```bash
pip install browser-director
playwright install chromium
# optional, for generate_voiceover and get_audio_duration
pip install "browser-director[video]"
```

`ffmpeg` is required for `render_demo` and for reading video duration. Voiceover providers need `OPENAI_API_KEY` or `ELEVENLABS_API_KEY`.

The old PyPI name `ai-agent-browser` is a shim that depends on this package and warns. The commands `agent-browser` and `agent-browser-mcp` still run, and they warn. New configs should use the names below.

## Quickstart

Add the server, then ask the agent to open a page and narrate a short tour. Pass `--allow-private` only when the target is localhost or another private address.

### Claude Code

```bash
claude mcp add browser-director -- browser-director-mcp --allow-private
```

### Cursor

`.cursor/mcp.json`:

```json
{
  "mcpServers": {
    "browser-director": {
      "command": "browser-director-mcp",
      "args": ["--allow-private"]
    }
  }
}
```

### Codex

`~/.codex/config.toml`:

```toml
[mcp_servers.browser-director]
command = "browser-director-mcp"
args = ["--allow-private"]
```

### Gemini CLI

`~/.gemini/settings.json`:

```json
{
  "mcpServers": {
    "browser-director": {
      "command": "browser-director-mcp",
      "args": ["--allow-private"]
    }
  }
}
```

Claude Desktop and other MCP clients use the same command and args under `mcpServers`. Config layouts drift; if a client rejects this snippet, point it at `browser-director-mcp` over stdio.

Streamable HTTP is available when a client cannot spawn a process:

```bash
browser-director-mcp --transport streamable-http --host 127.0.0.1 --port 8000
```

That listener has no authentication. Keep it on localhost.

A direct narrated pass, once the server is connected:

1. `goto` the page.
2. `spotlight` the control you want the viewer to see, then `camera_zoom` it.
3. `generate_voiceover` first, so the recording can be paced to the audio.
4. `start_recording`, walk the page with `click` / `type`, then `stop_recording`.
5. `render_demo` to mux the recording, voiceover, and optional music into an MP4.

`get_agent_guide` returns selector syntax and the tool list from the server itself. [AGENT.md](AGENT.md) is the same material for humans.

## What it is, next to the neighbors

| | browser-director | Playwright MCP | Vercel agent-browser | browser-use | Stagehand |
| --- | --- | --- | --- | --- | --- |
| General browser control (navigate, click, type, read) | Yes | Yes | Yes, as a CLI | Yes, inside its own agent loop | Yes, via act / extract / observe |
| MCP server you add to an agent | Yes | Yes | Not this server. A separate, widely used CLI whose name collided with this project's old name | A library, not this kind of server | A library / SDK |
| Direct a narrated demo from the same server (spotlight, camera, cursor, voiceover) | Yes | Basic video recording | No | No | No |
| One call to mux the recording and the narration | `render_demo` | No | No | No | No |

Smaller projects such as playwright-recast and demosmith-mcp produce narrated demos. They are not also a general browser-control server.

## Tools

The server registers **71 tools**. The count in this file is checked against the registered tools in CI (`<!-- tool-count: 71 -->`).

They cover navigation, interaction, waits, extraction, assertions, page state, and the cinematic tools: voiceover, recording, annotations, spotlight, camera, and `render_demo`. `evaluate` runs JavaScript in the page. Treat that as a separate, sharper risk; see below.

## Security

Private-network access is off unless you pass `--allow-private`.

- Schemes other than `http` and `https` are rejected, including `file`, `javascript`, and `data`.
- Hostnames that resolve to loopback, link-local, or private ranges are rejected, including cloud metadata addresses such as `169.254.169.254`.
- URLs with embedded usernames or passwords are rejected.
- Screenshot and export paths have to stay inside the working directory.
- Password fields are masked in `page_state`.

`evaluate` is arbitrary JavaScript in the page's origin. An agent can read DOM state, call endpoints the page can call, and interact with a logged-in session. Private-IP blocking does not make that safe. Do not point the server at an account you would not hand to the agent.

`--allow-private` is for a dev server you intend the agent to open. It is not a sandbox.

`--transport streamable-http` does not authenticate clients. The default bind is `127.0.0.1`.

## CLI

```bash
browser-director start http://localhost:8080
browser-director cmd screenshot home
browser-director stop
browser-director mcp --allow-private
```

`browser-director mcp` is the same server as `browser-director-mcp`. Registry clients that launch the package with `uvx` use the `mcp` subcommand.

## Compatibility shim

`pip install ai-agent-browser` installs `browser-director` plus a deprecated `agent_browser` module that warns and re-exports it. Publish steps for both distributions are in `.github/workflows/publish.yml`.

## License

MIT. See [LICENSE](LICENSE). Author: Abhinav Nigam.
