mcp-camoufox 0.2.2 → 0.2.4

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.
Files changed (3) hide show
  1. package/README.md +177 -68
  2. package/dist/index.js +2 -1
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # MCP Camoufox
2
2
 
3
+ [![npm version](https://img.shields.io/npm/v/mcp-camoufox.svg)](https://www.npmjs.com/package/mcp-camoufox)
4
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
5
+
3
6
  MCP server for **stealth browser automation** via [Camoufox](https://github.com/daijro/camoufox) — a privacy-focused Firefox fork with C++ level anti-detection patches.
4
7
 
5
8
  **Chrome DevTools MCP-level power, with anti-bot stealth.**
@@ -18,21 +21,25 @@ MCP server for **stealth browser automation** via [Camoufox](https://github.com/
18
21
  ### Claude Code
19
22
 
20
23
  ```bash
21
- claude mcp add camoufox -- npx -y mcp-camoufox
24
+ claude mcp add camoufox -- npx -y mcp-camoufox@latest
22
25
  ```
23
26
 
24
- Done. That's it.
27
+ That's it. No pip, no Python, no manual downloads.
25
28
 
26
29
  ### Claude Desktop
27
30
 
28
- Add to config (`~/Library/Application Support/Claude/claude_desktop_config.json`):
31
+ Add to your config file:
32
+
33
+ **macOS:** `~/Library/Application Support/Claude/claude_desktop_config.json`
34
+ **Windows:** `%APPDATA%\Claude\claude_desktop_config.json`
35
+ **Linux:** `~/.config/Claude/claude_desktop_config.json`
29
36
 
30
37
  ```json
31
38
  {
32
39
  "mcpServers": {
33
40
  "camoufox": {
34
41
  "command": "npx",
35
- "args": ["-y", "mcp-camoufox"]
42
+ "args": ["-y", "mcp-camoufox@latest"]
36
43
  }
37
44
  }
38
45
  }
@@ -40,13 +47,15 @@ Add to config (`~/Library/Application Support/Claude/claude_desktop_config.json`
40
47
 
41
48
  ### Cursor
42
49
 
50
+ Preferences > Features > MCP:
51
+
43
52
  ```json
44
53
  {
45
54
  "mcp": {
46
55
  "servers": {
47
56
  "camoufox": {
48
57
  "command": "npx",
49
- "args": ["-y", "mcp-camoufox"]
58
+ "args": ["-y", "mcp-camoufox@latest"]
50
59
  }
51
60
  }
52
61
  }
@@ -62,7 +71,20 @@ Add to `~/.windsurf/mcp.json`:
62
71
  "servers": {
63
72
  "camoufox": {
64
73
  "command": "npx",
65
- "args": ["-y", "mcp-camoufox"]
74
+ "args": ["-y", "mcp-camoufox@latest"]
75
+ }
76
+ }
77
+ }
78
+ ```
79
+
80
+ ### VS Code (Continue / Cline)
81
+
82
+ ```json
83
+ {
84
+ "mcpServers": {
85
+ "camoufox": {
86
+ "command": "npx",
87
+ "args": ["-y", "mcp-camoufox@latest"]
66
88
  }
67
89
  }
68
90
  }
@@ -70,129 +92,216 @@ Add to `~/.windsurf/mcp.json`:
70
92
 
71
93
  ## Requirements
72
94
 
73
- - **Node.js 18+** (`node --version`)
74
- - Camoufox browser binary is downloaded automatically on first launch
95
+ | Requirement | Version | How to check |
96
+ |-------------|---------|--------------|
97
+ | **Node.js** | 18+ | `node --version` |
75
98
 
76
- No Python required. No manual setup.
99
+ That's all. No Python, no pip, no manual binary downloads. Camoufox browser is downloaded automatically on first launch (~80MB, once).
77
100
 
78
101
  ## Features
79
102
 
80
103
  - **39 MCP tools** for full browser control
81
- - **Camoufox stealth** — C++ fingerprint patches, bypasses Cloudflare Turnstile
82
- - **Persistent session** — browser stays alive between calls, cookies maintained
83
- - **JS click fallback** — auto-fallback when elements blocked by overlays
84
- - **1280x800 default** — fits any screen, no cropping
104
+ - **Camoufox stealth** — C++ fingerprint patches at browser engine level, bypasses Cloudflare Turnstile and bot detection
105
+ - **Persistent session** — browser stays alive between tool calls, cookies and state maintained across sessions
106
+ - **JS click fallback** — automatically falls back to JavaScript click when elements are blocked by overlays
107
+ - **1280x800 default window** — fits any screen without cropping, customizable via width/height params
108
+ - **Ref-based interaction** — `browser_snapshot` returns compact element list with ref IDs, not raw HTML (token-efficient)
85
109
 
86
110
  ## Tools (39)
87
111
 
88
112
  ### Browser Lifecycle
113
+
89
114
  | Tool | Description |
90
115
  |------|-------------|
91
- | `browser_launch` | Launch browser. Options: url, headless, humanize, geoip, locale, width, height |
92
- | `browser_close` | Close browser (cookies saved) |
116
+ | `browser_launch` | Launch Camoufox and navigate to URL. Options: `url`, `headless`, `humanize`, `geoip`, `locale`, `width`, `height` |
117
+ | `browser_close` | Close browser. Cookies are preserved in persistent profile. |
93
118
 
94
119
  ### Navigation
120
+
95
121
  | Tool | Description |
96
122
  |------|-------------|
97
- | `navigate` | Go to URL (wait strategy + timeout) |
98
- | `go_back` / `go_forward` / `reload` | History navigation |
123
+ | `navigate` | Go to URL with configurable wait strategy (`domcontentloaded`, `load`, `networkidle`) and timeout |
124
+ | `go_back` | Navigate back in browser history |
125
+ | `go_forward` | Navigate forward in browser history |
126
+ | `reload` | Reload current page |
127
+
128
+ ### DOM & Page Content
99
129
 
100
- ### DOM & Content
101
130
  | Tool | Description |
102
131
  |------|-------------|
103
- | `browser_snapshot` | Get interactive elements with ref IDs |
104
- | `screenshot` | Capture page (viewport or full page) |
105
- | `get_text` / `get_html` / `get_url` | Read page content |
106
- | `save_pdf` | Export as PDF |
132
+ | `browser_snapshot` | Get all visible interactive elements with ref IDs. Use these refs with `click`, `fill`, etc. **Always call after navigation.** |
133
+ | `screenshot` | Capture viewport or full-page screenshot. Saved to `~/.camoufox-mcp/screenshots/` |
134
+ | `get_text` | Get visible text from page or CSS selector (truncated at 5000 chars) |
135
+ | `get_html` | Get inner/outer HTML from page or CSS selector (truncated at 10000 chars) |
136
+ | `get_url` | Get current URL and page title |
137
+ | `save_pdf` | Export current page as PDF |
138
+
139
+ ### Element Interaction
107
140
 
108
- ### Interaction
109
141
  | Tool | Description |
110
142
  |------|-------------|
111
- | `click` | Click by ref ID (JS fallback for overlays) |
112
- | `click_text` | Click by visible text |
113
- | `click_role` | Click by ARIA role + name |
114
- | `hover` / `fill` / `select_option` | Hover, fill input, select dropdown |
115
- | `check` / `uncheck` | Checkbox/radio |
116
- | `upload_file` | File upload |
143
+ | `click` | Click element by ref ID. Auto JS-fallback for overlays. Options: `button` (left/right/middle), `dblclick` |
144
+ | `click_text` | Click element by visible text. Options: `exact` (true/false) |
145
+ | `click_role` | Click element by ARIA role and accessible name (e.g. role=`button`, name=`Submit`) |
146
+ | `hover` | Hover over element by ref ID |
147
+ | `fill` | Fill input/textarea by ref ID. Clears existing content first. |
148
+ | `select_option` | Select option from `<select>` dropdown by ref ID |
149
+ | `check` | Check a checkbox or radio button by ref ID |
150
+ | `uncheck` | Uncheck a checkbox by ref ID |
151
+ | `upload_file` | Upload file to a file input by ref ID |
117
152
 
118
153
  ### Keyboard
154
+
119
155
  | Tool | Description |
120
156
  |------|-------------|
121
- | `type_text` | Type char by char |
122
- | `press_key` | Key or combo (Enter, Escape, Control+a) |
157
+ | `type_text` | Type text character by character via keyboard. Options: `delay` (ms between keys). Use for masked inputs that don't support `fill`. |
158
+ | `press_key` | Press key or combination: `Enter`, `Escape`, `Tab`, `ArrowDown`, `Control+a`, `Meta+c`, `Shift+Tab` |
123
159
 
124
160
  ### Wait
161
+
125
162
  | Tool | Description |
126
163
  |------|-------------|
127
- | `wait_for` | Wait for selector/text (visible/hidden) |
128
- | `wait_for_navigation` | Wait for page load |
164
+ | `wait_for` | Wait for CSS selector or text to become visible/hidden/attached/detached. Options: `state`, `timeout` |
165
+ | `wait_for_navigation` | Wait for page load to complete |
166
+
167
+ ### Tab Management
129
168
 
130
- ### Tabs
131
169
  | Tool | Description |
132
170
  |------|-------------|
133
- | `tab_list` / `tab_new` / `tab_select` / `tab_close` | Multi-tab |
171
+ | `tab_list` | List all open tabs with URLs and titles |
172
+ | `tab_new` | Open new tab, optionally navigate to URL |
173
+ | `tab_select` | Switch active tab by index |
174
+ | `tab_close` | Close tab by index (default: active tab) |
134
175
 
135
176
  ### Cookies
177
+
136
178
  | Tool | Description |
137
179
  |------|-------------|
138
- | `cookie_list` / `cookie_set` / `cookie_delete` | Cookie management |
180
+ | `cookie_list` | List all cookies, optionally filter by domain |
181
+ | `cookie_set` | Set a cookie (name, value, domain, path) |
182
+ | `cookie_delete` | Delete cookies by name/domain, or clear all |
183
+
184
+ ### JavaScript
139
185
 
140
- ### Other
141
186
  | Tool | Description |
142
187
  |------|-------------|
143
- | `evaluate` | Execute JavaScript |
144
- | `scroll` | Scroll page (up/down/left/right) |
145
- | `dialog_handle` | Accept/dismiss alerts |
146
- | `console_start` / `console_get` | Capture console |
147
- | `network_start` / `network_get` | Capture network |
188
+ | `evaluate` | Execute JavaScript in page context and return result |
148
189
 
149
- ## Usage Flow
190
+ ### Scroll
191
+
192
+ | Tool | Description |
193
+ |------|-------------|
194
+ | `scroll` | Scroll page in any direction: `up`, `down`, `left`, `right` with configurable `amount` in pixels |
195
+
196
+ ### Dialog
197
+
198
+ | Tool | Description |
199
+ |------|-------------|
200
+ | `dialog_handle` | Pre-set handler for next alert/confirm/prompt dialog: `accept` or `dismiss` |
201
+
202
+ ### Debug
203
+
204
+ | Tool | Description |
205
+ |------|-------------|
206
+ | `console_start` | Start capturing browser console messages |
207
+ | `console_get` | Retrieve captured console messages (last 50) |
208
+ | `network_start` | Start capturing network requests/responses |
209
+ | `network_get` | Retrieve captured network requests (last 50) |
210
+
211
+ ## Usage Examples
212
+
213
+ ### Basic: Open site and interact
150
214
 
151
215
  ```
152
- 1. browser_launch(url="https://example.com", headless=false)
153
- 2. browser_snapshot() see interactive elements with ref IDs
154
- 3. click(ref="e5") click element
155
- 4. fill(ref="e12", value="hello@example.com")
156
- 5. click_role(role="button", name="Submit")
157
- 6. screenshot() see result
158
- 7. browser_close() cookies saved
216
+ browser_launch(url="https://example.com", headless=false)
217
+ browser_snapshot() # see all interactive elements
218
+ click(ref="e5") # click an element
219
+ fill(ref="e12", value="hello@example.com")
220
+ click_role(role="button", name="Submit")
221
+ screenshot() # see the result
222
+ browser_close() # done, cookies saved
223
+ ```
224
+
225
+ ### Login flow
226
+
227
+ ```
228
+ browser_launch(url="https://site.com/login")
229
+ browser_snapshot()
230
+ fill(ref="e3", value="user@email.com") # email
231
+ click(ref="e5") # Continue
232
+ wait_for(selector='input[type="password"]')
233
+ browser_snapshot()
234
+ fill(ref="e2", value="mypassword") # password
235
+ click(ref="e4") # Sign in
236
+ wait_for_navigation()
237
+ browser_snapshot() # verify logged in
238
+ ```
239
+
240
+ ### Multi-tab research
241
+
242
+ ```
243
+ browser_launch(url="https://github.com")
244
+ tab_new(url="https://stackoverflow.com")
245
+ tab_list() # see both tabs
246
+ tab_select(index=0) # switch to GitHub
247
+ ```
248
+
249
+ ### Search with keyboard
250
+
251
+ ```
252
+ browser_launch(url="https://google.com")
253
+ browser_snapshot()
254
+ click(ref="e5") # click search box
255
+ type_text(text="mcp-camoufox npm")
256
+ press_key(key="Enter")
159
257
  ```
160
258
 
161
259
  ## How It Works
162
260
 
163
261
  ```
164
262
  AI Agent (Claude, Cursor, etc.)
165
- ↓ MCP Protocol (stdio)
263
+ |
264
+ | MCP Protocol (stdio JSON-RPC)
265
+ v
166
266
  mcp-camoufox (Node.js)
167
- ↓ Playwright API (Juggler protocol, NOT CDP)
168
- Camoufox (Patched Firefox)
169
- ↓ C++ anti-fingerprint patches
170
- Website (Cloudflare bypassed)
267
+ |
268
+ | Playwright API (Juggler protocol, NOT CDP)
269
+ v
270
+ Camoufox (Patched Firefox binary)
271
+ |
272
+ | C++ anti-fingerprint patches
273
+ v
274
+ Website (Cloudflare, bot detection — bypassed)
171
275
  ```
172
276
 
173
- - **Juggler protocol** (not CDP) no Chrome DevTools Protocol detection
174
- - **Persistent profile** at `~/.camoufox-mcp/profile/` — cookies survive sessions
175
- - **Screenshots** at `~/.camoufox-mcp/screenshots/`
176
- - **Ref-based** interaction via `data-mcp-ref` attributes from `browser_snapshot`
277
+ **Why Juggler, not CDP?** Camoufox is Firefox-based. It communicates via Playwright's Juggler protocol, completely avoiding Chrome DevTools Protocol. Sites that detect CDP automation (like ChatGPT, Cloudflare-protected sites) cannot detect Camoufox.
278
+
279
+ **Why persistent context?** Browser profile is stored at `~/.camoufox-mcp/profile/`. Cookies, localStorage, and IndexedDB survive across sessions. Login once, stay logged in.
280
+
281
+ **Why ref-based?** `browser_snapshot` tags visible elements with `data-mcp-ref` attributes and returns a compact list. This is more token-efficient than sending full HTML and more reliable than CSS selectors that break when sites update.
177
282
 
178
283
  ## Persistent Data
179
284
 
180
285
  | Path | Purpose |
181
286
  |------|---------|
182
- | `~/.camoufox-mcp/profile/` | Browser profile (cookies, localStorage) |
287
+ | `~/.camoufox-mcp/profile/` | Browser profile (cookies, localStorage, cache) |
183
288
  | `~/.camoufox-mcp/screenshots/` | Screenshots and PDFs |
184
289
 
185
- Reset: `rm -rf ~/.camoufox-mcp/profile/`
290
+ To reset (clear all cookies and sessions):
291
+ ```bash
292
+ rm -rf ~/.camoufox-mcp/profile/
293
+ ```
186
294
 
187
295
  ## Troubleshooting
188
296
 
189
- **"Browser not running"** Call `browser_launch` first.
190
-
191
- **Click fails** Tool auto-fallbacks to JS click. If still fails, use `browser_snapshot` to check refs.
192
-
193
- **Window too large** Use `browser_launch(width=1024, height=768)`.
194
-
195
- **First launch slow**Camoufox downloads browser binary (~80MB, once).
297
+ | Problem | Solution |
298
+ |---------|----------|
299
+ | "Browser not running" | Call `browser_launch` first before any other tool |
300
+ | Click fails / element intercepted | Tool auto-fallbacks to JS click. If still fails, `browser_snapshot` to check refs |
301
+ | Window too large for screen | Use `browser_launch(width=1024, height=768)` |
302
+ | First launch slow (~30s) | Camoufox downloading browser binary. Only happens once. |
303
+ | Stale ref IDs | Call `browser_snapshot` again after navigation refs regenerate each time |
304
+ | Snapshot too large (Wikipedia etc.) | Normal for element-heavy pages. Use `get_text` or `evaluate` instead. |
196
305
 
197
306
  ## License
198
307
 
package/dist/index.js CHANGED
@@ -516,7 +516,8 @@ server.tool("scroll", "Scroll the page.", {
516
516
  dx = amount;
517
517
  else if (direction === "left")
518
518
  dx = -amount;
519
- await page.mouse.wheel(dx, dy);
519
+ // Use JS scroll — mouse.wheel doesn't work reliably in Firefox/Camoufox
520
+ await page.evaluate(`window.scrollBy(${dx}, ${dy})`);
520
521
  await page.waitForTimeout(300);
521
522
  return { content: [{ type: "text", text: `Scrolled ${direction} ${amount}px` }] };
522
523
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mcp-camoufox",
3
- "version": "0.2.2",
3
+ "version": "0.2.4",
4
4
  "description": "MCP server for stealth browser automation via Camoufox — 39 tools, Chrome DevTools MCP-level power with anti-bot stealth",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",