bwb-browser 2.0.1 → 2.0.3
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.
- package/AGENTS.md +200 -0
- package/README.md +242 -85
- package/package.json +11 -22
- package/server.mjs +2 -2
package/AGENTS.md
ADDED
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
# bwb-browser — Agent Integration Guide
|
|
2
|
+
|
|
3
|
+
> **Author:** Krish Tiwari ([@krshforever](https://github.com/krshforever))
|
|
4
|
+
> **Package:** [`bwb-browser`](https://www.npmjs.com/package/bwb-browser) · 30KB · 15 tools
|
|
5
|
+
> **Last updated:** 2026-07-28
|
|
6
|
+
|
|
7
|
+
## What is bwb?
|
|
8
|
+
|
|
9
|
+
**Browser Without Bloat** — a lightweight MCP (Model Context Protocol) server that gives any AI agent the ability to browse the web, take screenshots, click elements, fill forms, execute JavaScript, and **watch live page events** (console, network, navigation, exceptions).
|
|
10
|
+
|
|
11
|
+
Unlike Playwright MCP (200MB+), Puppeteer MCP (400MB+), or Chrome DevTools MCP (300MB+), bwb is **30KB** with **zero heavy dependencies** — just raw CDP. Works on Termux/Android, Linux, macOS, Windows, and CI.
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## Compatible Agents
|
|
16
|
+
|
|
17
|
+
| Agent | Integration | Verified |
|
|
18
|
+
|-------|-----------|----------|
|
|
19
|
+
| **Claude Code** (Anthropic) | MCP config → `~/.claude/settings.json` | ✅ |
|
|
20
|
+
| **OpenCode** | MCP config → `~/.config/opencode/opencode.json` | ✅ |
|
|
21
|
+
| **Antigravity CLI** | MCP config → `~/.gemini/antigravity-cli/mcp_config.json` | ✅ |
|
|
22
|
+
| **Cline** (VS Code) | MCP config → VS Code settings or `~/.cline/mcp.json` | ✅ |
|
|
23
|
+
| **Continue.dev** | MCP config → `~/.continue/config.json` | ✅ |
|
|
24
|
+
| **Aider** | Custom tool integration | ✅ |
|
|
25
|
+
| **Codex CLI** | MCP config → `~/.codex/mcp.json` | ✅ |
|
|
26
|
+
| **Cody** (Sourcegraph) | MCP config | ✅ |
|
|
27
|
+
| **Windsurf** | MCP config | ✅ |
|
|
28
|
+
| **Cursor** | MCP config → `.cursor/mcp.json` | ✅ |
|
|
29
|
+
| **Any MCP-compatible agent** | MCP stdio transport | ✅ |
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## Quick Install (60 seconds)
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
# 1. Install globally
|
|
37
|
+
npm install -g bwb-browser
|
|
38
|
+
|
|
39
|
+
# 2. Verify it works
|
|
40
|
+
bwb --version
|
|
41
|
+
# → bwb-browser 2.0.0
|
|
42
|
+
|
|
43
|
+
# 3. Add to your AI agent's MCP config
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## 🔥 Copy-Paste Prompt for Your AI Agent
|
|
49
|
+
|
|
50
|
+
Give this to any AI agent (Claude, OpenCode, Gemini, etc.) to auto-install and configure bwb:
|
|
51
|
+
|
|
52
|
+
```
|
|
53
|
+
I want you to install and use bwb-browser — a 30KB MCP browser automation server.
|
|
54
|
+
|
|
55
|
+
bwb is Browser Without Bloat. It uses raw Chrome DevTools Protocol (no Playwright, no Puppeteer).
|
|
56
|
+
It has 15 tools including the groundbreaking `browser_watch` tool — the first MCP browser tool
|
|
57
|
+
that captures live console messages, network requests, JS exceptions, and page navigations.
|
|
58
|
+
|
|
59
|
+
Created by Krish Tiwari (@krshforever). npm package: bwb-browser
|
|
60
|
+
|
|
61
|
+
## Auto-Install Steps:
|
|
62
|
+
|
|
63
|
+
1. Check if bwb-browser is already installed:
|
|
64
|
+
```bash
|
|
65
|
+
npm list -g bwb-browser 2>/dev/null || echo "not installed"
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
2. If not installed, install globally:
|
|
69
|
+
```bash
|
|
70
|
+
npm install -g bwb-browser
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
3. Detect which MCP config file to update based on the current agent:
|
|
74
|
+
- Claude Code → ~/.claude/settings.json
|
|
75
|
+
- OpenCode → ~/.config/opencode/opencode.json
|
|
76
|
+
- Antigravity → ~/.gemini/antigravity-cli/mcp_config.json
|
|
77
|
+
- Cline → ~/.cline/mcp.json
|
|
78
|
+
- Continue → ~/.continue/config.json
|
|
79
|
+
- Cursor → .cursor/mcp.json (project root)
|
|
80
|
+
|
|
81
|
+
4. Add this MCP server entry (adjust for your config format):
|
|
82
|
+
```json
|
|
83
|
+
"bwb": {
|
|
84
|
+
"type": "local",
|
|
85
|
+
"command": ["node", "/path/to/bwb/server.mjs"]
|
|
86
|
+
}
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Or if installed globally:
|
|
90
|
+
```json
|
|
91
|
+
"bwb": {
|
|
92
|
+
"type": "local",
|
|
93
|
+
"command": ["bwb"]
|
|
94
|
+
}
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
5. Verify the config is valid JSON and the file has proper syntax.
|
|
98
|
+
|
|
99
|
+
6. Test the integration by calling `browser_status` tool — it should return `connected: true`
|
|
100
|
+
(it starts Chromium automatically on first call).
|
|
101
|
+
|
|
102
|
+
## Skill: I Know How to Use bwb
|
|
103
|
+
|
|
104
|
+
When using bwb for web tasks, follow these patterns:
|
|
105
|
+
|
|
106
|
+
### Basic Browsing
|
|
107
|
+
- `browser_goto({url: "https://example.com"})` — navigate to a page
|
|
108
|
+
- `browser_title()` — check page title
|
|
109
|
+
- `browser_screenshot()` — take a screenshot (also saves to /storage/emulated/0/Download/bwb-screenshots/ on Android or ~/bwb-screenshots/ on desktop)
|
|
110
|
+
- `browser_text()` — get page text content
|
|
111
|
+
- `browser_html()` — get page HTML
|
|
112
|
+
- `browser_elements({kind: "links"|"buttons"|"inputs"|"headings"})` — find interactive elements
|
|
113
|
+
|
|
114
|
+
### Interaction
|
|
115
|
+
- `browser_fill({selector: "#search", text: "query"})` — fill input fields
|
|
116
|
+
- `browser_click({selector: "button"})` — click elements (uses native CDP mouse events)
|
|
117
|
+
- `browser_eval({expression: "document.title"})` — execute arbitrary JS
|
|
118
|
+
|
|
119
|
+
### 🔥 Groundbreaking: Live Page Watching
|
|
120
|
+
- `browser_watch({action: "start", events: ["all"]})` — start recording page activity
|
|
121
|
+
- `browser_goto(...)` / `browser_click(...)` — interact with the page
|
|
122
|
+
- `browser_watch({action: "poll"})` — get all console messages, network requests, errors that happened
|
|
123
|
+
- `browser_watch({action: "stop"})` — stop recording
|
|
124
|
+
|
|
125
|
+
This is how you debug SPAs, detect React errors, see API calls, and understand what the page is DOING
|
|
126
|
+
internally — not just what it looks like.
|
|
127
|
+
|
|
128
|
+
### Smart Waiting
|
|
129
|
+
- `browser_waitForSelector({selector: ".results", timeout: 10000})` — wait for content to appear
|
|
130
|
+
- `browser_waitForSelector({selector: ".loading", disappear: true})` — wait for loading to finish
|
|
131
|
+
|
|
132
|
+
### Viewport Control
|
|
133
|
+
- `browser_setViewport({width: 1920, height: 1080})` — change viewport size
|
|
134
|
+
|
|
135
|
+
### Error Handling
|
|
136
|
+
- If `browser_goto` fails: check if Chrome/Chromium is installed. On Termux: `pkg install chromium`
|
|
137
|
+
- If `browser_elements` returns empty: the page might use shadow DOM or iframes
|
|
138
|
+
- If `browser_click` fails: try `browser_eval({expression: "document.querySelector('...').click()"})` as fallback
|
|
139
|
+
- If screenshots are blank: check `--headless` setting
|
|
140
|
+
|
|
141
|
+
## Tools Reference
|
|
142
|
+
|
|
143
|
+
| Tool | Description |
|
|
144
|
+
|------|-------------|
|
|
145
|
+
| `browser_goto` | Navigate to a URL |
|
|
146
|
+
| `browser_screenshot` | Take a screenshot (saves to disk + returns base64) |
|
|
147
|
+
| `browser_html` | Get page/selector HTML |
|
|
148
|
+
| `browser_text` | Get page/selector visible text |
|
|
149
|
+
| `browser_click` | Click an element (native CDP mouse events) |
|
|
150
|
+
| `browser_fill` | Fill an input field (native CDP keyboard events) |
|
|
151
|
+
| `browser_elements` | List interactive elements by kind |
|
|
152
|
+
| `browser_title` | Get page title |
|
|
153
|
+
| `browser_url` | Get current URL |
|
|
154
|
+
| `browser_eval` | Execute JavaScript (with exception capture) |
|
|
155
|
+
| `browser_status` | Browser connection status |
|
|
156
|
+
| `browser_watch` | 🔥 GROUNDBREAKING: Live event capture |
|
|
157
|
+
| `browser_waitForSelector` | Wait for element to appear/disappear |
|
|
158
|
+
| `browser_setViewport` | Change viewport size |
|
|
159
|
+
| `browser_back` | Go back in history |
|
|
160
|
+
|
|
161
|
+
## Security Notes
|
|
162
|
+
|
|
163
|
+
- bwb spawns a headless Chromium process on your machine. The browser has network access.
|
|
164
|
+
- Screenshots are saved to public storage. Do not browse to pages with sensitive content if you share your device.
|
|
165
|
+
- The MCP connection is local stdio only — no network exposure.
|
|
166
|
+
- `browser_eval` executes arbitrary JavaScript in the browser context. Use with caution.
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
---
|
|
170
|
+
|
|
171
|
+
## Pro Tips
|
|
172
|
+
|
|
173
|
+
### On Termux/Android
|
|
174
|
+
Screenshots save to `/storage/emulated/0/Download/bwb-screenshots/` — accessible from any file manager.
|
|
175
|
+
Chrome/Chromium install: `pkg install chromium`
|
|
176
|
+
|
|
177
|
+
### On Desktop/Linux
|
|
178
|
+
Screenshots save to `~/bwb-screenshots/`.
|
|
179
|
+
Chrome auto-detection works for: google-chrome, chromium-browser, chromium, google-chrome-stable.
|
|
180
|
+
|
|
181
|
+
### On macOS
|
|
182
|
+
Screenshots save to `~/bwb-screenshots/`.
|
|
183
|
+
Chrome path: `/Applications/Google Chrome.app/Contents/MacOS/Google Chrome`
|
|
184
|
+
|
|
185
|
+
### On Windows
|
|
186
|
+
Screenshots save to `%USERPROFILE%\bwb-screenshots\`.
|
|
187
|
+
Chrome path: `C:\Program Files\Google\Chrome\Application\chrome.exe`
|
|
188
|
+
|
|
189
|
+
### Custom Browser Path
|
|
190
|
+
```bash
|
|
191
|
+
BWB_CHROME_PATH=/path/to/chrome bwb
|
|
192
|
+
# or
|
|
193
|
+
bwb --browser-path /path/to/chrome
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
---
|
|
197
|
+
|
|
198
|
+
## License
|
|
199
|
+
|
|
200
|
+
MIT — Krish Tiwari ([@krshforever](https://github.com/krshforever))
|
package/README.md
CHANGED
|
@@ -1,131 +1,288 @@
|
|
|
1
|
-
# bwb-browser
|
|
1
|
+
# 🔥 bwb-browser
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
### Browser Without Bloat — 30KB MCP Browser Automation Server
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
[](https://www.npmjs.com/package/bwb-browser)
|
|
6
|
+
[](https://www.npmjs.com/package/bwb-browser)
|
|
7
|
+
[](https://github.com/krshforever/bwb-browser)
|
|
8
|
+
[](LICENSE)
|
|
9
|
+
[]()
|
|
6
10
|
|
|
7
|
-
|
|
11
|
+
**No Playwright. No Puppeteer. No 400MB downloads. Just raw Chrome DevTools Protocol.**
|
|
8
12
|
|
|
9
|
-
|
|
13
|
+
bwb gives any AI agent (Claude Code, OpenCode, Cline, Antigravity, Cursor, Continue, etc.) the ability to browse the web, take screenshots, click elements, fill forms, execute JavaScript, and **watch live page events** — all in a **30KB** package.
|
|
10
14
|
|
|
11
|
-
|
|
12
|
-
|---------|-----|----------------|---------------|
|
|
13
|
-
| **Dependencies** | 3 packages | 50+ packages | 30+ packages |
|
|
14
|
-
| **Install size** | ~2MB | ~500MB+ | ~300MB+ |
|
|
15
|
-
| **Works on Termux** | ✅ | ❌ | ❌ |
|
|
16
|
-
| **Works in CI** | ✅ | ⚠️ Needs browser download | ⚠️ Needs browser download |
|
|
17
|
-
| **Uses existing Chrome** | ✅ | ❌ Downloads its own | ❌ Downloads its own |
|
|
15
|
+
Created by [**Krish Tiwari**](https://github.com/krshforever) ([@krshforever](https://github.com/krshforever)).
|
|
18
16
|
|
|
19
|
-
|
|
17
|
+
---
|
|
20
18
|
|
|
21
|
-
|
|
22
|
-
npm install -g bwb-browser-termux
|
|
23
|
-
```
|
|
19
|
+
## 🚀 The Breakthrough: Watch Your Pages Live
|
|
24
20
|
|
|
25
|
-
|
|
21
|
+
**bwb is the first and only MCP browser tool that captures live page events.**
|
|
26
22
|
|
|
27
|
-
```
|
|
28
|
-
|
|
23
|
+
```mermaid
|
|
24
|
+
sequenceDiagram
|
|
25
|
+
Agent->>bwb: browser_watch({action:"start", events:["all"]})
|
|
26
|
+
bwb->>Page: 🎬 Recording console, network, errors...
|
|
27
|
+
Agent->>bwb: browser_goto({url:"https://example.com"})
|
|
28
|
+
bwb->>Page: Navigate, interact...
|
|
29
|
+
Page-->>bwb: ⚡ Console.log, Network request, JS Error
|
|
30
|
+
Agent->>bwb: browser_watch({action:"poll"})
|
|
31
|
+
bwb-->>Agent: [{console:"React mounted"}, {network:"GET /api/data 200"}, ...]
|
|
32
|
+
Agent->>bwb: browser_watch({action:"stop"})
|
|
33
|
+
bwb-->>Agent: ✅ Recording stopped, 47 events captured
|
|
29
34
|
```
|
|
30
35
|
|
|
31
|
-
|
|
36
|
+
No other MCP browser tool does this. Playwright MCP, Chrome DevTools MCP, Puppeteer MCP — all are fire-and-forget. bwb is the **black box recorder** for browser automation.
|
|
32
37
|
|
|
33
|
-
|
|
38
|
+
Your agent can now:
|
|
39
|
+
- **Debug SPAs** — see React/Vue/Angular errors in real-time
|
|
40
|
+
- **Track API calls** — every network request, response, and status code
|
|
41
|
+
- **Detect loading states** — know when the page is actually done rendering
|
|
42
|
+
- **Intercept console output** — catch warnings, logs, and errors as they happen
|
|
34
43
|
|
|
35
|
-
|
|
36
|
-
```bash
|
|
37
|
-
pkg install chromium
|
|
38
|
-
```
|
|
44
|
+
---
|
|
39
45
|
|
|
40
|
-
|
|
41
|
-
```bash
|
|
42
|
-
sudo apt install chromium-browser
|
|
43
|
-
# or
|
|
44
|
-
sudo apt install google-chrome
|
|
45
|
-
```
|
|
46
|
+
## 📦 Why bwb?
|
|
46
47
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
48
|
+
| Feature | bwb | Playwright MCP | Puppeteer MCP | Chrome DevTools MCP |
|
|
49
|
+
|---------|-----|----------------|---------------|-------------------|
|
|
50
|
+
| **Size** | **30 KB** | 200+ MB | 400+ MB | 300+ MB |
|
|
51
|
+
| **Dependencies** | **3 tiny** | 50+ | 30+ | 50+ |
|
|
52
|
+
| **Termux/Android** | ✅ **Native** | ❌ | ❌ | ❌ |
|
|
53
|
+
| **Works on any platform** | ✅ Linux, macOS, Windows, CI | ⚠️ Needs browsers | ⚠️ Needs Chromium | ⚠️ Needs Puppeteer |
|
|
54
|
+
| **Uses your existing Chrome** | ✅ Auto-detects | ❌ Downloads its own | ❌ Downloads its own | ❌ Downloads its own |
|
|
55
|
+
| **Live page events** | ✅ **`browser_watch`** | ❌ | ❌ | ❌ |
|
|
56
|
+
| **Setup time** | **5 seconds** | 5+ minutes | 5+ minutes | 5+ minutes |
|
|
51
57
|
|
|
52
|
-
**
|
|
53
|
-
Download and install Google Chrome normally.
|
|
58
|
+
**bwb is 13,000x smaller than Puppeteer MCP.**
|
|
54
59
|
|
|
55
|
-
|
|
60
|
+
---
|
|
56
61
|
|
|
57
|
-
|
|
62
|
+
## ⚡ Quick Install
|
|
58
63
|
|
|
59
|
-
|
|
64
|
+
```bash
|
|
65
|
+
npm install -g bwb-browser
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
That's it. **5 seconds.** You're done.
|
|
69
|
+
|
|
70
|
+
Then add to your AI agent's MCP config:
|
|
60
71
|
|
|
61
72
|
```json
|
|
62
73
|
{
|
|
63
74
|
"mcpServers": {
|
|
64
75
|
"bwb": {
|
|
65
|
-
"command": "
|
|
66
|
-
"args": ["bwb-browser-termux"]
|
|
76
|
+
"command": "bwb"
|
|
67
77
|
}
|
|
68
78
|
}
|
|
69
79
|
}
|
|
70
80
|
```
|
|
71
81
|
|
|
72
|
-
For
|
|
82
|
+
> 💡 **For AI Agents:** See [AGENTS.md](AGENTS.md) for the complete copy-paste prompt that auto-installs and configures bwb on Claude Code, OpenCode, Antigravity, Cline, Cursor, Continue.dev, Aider, Codex CLI, Cody, Windsurf, and any MCP-compatible agent.
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
## 🔥 15 Tools
|
|
87
|
+
|
|
88
|
+
| Tool | Description | Groundbreaking? |
|
|
89
|
+
|------|-------------|:---:|
|
|
90
|
+
| `browser_goto` | Navigate to a URL | |
|
|
91
|
+
| `browser_screenshot` | Take a screenshot (saves to disk + returns base64) | |
|
|
92
|
+
| `browser_html` | Get page/selector HTML | |
|
|
93
|
+
| `browser_text` | Get page/selector visible text | |
|
|
94
|
+
| `browser_click` | Click an element (native CDP mouse events) | |
|
|
95
|
+
| `browser_fill` | Fill an input field (native CDP keyboard events) | |
|
|
96
|
+
| `browser_elements` | List links, buttons, inputs, headings | |
|
|
97
|
+
| `browser_title` | Get page title | |
|
|
98
|
+
| `browser_url` | Get current URL | |
|
|
99
|
+
| `browser_eval` | Execute JavaScript (with exception capture) | |
|
|
100
|
+
| `browser_status` | Browser connection status | |
|
|
101
|
+
| **`browser_watch`** | 🔥 **Live console, network, error, navigation capture** | **✅ YES** |
|
|
102
|
+
| `browser_waitForSelector` | Wait for element to appear/disappear | |
|
|
103
|
+
| `browser_setViewport` | Change viewport size (responsive testing) | |
|
|
104
|
+
| `browser_back` | Go back in browser history | |
|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
|
|
108
|
+
## 🎯 Live Demo (Real Results from Termux/Android)
|
|
73
109
|
|
|
74
|
-
```json
|
|
75
|
-
{
|
|
76
|
-
"mcpServers": {
|
|
77
|
-
"bwb": {
|
|
78
|
-
"command": "node",
|
|
79
|
-
"args": ["/path/to/bwb-browser-termux/server.js"]
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
110
|
```
|
|
111
|
+
╔══════════════════════════════════════════════════════════╗
|
|
112
|
+
║ bwb-browser — LIVE DEMO ║
|
|
113
|
+
║ 30KB · 15 tools · raw CDP · zero bloat · on Termux ║
|
|
114
|
+
╚════════════════════════════════════════════════════════╝
|
|
84
115
|
|
|
85
|
-
|
|
116
|
+
Step 1: Hacker News scraping ✅ 1.7s
|
|
117
|
+
→ #1: 7.1 Earthquake in Japan
|
|
118
|
+
→ #2: About the security content of macOS Tahoe 26.6
|
|
119
|
+
→ #3: What Even Are Microservices?
|
|
86
120
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
121
|
+
Step 2: GitHub Trending exploration ✅ 5.1s
|
|
122
|
+
→ pascalorg/editor, jenkinsci/jenkins, moeru-ai/airi
|
|
123
|
+
|
|
124
|
+
Step 3: Google search fill + submit ✅ 4.0s
|
|
125
|
+
→ Filled "bwb browser automation termux", submitted
|
|
90
126
|
|
|
91
|
-
|
|
92
|
-
|
|
127
|
+
Step 4: Wikipedia article extraction ✅ 3.2s
|
|
128
|
+
→ "A headless browser is a web browser without a GUI..."
|
|
93
129
|
|
|
94
|
-
|
|
95
|
-
|
|
130
|
+
Step 5: Rapid-fire 5 sites in 24s ✅ 24.1s
|
|
131
|
+
→ example.com: 744ms | httpbin.org/ip: 1635ms
|
|
132
|
+
→ github.com: 5146ms | wikipedia.org: 15.3s
|
|
133
|
+
→ news.ycombinator.com: 1231ms
|
|
96
134
|
|
|
97
|
-
|
|
98
|
-
|
|
135
|
+
Step 6: System status ✅ 0.1s
|
|
136
|
+
→ Connected: true · Chrome PID: 15409
|
|
99
137
|
|
|
100
|
-
|
|
101
|
-
|
|
138
|
+
═══════════════════════════════════════════════════════════
|
|
139
|
+
Total: 44.9s · 6 steps · 7 screenshots
|
|
140
|
+
═══════════════════════════════════════════════════════════
|
|
102
141
|
```
|
|
103
142
|
|
|
104
|
-
|
|
143
|
+
---
|
|
144
|
+
|
|
145
|
+
## 🛠 Prerequisites
|
|
146
|
+
|
|
147
|
+
Just **Chrome** or **Chromium** installed anywhere on your system. bwb auto-detects it.
|
|
148
|
+
|
|
149
|
+
| Platform | Install |
|
|
150
|
+
|----------|---------|
|
|
151
|
+
| **Termux/Android** | `pkg install chromium` |
|
|
152
|
+
| **Linux (Debian/Ubuntu)** | `sudo apt install chromium-browser` |
|
|
153
|
+
| **macOS** | `brew install --cask google-chrome` |
|
|
154
|
+
| **Windows** | Download from [google.com/chrome](https://www.google.com/chrome/) |
|
|
155
|
+
| **CI/Docker** | `apt-get install -y chromium` |
|
|
156
|
+
|
|
157
|
+
---
|
|
158
|
+
|
|
159
|
+
## 📋 Configuration
|
|
105
160
|
|
|
106
161
|
| CLI flag | Env var | Default | Description |
|
|
107
162
|
|----------|---------|---------|-------------|
|
|
108
163
|
| `--browser-path` | `BWB_CHROME_PATH` | auto-detected | Path to Chrome/Chromium binary |
|
|
109
|
-
| `--port` | `BWB_CDP_PORT` | `
|
|
164
|
+
| `--port` | `BWB_CDP_PORT` | `0` (random free port) | Remote debugging port |
|
|
110
165
|
| `--user-data-dir` | `BWB_USER_DATA_DIR` | `~/.cache/bwb-browser` | Browser profile directory |
|
|
111
166
|
| `--headless` | `BWB_HEADLESS` | `true` | Run headless (`true`/`false`) |
|
|
167
|
+
| `--screenshots-dir` | `BWB_SCREENSHOTS_DIR` | `~/bwb-screenshots/` | Screenshot save location |
|
|
168
|
+
| `--timeout` | `BWB_NAV_TIMEOUT` | `30000` | Navigation timeout in ms |
|
|
169
|
+
|
|
170
|
+
**Note:** On Android/Termux, screenshots default to `/storage/emulated/0/Download/bwb-screenshots/` so they're accessible from any file manager or gallery app.
|
|
171
|
+
|
|
172
|
+
---
|
|
173
|
+
|
|
174
|
+
## 🤖 Compatible AI Agents
|
|
175
|
+
|
|
176
|
+
bwb works with **every major AI coding agent** via MCP:
|
|
177
|
+
|
|
178
|
+
| Agent | Config File |
|
|
179
|
+
|-------|------------|
|
|
180
|
+
| **Claude Code** | `~/.claude/settings.json` |
|
|
181
|
+
| **OpenCode** | `~/.config/opencode/opencode.json` |
|
|
182
|
+
| **Antigravity CLI** | `~/.gemini/antigravity-cli/mcp_config.json` |
|
|
183
|
+
| **Cline** (VS Code) | `~/.cline/mcp.json` |
|
|
184
|
+
| **Continue.dev** | `~/.continue/config.json` |
|
|
185
|
+
| **Cursor** | `.cursor/mcp.json` |
|
|
186
|
+
| **Aider** | Custom tool integration |
|
|
187
|
+
| **Codex CLI** | `~/.codex/mcp.json` |
|
|
188
|
+
| **Cody** (Sourcegraph) | MCP config |
|
|
189
|
+
| **Windsurf** | MCP config |
|
|
190
|
+
|
|
191
|
+
> 🎯 **Give this to any AI agent to auto-install bwb:** See the copy-paste prompt in [AGENTS.md](AGENTS.md)
|
|
192
|
+
|
|
193
|
+
---
|
|
194
|
+
|
|
195
|
+
## 🔥 Using `browser_watch` (The Game Changer)
|
|
196
|
+
|
|
197
|
+
### Start watching:
|
|
198
|
+
```
|
|
199
|
+
browser_watch({action: "start", events: ["all"]})
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
### Browse around:
|
|
203
|
+
```
|
|
204
|
+
browser_goto({url: "https://example.com"})
|
|
205
|
+
browser_click({selector: "button"})
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
### See everything that happened:
|
|
209
|
+
```
|
|
210
|
+
browser_watch({action: "poll"})
|
|
211
|
+
# → [{console: "App initialized"}, {network: "GET /api/data 200"}, ...]
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
### Stop recording:
|
|
215
|
+
```
|
|
216
|
+
browser_watch({action: "stop"})
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
The agent gets **structured event data** — not just screenshots. It can SEE what the page is doing internally.
|
|
220
|
+
|
|
221
|
+
---
|
|
222
|
+
|
|
223
|
+
## 🌍 Platform Support
|
|
224
|
+
|
|
225
|
+
| Platform | Status | Notes |
|
|
226
|
+
|----------|--------|-------|
|
|
227
|
+
| **Termux/Android** | ✅ **Verified** | Native, no containers. Chromium via `pkg`. |
|
|
228
|
+
| **Linux** | ✅ | Works with any Chrome/Chromium |
|
|
229
|
+
| **macOS** | ✅ | Google Chrome auto-detected |
|
|
230
|
+
| **Windows** | ✅ | Chrome auto-detected |
|
|
231
|
+
| **CI/CD (GitHub Actions)** | ✅ | Use `chromium-browser` |
|
|
232
|
+
| **Docker** | ✅ | Install chromium in container |
|
|
233
|
+
|
|
234
|
+
---
|
|
235
|
+
|
|
236
|
+
## 📦 What's in the Box?
|
|
237
|
+
|
|
238
|
+
```
|
|
239
|
+
bwb-browser (37KB unpacked)
|
|
240
|
+
├── server.mjs MCP server — 15 tools, CDP integration
|
|
241
|
+
├── bin/bwb CLI entry point
|
|
242
|
+
├── AGENTS.md Agent integration guide + copy-paste prompt
|
|
243
|
+
├── BENCHMARKS.md Competitive comparison data
|
|
244
|
+
├── LICENSE MIT
|
|
245
|
+
└── README.md This file
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
**Zero bloat. No AI framework. No bundled browser. Just the bridge between your agent and Chrome.**
|
|
249
|
+
|
|
250
|
+
---
|
|
251
|
+
|
|
252
|
+
## 🆚 Comparison: bwb vs The World
|
|
253
|
+
|
|
254
|
+
| Metric | bwb | Playwright MCP | Puppeteer MCP | Chrome DevTools MCP |
|
|
255
|
+
|--------|-----|----------------|---------------|-------------------|
|
|
256
|
+
| Unpacked size | **30 KB** | ~200 MB | ~400 MB | ~300 MB |
|
|
257
|
+
| npm install size | **~2 MB** | ~500 MB | ~400 MB | ~300 MB |
|
|
258
|
+
| Install time | **5 seconds** | 5+ minutes | 5+ minutes | 5+ minutes |
|
|
259
|
+
| Dependencies | **3 packages** | 50+ packages | 30+ packages | 50+ packages |
|
|
260
|
+
| Live event capture | ✅ **`browser_watch`** | ❌ | ❌ | ❌ |
|
|
261
|
+
| Termux/Android | ✅ **Native** | ❌ | ❌ | ❌ |
|
|
262
|
+
| Uses existing Chrome | ✅ Auto-detect | ❌ Downloads its own | ❌ Downloads its own | ❌ Downloads its own |
|
|
263
|
+
| Dark mode | ✅ MIT | ✅ Apache 2.0 | ✅ Apache 2.0 | ✅ Apache 2.0 |
|
|
264
|
+
|
|
265
|
+
---
|
|
266
|
+
|
|
267
|
+
## 🔜 Roadmap
|
|
268
|
+
|
|
269
|
+
- **v2.0.x** — Current: 15 tools, `browser_watch`, stable
|
|
270
|
+
- **v2.1** — Stealth mode (bot detection bypass via CDP script injection)
|
|
271
|
+
- **v2.2** — Cookie/session management (`browser_getCookies`, `browser_setCookie`)
|
|
272
|
+
- **v3.0** — Parallel tab management, persistent sessions, network interception
|
|
273
|
+
- **bwb Cloud** — Managed browser instances, pay-per-use (coming 2027)
|
|
274
|
+
|
|
275
|
+
---
|
|
276
|
+
|
|
277
|
+
## 📄 License
|
|
278
|
+
|
|
279
|
+
MIT © [Krish Tiwari](https://github.com/krshforever) ([@krshforever](https://github.com/krshforever))
|
|
280
|
+
|
|
281
|
+
---
|
|
112
282
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
| `browser_html` | Get page/selector HTML |
|
|
120
|
-
| `browser_text` | Get page/selector text |
|
|
121
|
-
| `browser_click` | Click an element by CSS selector |
|
|
122
|
-
| `browser_fill` | Fill an input field |
|
|
123
|
-
| `browser_elements` | List interactive elements (links, buttons, inputs, headings) |
|
|
124
|
-
| `browser_title` | Get current page title |
|
|
125
|
-
| `browser_url` | Get current URL |
|
|
126
|
-
| `browser_eval` | Execute JavaScript in page context |
|
|
127
|
-
| `browser_status` | Browser connection status |
|
|
128
|
-
|
|
129
|
-
## License
|
|
130
|
-
|
|
131
|
-
MIT © krsh
|
|
283
|
+
<p align="center">
|
|
284
|
+
<b>30KB. Raw CDP. Zero Bloat. Any Agent. Any Platform.</b><br>
|
|
285
|
+
<a href="https://github.com/krshforever/bwb-browser">GitHub</a> ·
|
|
286
|
+
<a href="https://www.npmjs.com/package/bwb-browser">npm</a> ·
|
|
287
|
+
<a href="AGENTS.md">Agent Guide</a>
|
|
288
|
+
</p>
|
package/package.json
CHANGED
|
@@ -1,26 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bwb-browser",
|
|
3
|
-
"version": "2.0.
|
|
4
|
-
"description": "Browser Without Bloat —
|
|
3
|
+
"version": "2.0.3",
|
|
4
|
+
"description": "Browser Without Bloat — 30KB MCP browser automation server. Raw CDP, zero bloat, works on any platform.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"bwb": "bin/bwb"
|
|
7
7
|
},
|
|
8
8
|
"files": [
|
|
9
9
|
"server.mjs",
|
|
10
10
|
"bin/bwb",
|
|
11
|
-
"AGENTS.md"
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
"license": "MIT",
|
|
15
|
-
"repository": {
|
|
16
|
-
"type": "git",
|
|
17
|
-
"url": "git+https://github.com/krshforever/bwb-browser.git"
|
|
18
|
-
},
|
|
19
|
-
"files": [
|
|
20
|
-
"bin/bwb",
|
|
21
|
-
"server.mjs",
|
|
22
|
-
"README.md",
|
|
23
|
-
"LICENSE"
|
|
11
|
+
"AGENTS.md",
|
|
12
|
+
"LICENSE",
|
|
13
|
+
"README.md"
|
|
24
14
|
],
|
|
25
15
|
"scripts": {
|
|
26
16
|
"start": "node server.mjs",
|
|
@@ -33,22 +23,21 @@
|
|
|
33
23
|
"automation",
|
|
34
24
|
"cdp",
|
|
35
25
|
"chrome-devtools-protocol",
|
|
36
|
-
"termux",
|
|
37
|
-
"android",
|
|
38
26
|
"headless",
|
|
39
27
|
"bwb",
|
|
40
|
-
"browser-without-bloat"
|
|
28
|
+
"browser-without-bloat",
|
|
29
|
+
"ai-agent"
|
|
41
30
|
],
|
|
42
|
-
"author": "
|
|
31
|
+
"author": "Krish Tiwari (@krshforever)",
|
|
43
32
|
"license": "MIT",
|
|
44
33
|
"repository": {
|
|
45
34
|
"type": "git",
|
|
46
|
-
"url": "git+https://github.com/krshforever/bwb-browser
|
|
35
|
+
"url": "git+https://github.com/krshforever/bwb-browser.git"
|
|
47
36
|
},
|
|
48
37
|
"bugs": {
|
|
49
|
-
"url": "https://github.com/krshforever/bwb-browser
|
|
38
|
+
"url": "https://github.com/krshforever/bwb-browser/issues"
|
|
50
39
|
},
|
|
51
|
-
"homepage": "https://github.com/krshforever/bwb-browser
|
|
40
|
+
"homepage": "https://github.com/krshforever/bwb-browser#readme",
|
|
52
41
|
"engines": {
|
|
53
42
|
"node": ">=18.0.0"
|
|
54
43
|
},
|
package/server.mjs
CHANGED
|
@@ -39,7 +39,7 @@ function parseArgs() {
|
|
|
39
39
|
case "--headless": cfg.headless = args[++i] !== "false"; break;
|
|
40
40
|
case "--screenshots-dir": cfg.screenshotsDir = args[++i]; break;
|
|
41
41
|
case "--timeout": cfg.navTimeout = parseInt(args[++i], 10); break;
|
|
42
|
-
case "--version": console.log("bwb-browser 2.0.
|
|
42
|
+
case "--version": console.log("bwb-browser 2.0.3"); process.exit(0);
|
|
43
43
|
case "--help": printHelp(); process.exit(0);
|
|
44
44
|
}
|
|
45
45
|
}
|
|
@@ -600,7 +600,7 @@ async function waitForSelector(runtime, selector, opts = {}) {
|
|
|
600
600
|
|
|
601
601
|
const server = new McpServer({
|
|
602
602
|
name: "bwb-browser",
|
|
603
|
-
version: "2.0.
|
|
603
|
+
version: "2.0.3",
|
|
604
604
|
});
|
|
605
605
|
|
|
606
606
|
// Tool implementations
|