Metadata-Version: 2.4
Name: browser-director
Version: 0.4.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/browser-director
Project-URL: Documentation, https://github.com/abhinav-nigam/browser-director#readme
Project-URL: Repository, https://github.com/abhinav-nigam/browser-director
Project-URL: Issues, https://github.com/abhinav-nigam/browser-director/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 -->

[![PyPI](https://img.shields.io/pypi/v/browser-director.svg)](https://pypi.org/project/browser-director/)
[![CI](https://github.com/abhinav-nigam/browser-director/actions/workflows/ci.yml/badge.svg)](https://github.com/abhinav-nigam/browser-director/actions/workflows/ci.yml)
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)

<img src="docs/brand/logo.svg" alt="browser-director" width="320">

Pick this over [Playwright MCP](https://github.com/microsoft/playwright-mcp) or [Vercel agent-browser](https://github.com/vercel-labs/agent-browser) when the agent should both operate the site and direct a narrated demo of it — spotlight, zoom, voiceover, and cursor — from the same server.

<a href="docs/demo/browser-director-demo.mp4"><img src="docs/demo/browser-director-demo.gif" alt="Narrated demo of browser-director on the Wikipedia article for the Model Context Protocol" width="560"></a>

The clip is browser-director on the English Wikipedia article for the Model Context Protocol: search, a ring spotlight on the opening paragraph, a zoom, then a focus spotlight on an infobox row. The mp4 is 50 seconds at 1280×720. The gif is a 13.6 second highlight. The voice is OpenAI tts-1-hd, voice `nova`, mixed with `render_demo`. [MP4](docs/demo/browser-director-demo.mp4).

<!-- tool-count: 35 -->

The GitHub repository is `abhinav-nigam/browser-director`.

## Install

```bash
pip install browser-director
playwright install chromium
```

`ffmpeg` is required for `render_demo`. The Wikipedia demo’s voiceover uses `generate_voiceover(provider="openai", voice="nova")`, which reads `OPENAI_API_KEY`. `media_duration` on an audio file needs mutagen, so install the extra:

```bash
pip install 'browser-director[video]'
```

`uvx browser-director mcp` starts the server from PyPI without a separate install. Version 0.4.0 lists **35 tools**. Older names are available only when `BROWSER_DIRECTOR_LEGACY_TOOLS=1`.

## MCP config

Copy one of these. They all run `uvx browser-director mcp`. Add `--allow-private` to the args only when the agent should open localhost or another private address.

### Claude Desktop

`claude_desktop_config.json`:

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

### Cursor

`.cursor/mcp.json`:

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

### Claude Code

```bash
claude mcp add browser-director -- uvx browser-director mcp
```

## Recipes

Run these from a checkout after `pip install -e .` and `playwright install chromium`. Details are in [examples/README.md](examples/README.md).

| Recipe | |
| --- | --- |
| [Scrape and summarise](examples/recipes/scrape_and_summarise.py) | Read example.com and print the title, first paragraph, and word count. |
| [Form fill](examples/recipes/form_fill.py) | Fill the public httpbin form and check the echo. |
| [Screenshot](examples/recipes/screenshot_page.py) | Save a viewport PNG of example.com. |
| [Narrated demo](examples/recipes/record_narrated_demo.py) | Wikipedia search, ring and focus spotlights, zoom, cursor, OpenAI `nova` (espeak-ng if `OPENAI_API_KEY` is unset), `render_demo`. |

## Comparison

Checked against the Playwright MCP README and the Vercel agent-browser README plus its video-recording notes, in November 2026. "Not documented" means I did not find it there. It is not a claim that the feature can never exist.

| | browser-director | Playwright MCP | Vercel agent-browser |
| --- | --- | --- | --- |
| Drive a browser (open, click, type, read) | Yes | Yes. Tool list in its README. | Yes. Rust CLI; `snapshot` returns refs such as `@e1`. |
| MCP server | Yes. `uvx browser-director mcp`. | Yes. | Yes. Docs say `agent-browser mcp`. |
| Save a video of the session | `recording` with `action` start or stop. | `browser_start_video` / `browser_stop_video`. Also chapter cards and action callouts. | `record start` / `record stop` to webm or mp4. `--cursor` draws a pointer. |
| Spotlight, camera zoom, and a voiceover on that same server | Yes. `spotlight`, `camera` (`action=zoom`), `generate_voiceover` or your own audio, then `render_demo`. | Not in the tool list I read. | Not in the recording docs I read. |

## Tools

The server registers **35 tools**. CI checks this sentence against the registered list (`<!-- tool-count: 35 -->`). Set `BROWSER_DIRECTOR_LEGACY_TOOLS=1` to also list the 0.3 names. Those aliases are removed in 0.5. The mapping is in [docs/plans/0.4-tool-consolidation.md](docs/plans/0.4-tool-consolidation.md).

They cover navigation, interaction, one `wait`, `read`, `assert`, and the demo tools: `spotlight`, `camera`, `recording`, `generate_voiceover`, and `render_demo`. `evaluate` runs JavaScript in the page.

## Security

Private-network access is off unless the server is started with `--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 `169.254.169.254`.
- URLs with embedded usernames or passwords are rejected.
- Screenshot and export paths have to stay inside the working directory.

`evaluate` is arbitrary JavaScript in the page's origin. Private-IP blocking does not make that safe.

## License

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