browser-director 0.3.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- browser_director-0.3.0/LICENSE +21 -0
- browser_director-0.3.0/PKG-INFO +195 -0
- browser_director-0.3.0/README.md +155 -0
- browser_director-0.3.0/pyproject.toml +109 -0
- browser_director-0.3.0/setup.cfg +4 -0
- browser_director-0.3.0/src/browser_director/__init__.py +33 -0
- browser_director-0.3.0/src/browser_director/cinematic/__init__.py +205 -0
- browser_director-0.3.0/src/browser_director/cinematic/annotations.py +268 -0
- browser_director-0.3.0/src/browser_director/cinematic/camera.py +223 -0
- browser_director-0.3.0/src/browser_director/cinematic/polish.py +379 -0
- browser_director-0.3.0/src/browser_director/cinematic/postproduction.py +746 -0
- browser_director-0.3.0/src/browser_director/cinematic/recording.py +308 -0
- browser_director-0.3.0/src/browser_director/cinematic/scripts.py +350 -0
- browser_director-0.3.0/src/browser_director/cinematic/tts.py +221 -0
- browser_director-0.3.0/src/browser_director/driver.py +866 -0
- browser_director-0.3.0/src/browser_director/interactive.py +229 -0
- browser_director-0.3.0/src/browser_director/legacy.py +28 -0
- browser_director-0.3.0/src/browser_director/main.py +208 -0
- browser_director-0.3.0/src/browser_director/mcp.py +2672 -0
- browser_director-0.3.0/src/browser_director/registry.py +47 -0
- browser_director-0.3.0/src/browser_director/results.py +24 -0
- browser_director-0.3.0/src/browser_director/utils.py +331 -0
- browser_director-0.3.0/src/browser_director/version.py +3 -0
- browser_director-0.3.0/src/browser_director.egg-info/PKG-INFO +195 -0
- browser_director-0.3.0/src/browser_director.egg-info/SOURCES.txt +32 -0
- browser_director-0.3.0/src/browser_director.egg-info/dependency_links.txt +1 -0
- browser_director-0.3.0/src/browser_director.egg-info/entry_points.txt +5 -0
- browser_director-0.3.0/src/browser_director.egg-info/requires.txt +15 -0
- browser_director-0.3.0/src/browser_director.egg-info/top_level.txt +1 -0
- browser_director-0.3.0/tests/test_driver.py +58 -0
- browser_director-0.3.0/tests/test_mcp.py +1289 -0
- browser_director-0.3.0/tests/test_render_and_compat.py +66 -0
- browser_director-0.3.0/tests/test_stdio_client.py +49 -0
- browser_director-0.3.0/tests/test_utils.py +171 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Agent Browser Contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: browser-director
|
|
3
|
+
Version: 0.3.0
|
|
4
|
+
Summary: The browser MCP server that operates a site and directs a narrated demo of it
|
|
5
|
+
Author-email: Abhinav Nigam <abhinav.nigam86@gmail.com>
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/abhinav-nigam/agent-browser
|
|
8
|
+
Project-URL: Documentation, https://github.com/abhinav-nigam/agent-browser#readme
|
|
9
|
+
Project-URL: Repository, https://github.com/abhinav-nigam/agent-browser
|
|
10
|
+
Project-URL: Issues, https://github.com/abhinav-nigam/agent-browser/issues
|
|
11
|
+
Keywords: browser,automation,playwright,testing,ai,agent,mcp,claude-code,cursor,demo,voiceover,browser-director
|
|
12
|
+
Classifier: Development Status :: 4 - Beta
|
|
13
|
+
Classifier: Environment :: Console
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: Operating System :: OS Independent
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
21
|
+
Classifier: Topic :: Software Development :: Testing
|
|
22
|
+
Classifier: Topic :: Internet :: WWW/HTTP :: Browsers
|
|
23
|
+
Requires-Python: >=3.10
|
|
24
|
+
Description-Content-Type: text/markdown
|
|
25
|
+
License-File: LICENSE
|
|
26
|
+
Requires-Dist: playwright>=1.40.0
|
|
27
|
+
Requires-Dist: pillow>=10.0.0
|
|
28
|
+
Requires-Dist: mcp<3,>=2
|
|
29
|
+
Requires-Dist: pydantic>=2.12.0
|
|
30
|
+
Requires-Dist: aiohttp>=3.9.0
|
|
31
|
+
Provides-Extra: dev
|
|
32
|
+
Requires-Dist: pytest>=7.0.0; extra == "dev"
|
|
33
|
+
Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
|
|
34
|
+
Requires-Dist: pytest-asyncio; extra == "dev"
|
|
35
|
+
Provides-Extra: video
|
|
36
|
+
Requires-Dist: openai>=1.0.0; extra == "video"
|
|
37
|
+
Requires-Dist: elevenlabs>=1.0.0; extra == "video"
|
|
38
|
+
Requires-Dist: mutagen>=1.47.0; extra == "video"
|
|
39
|
+
Dynamic: license-file
|
|
40
|
+
|
|
41
|
+
# browser-director
|
|
42
|
+
|
|
43
|
+
<!-- mcp-name: io.github.abhinav-nigam/browser-director -->
|
|
44
|
+
|
|
45
|
+
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.
|
|
46
|
+
|
|
47
|
+
<!-- tool-count: 71 -->
|
|
48
|
+
|
|
49
|
+
[](https://pypi.org/project/browser-director/)
|
|
50
|
+
[](https://opensource.org/licenses/MIT)
|
|
51
|
+
[](https://www.python.org/downloads/)
|
|
52
|
+
|
|
53
|
+
The repository is still `abhinav-nigam/agent-browser` until the owner renames it. The installable name is `browser-director`.
|
|
54
|
+
|
|
55
|
+
## Demo
|
|
56
|
+
|
|
57
|
+
<!-- Replace this block with a recording that browser-director makes of itself:
|
|
58
|
+
open this README, spotlight the install command, zoom, narrate, render_demo. -->
|
|
59
|
+
|
|
60
|
+
**Demo video:** not recorded yet. This is the slot for a tour the server produces of itself.
|
|
61
|
+
|
|
62
|
+
## Install
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
pip install browser-director
|
|
66
|
+
playwright install chromium
|
|
67
|
+
# optional, for generate_voiceover and get_audio_duration
|
|
68
|
+
pip install "browser-director[video]"
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
`ffmpeg` is required for `render_demo` and for reading video duration. Voiceover providers need `OPENAI_API_KEY` or `ELEVENLABS_API_KEY`.
|
|
72
|
+
|
|
73
|
+
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.
|
|
74
|
+
|
|
75
|
+
## Quickstart
|
|
76
|
+
|
|
77
|
+
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.
|
|
78
|
+
|
|
79
|
+
### Claude Code
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
claude mcp add browser-director -- browser-director-mcp --allow-private
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### Cursor
|
|
86
|
+
|
|
87
|
+
`.cursor/mcp.json`:
|
|
88
|
+
|
|
89
|
+
```json
|
|
90
|
+
{
|
|
91
|
+
"mcpServers": {
|
|
92
|
+
"browser-director": {
|
|
93
|
+
"command": "browser-director-mcp",
|
|
94
|
+
"args": ["--allow-private"]
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### Codex
|
|
101
|
+
|
|
102
|
+
`~/.codex/config.toml`:
|
|
103
|
+
|
|
104
|
+
```toml
|
|
105
|
+
[mcp_servers.browser-director]
|
|
106
|
+
command = "browser-director-mcp"
|
|
107
|
+
args = ["--allow-private"]
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
### Gemini CLI
|
|
111
|
+
|
|
112
|
+
`~/.gemini/settings.json`:
|
|
113
|
+
|
|
114
|
+
```json
|
|
115
|
+
{
|
|
116
|
+
"mcpServers": {
|
|
117
|
+
"browser-director": {
|
|
118
|
+
"command": "browser-director-mcp",
|
|
119
|
+
"args": ["--allow-private"]
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
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.
|
|
126
|
+
|
|
127
|
+
Streamable HTTP is available when a client cannot spawn a process:
|
|
128
|
+
|
|
129
|
+
```bash
|
|
130
|
+
browser-director-mcp --transport streamable-http --host 127.0.0.1 --port 8000
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
That listener has no authentication. Keep it on localhost.
|
|
134
|
+
|
|
135
|
+
A direct narrated pass, once the server is connected:
|
|
136
|
+
|
|
137
|
+
1. `goto` the page.
|
|
138
|
+
2. `spotlight` the control you want the viewer to see, then `camera_zoom` it.
|
|
139
|
+
3. `generate_voiceover` first, so the recording can be paced to the audio.
|
|
140
|
+
4. `start_recording`, walk the page with `click` / `type`, then `stop_recording`.
|
|
141
|
+
5. `render_demo` to mux the recording, voiceover, and optional music into an MP4.
|
|
142
|
+
|
|
143
|
+
`get_agent_guide` returns selector syntax and the tool list from the server itself. [AGENT.md](AGENT.md) is the same material for humans.
|
|
144
|
+
|
|
145
|
+
## What it is, next to the neighbors
|
|
146
|
+
|
|
147
|
+
| | browser-director | Playwright MCP | Vercel agent-browser | browser-use | Stagehand |
|
|
148
|
+
| --- | --- | --- | --- | --- | --- |
|
|
149
|
+
| General browser control (navigate, click, type, read) | Yes | Yes | Yes, as a CLI | Yes, inside its own agent loop | Yes, via act / extract / observe |
|
|
150
|
+
| 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 |
|
|
151
|
+
| Direct a narrated demo from the same server (spotlight, camera, cursor, voiceover) | Yes | Basic video recording | No | No | No |
|
|
152
|
+
| One call to mux the recording and the narration | `render_demo` | No | No | No | No |
|
|
153
|
+
|
|
154
|
+
Smaller projects such as playwright-recast and demosmith-mcp produce narrated demos. They are not also a general browser-control server.
|
|
155
|
+
|
|
156
|
+
## Tools
|
|
157
|
+
|
|
158
|
+
The server registers **71 tools**. The count in this file is checked against the registered tools in CI (`<!-- tool-count: 71 -->`).
|
|
159
|
+
|
|
160
|
+
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.
|
|
161
|
+
|
|
162
|
+
## Security
|
|
163
|
+
|
|
164
|
+
Private-network access is off unless you pass `--allow-private`.
|
|
165
|
+
|
|
166
|
+
- Schemes other than `http` and `https` are rejected, including `file`, `javascript`, and `data`.
|
|
167
|
+
- Hostnames that resolve to loopback, link-local, or private ranges are rejected, including cloud metadata addresses such as `169.254.169.254`.
|
|
168
|
+
- URLs with embedded usernames or passwords are rejected.
|
|
169
|
+
- Screenshot and export paths have to stay inside the working directory.
|
|
170
|
+
- Password fields are masked in `page_state`.
|
|
171
|
+
|
|
172
|
+
`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.
|
|
173
|
+
|
|
174
|
+
`--allow-private` is for a dev server you intend the agent to open. It is not a sandbox.
|
|
175
|
+
|
|
176
|
+
`--transport streamable-http` does not authenticate clients. The default bind is `127.0.0.1`.
|
|
177
|
+
|
|
178
|
+
## CLI
|
|
179
|
+
|
|
180
|
+
```bash
|
|
181
|
+
browser-director start http://localhost:8080
|
|
182
|
+
browser-director cmd screenshot home
|
|
183
|
+
browser-director stop
|
|
184
|
+
browser-director mcp --allow-private
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
`browser-director mcp` is the same server as `browser-director-mcp`. Registry clients that launch the package with `uvx` use the `mcp` subcommand.
|
|
188
|
+
|
|
189
|
+
## Compatibility shim
|
|
190
|
+
|
|
191
|
+
`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`.
|
|
192
|
+
|
|
193
|
+
## License
|
|
194
|
+
|
|
195
|
+
MIT. See [LICENSE](LICENSE). Author: Abhinav Nigam.
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
# browser-director
|
|
2
|
+
|
|
3
|
+
<!-- mcp-name: io.github.abhinav-nigam/browser-director -->
|
|
4
|
+
|
|
5
|
+
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.
|
|
6
|
+
|
|
7
|
+
<!-- tool-count: 71 -->
|
|
8
|
+
|
|
9
|
+
[](https://pypi.org/project/browser-director/)
|
|
10
|
+
[](https://opensource.org/licenses/MIT)
|
|
11
|
+
[](https://www.python.org/downloads/)
|
|
12
|
+
|
|
13
|
+
The repository is still `abhinav-nigam/agent-browser` until the owner renames it. The installable name is `browser-director`.
|
|
14
|
+
|
|
15
|
+
## Demo
|
|
16
|
+
|
|
17
|
+
<!-- Replace this block with a recording that browser-director makes of itself:
|
|
18
|
+
open this README, spotlight the install command, zoom, narrate, render_demo. -->
|
|
19
|
+
|
|
20
|
+
**Demo video:** not recorded yet. This is the slot for a tour the server produces of itself.
|
|
21
|
+
|
|
22
|
+
## Install
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
pip install browser-director
|
|
26
|
+
playwright install chromium
|
|
27
|
+
# optional, for generate_voiceover and get_audio_duration
|
|
28
|
+
pip install "browser-director[video]"
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
`ffmpeg` is required for `render_demo` and for reading video duration. Voiceover providers need `OPENAI_API_KEY` or `ELEVENLABS_API_KEY`.
|
|
32
|
+
|
|
33
|
+
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.
|
|
34
|
+
|
|
35
|
+
## Quickstart
|
|
36
|
+
|
|
37
|
+
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.
|
|
38
|
+
|
|
39
|
+
### Claude Code
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
claude mcp add browser-director -- browser-director-mcp --allow-private
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### Cursor
|
|
46
|
+
|
|
47
|
+
`.cursor/mcp.json`:
|
|
48
|
+
|
|
49
|
+
```json
|
|
50
|
+
{
|
|
51
|
+
"mcpServers": {
|
|
52
|
+
"browser-director": {
|
|
53
|
+
"command": "browser-director-mcp",
|
|
54
|
+
"args": ["--allow-private"]
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### Codex
|
|
61
|
+
|
|
62
|
+
`~/.codex/config.toml`:
|
|
63
|
+
|
|
64
|
+
```toml
|
|
65
|
+
[mcp_servers.browser-director]
|
|
66
|
+
command = "browser-director-mcp"
|
|
67
|
+
args = ["--allow-private"]
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### Gemini CLI
|
|
71
|
+
|
|
72
|
+
`~/.gemini/settings.json`:
|
|
73
|
+
|
|
74
|
+
```json
|
|
75
|
+
{
|
|
76
|
+
"mcpServers": {
|
|
77
|
+
"browser-director": {
|
|
78
|
+
"command": "browser-director-mcp",
|
|
79
|
+
"args": ["--allow-private"]
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
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.
|
|
86
|
+
|
|
87
|
+
Streamable HTTP is available when a client cannot spawn a process:
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
browser-director-mcp --transport streamable-http --host 127.0.0.1 --port 8000
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
That listener has no authentication. Keep it on localhost.
|
|
94
|
+
|
|
95
|
+
A direct narrated pass, once the server is connected:
|
|
96
|
+
|
|
97
|
+
1. `goto` the page.
|
|
98
|
+
2. `spotlight` the control you want the viewer to see, then `camera_zoom` it.
|
|
99
|
+
3. `generate_voiceover` first, so the recording can be paced to the audio.
|
|
100
|
+
4. `start_recording`, walk the page with `click` / `type`, then `stop_recording`.
|
|
101
|
+
5. `render_demo` to mux the recording, voiceover, and optional music into an MP4.
|
|
102
|
+
|
|
103
|
+
`get_agent_guide` returns selector syntax and the tool list from the server itself. [AGENT.md](AGENT.md) is the same material for humans.
|
|
104
|
+
|
|
105
|
+
## What it is, next to the neighbors
|
|
106
|
+
|
|
107
|
+
| | browser-director | Playwright MCP | Vercel agent-browser | browser-use | Stagehand |
|
|
108
|
+
| --- | --- | --- | --- | --- | --- |
|
|
109
|
+
| General browser control (navigate, click, type, read) | Yes | Yes | Yes, as a CLI | Yes, inside its own agent loop | Yes, via act / extract / observe |
|
|
110
|
+
| 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 |
|
|
111
|
+
| Direct a narrated demo from the same server (spotlight, camera, cursor, voiceover) | Yes | Basic video recording | No | No | No |
|
|
112
|
+
| One call to mux the recording and the narration | `render_demo` | No | No | No | No |
|
|
113
|
+
|
|
114
|
+
Smaller projects such as playwright-recast and demosmith-mcp produce narrated demos. They are not also a general browser-control server.
|
|
115
|
+
|
|
116
|
+
## Tools
|
|
117
|
+
|
|
118
|
+
The server registers **71 tools**. The count in this file is checked against the registered tools in CI (`<!-- tool-count: 71 -->`).
|
|
119
|
+
|
|
120
|
+
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.
|
|
121
|
+
|
|
122
|
+
## Security
|
|
123
|
+
|
|
124
|
+
Private-network access is off unless you pass `--allow-private`.
|
|
125
|
+
|
|
126
|
+
- Schemes other than `http` and `https` are rejected, including `file`, `javascript`, and `data`.
|
|
127
|
+
- Hostnames that resolve to loopback, link-local, or private ranges are rejected, including cloud metadata addresses such as `169.254.169.254`.
|
|
128
|
+
- URLs with embedded usernames or passwords are rejected.
|
|
129
|
+
- Screenshot and export paths have to stay inside the working directory.
|
|
130
|
+
- Password fields are masked in `page_state`.
|
|
131
|
+
|
|
132
|
+
`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.
|
|
133
|
+
|
|
134
|
+
`--allow-private` is for a dev server you intend the agent to open. It is not a sandbox.
|
|
135
|
+
|
|
136
|
+
`--transport streamable-http` does not authenticate clients. The default bind is `127.0.0.1`.
|
|
137
|
+
|
|
138
|
+
## CLI
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
browser-director start http://localhost:8080
|
|
142
|
+
browser-director cmd screenshot home
|
|
143
|
+
browser-director stop
|
|
144
|
+
browser-director mcp --allow-private
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
`browser-director mcp` is the same server as `browser-director-mcp`. Registry clients that launch the package with `uvx` use the `mcp` subcommand.
|
|
148
|
+
|
|
149
|
+
## Compatibility shim
|
|
150
|
+
|
|
151
|
+
`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`.
|
|
152
|
+
|
|
153
|
+
## License
|
|
154
|
+
|
|
155
|
+
MIT. See [LICENSE](LICENSE). Author: Abhinav Nigam.
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=77", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "browser-director"
|
|
7
|
+
version = "0.3.0"
|
|
8
|
+
description = "The browser MCP server that operates a site and directs a narrated demo of it"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = "MIT"
|
|
11
|
+
license-files = ["LICENSE"]
|
|
12
|
+
requires-python = ">=3.10"
|
|
13
|
+
authors = [
|
|
14
|
+
{name = "Abhinav Nigam", email = "abhinav.nigam86@gmail.com"}
|
|
15
|
+
]
|
|
16
|
+
keywords = [
|
|
17
|
+
"browser",
|
|
18
|
+
"automation",
|
|
19
|
+
"playwright",
|
|
20
|
+
"testing",
|
|
21
|
+
"ai",
|
|
22
|
+
"agent",
|
|
23
|
+
"mcp",
|
|
24
|
+
"claude-code",
|
|
25
|
+
"cursor",
|
|
26
|
+
"demo",
|
|
27
|
+
"voiceover",
|
|
28
|
+
"browser-director",
|
|
29
|
+
]
|
|
30
|
+
classifiers = [
|
|
31
|
+
"Development Status :: 4 - Beta",
|
|
32
|
+
"Environment :: Console",
|
|
33
|
+
"Intended Audience :: Developers",
|
|
34
|
+
"Operating System :: OS Independent",
|
|
35
|
+
"Programming Language :: Python :: 3",
|
|
36
|
+
"Programming Language :: Python :: 3.10",
|
|
37
|
+
"Programming Language :: Python :: 3.11",
|
|
38
|
+
"Programming Language :: Python :: 3.12",
|
|
39
|
+
"Programming Language :: Python :: 3.13",
|
|
40
|
+
"Topic :: Software Development :: Testing",
|
|
41
|
+
"Topic :: Internet :: WWW/HTTP :: Browsers",
|
|
42
|
+
]
|
|
43
|
+
|
|
44
|
+
dependencies = [
|
|
45
|
+
"playwright>=1.40.0",
|
|
46
|
+
"pillow>=10.0.0",
|
|
47
|
+
# MCP Python SDK 2.x. FastMCP was renamed to MCPServer; 1.x no longer matches this code.
|
|
48
|
+
"mcp>=2,<3",
|
|
49
|
+
"pydantic>=2.12.0",
|
|
50
|
+
"aiohttp>=3.9.0",
|
|
51
|
+
]
|
|
52
|
+
|
|
53
|
+
[project.optional-dependencies]
|
|
54
|
+
dev = [
|
|
55
|
+
"pytest>=7.0.0",
|
|
56
|
+
"pytest-cov>=4.0.0",
|
|
57
|
+
"pytest-asyncio",
|
|
58
|
+
]
|
|
59
|
+
video = [
|
|
60
|
+
"openai>=1.0.0",
|
|
61
|
+
"elevenlabs>=1.0.0",
|
|
62
|
+
"mutagen>=1.47.0",
|
|
63
|
+
]
|
|
64
|
+
|
|
65
|
+
[project.scripts]
|
|
66
|
+
browser-director = "browser_director.main:main"
|
|
67
|
+
browser-director-mcp = "browser_director.mcp:main"
|
|
68
|
+
# Deprecated names. They print a warning and call the same entry points.
|
|
69
|
+
agent-browser = "browser_director.main:main"
|
|
70
|
+
agent-browser-mcp = "browser_director.mcp:main"
|
|
71
|
+
|
|
72
|
+
[project.urls]
|
|
73
|
+
Homepage = "https://github.com/abhinav-nigam/agent-browser"
|
|
74
|
+
Documentation = "https://github.com/abhinav-nigam/agent-browser#readme"
|
|
75
|
+
Repository = "https://github.com/abhinav-nigam/agent-browser"
|
|
76
|
+
Issues = "https://github.com/abhinav-nigam/agent-browser/issues"
|
|
77
|
+
|
|
78
|
+
[tool.setuptools.packages.find]
|
|
79
|
+
where = ["src"]
|
|
80
|
+
|
|
81
|
+
[tool.setuptools.package-dir]
|
|
82
|
+
"" = "src"
|
|
83
|
+
|
|
84
|
+
[tool.pytest.ini_options]
|
|
85
|
+
testpaths = ["tests"]
|
|
86
|
+
python_files = ["test_*.py"]
|
|
87
|
+
python_functions = ["test_*"]
|
|
88
|
+
asyncio_mode = "auto"
|
|
89
|
+
asyncio_default_fixture_loop_scope = "session"
|
|
90
|
+
asyncio_default_test_loop_scope = "session"
|
|
91
|
+
markers = [
|
|
92
|
+
"no_browser: marks tests that don't need a browser (fast unit tests)",
|
|
93
|
+
]
|
|
94
|
+
|
|
95
|
+
[tool.ruff]
|
|
96
|
+
target-version = "py310"
|
|
97
|
+
src = ["src", "tests", "compat"]
|
|
98
|
+
|
|
99
|
+
[tool.ruff.lint]
|
|
100
|
+
# The rules this repository already ran (`ruff check` historically meant
|
|
101
|
+
# pycodestyle errors plus pyflakes). Pinned so a newer ruff default, which
|
|
102
|
+
# also flags style and broad-except, does not fail the release for old code.
|
|
103
|
+
select = ["E4", "E7", "E9", "F"]
|
|
104
|
+
|
|
105
|
+
[tool.mypy]
|
|
106
|
+
python_version = "3.10"
|
|
107
|
+
ignore_missing_imports = true
|
|
108
|
+
packages = ["browser_director"]
|
|
109
|
+
warn_unused_ignores = false
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"""
|
|
2
|
+
browser-director: operate a site, then direct a narrated demo of it.
|
|
3
|
+
|
|
4
|
+
Control a browser from the CLI or from one MCP server. The same server
|
|
5
|
+
spotlights elements, moves the camera, drives a cursor, and records a
|
|
6
|
+
voiceover. The previous import name was ``agent_browser``.
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
from .driver import BrowserDriver
|
|
10
|
+
from .interactive import InteractiveRunner
|
|
11
|
+
from .mcp import BrowserServer, URLValidator
|
|
12
|
+
from .utils import (
|
|
13
|
+
PathTraversalError,
|
|
14
|
+
resize_screenshot_if_needed,
|
|
15
|
+
sanitize_filename,
|
|
16
|
+
validate_path,
|
|
17
|
+
validate_path_in_sandbox,
|
|
18
|
+
validate_output_dir,
|
|
19
|
+
)
|
|
20
|
+
from .version import __version__
|
|
21
|
+
__all__ = [
|
|
22
|
+
"__version__",
|
|
23
|
+
"BrowserDriver",
|
|
24
|
+
"BrowserServer",
|
|
25
|
+
"InteractiveRunner",
|
|
26
|
+
"PathTraversalError",
|
|
27
|
+
"URLValidator",
|
|
28
|
+
"resize_screenshot_if_needed",
|
|
29
|
+
"sanitize_filename",
|
|
30
|
+
"validate_path",
|
|
31
|
+
"validate_path_in_sandbox",
|
|
32
|
+
"validate_output_dir",
|
|
33
|
+
]
|