mcp-camoufox 0.3.0 → 0.3.1

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 (2) hide show
  1. package/README.md +209 -90
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -5,16 +5,18 @@
5
5
 
6
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.
7
7
 
8
- **Chrome DevTools MCP-level power, with anti-bot stealth.**
8
+ **65 tools. Chrome DevTools MCP-level power. Anti-bot stealth. One command install.**
9
9
 
10
10
  ## Why?
11
11
 
12
- | Tool | Browser Control | Stealth | Persistent Session | Install |
13
- |------|----------------|---------|--------------------|---------|
14
- | Chrome DevTools MCP | 30+ tools | No | Yes | Built-in |
15
- | whit3rabbit/camoufox-mcp | 1 tool | Yes | No | npx |
16
- | Playwright CLI | 60+ commands | No | Yes | npx |
17
- | **mcp-camoufox** | **39 tools** | **Yes** | **Yes** | **npx** |
12
+ | Tool | Tools | Stealth | npx Install | Persistent Session |
13
+ |------|-------|---------|-------------|--------------------|
14
+ | Chrome DevTools MCP | 30+ | No | Built-in | Yes |
15
+ | whit3rabbit/camoufox-mcp | 1 | Yes | Yes | No |
16
+ | redf0x1/camofox-mcp | 45 | Yes | No (clone) | Yes |
17
+ | Sekinal/camoufox-mcp | 49 | Yes | No (clone) | Yes |
18
+ | Playwright CLI | 60+ | No | Yes | Yes |
19
+ | **mcp-camoufox** | **65** | **Yes** | **Yes** | **Yes** |
18
20
 
19
21
  ## Quick Start
20
22
 
@@ -30,9 +32,9 @@ That's it. No pip, no Python, no manual downloads.
30
32
 
31
33
  Add to your config file:
32
34
 
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`
35
+ - **macOS:** `~/Library/Application Support/Claude/claude_desktop_config.json`
36
+ - **Windows:** `%APPDATA%\Claude\claude_desktop_config.json`
37
+ - **Linux:** `~/.config/Claude/claude_desktop_config.json`
36
38
 
37
39
  ```json
38
40
  {
@@ -96,130 +98,191 @@ Add to `~/.windsurf/mcp.json`:
96
98
  |-------------|---------|--------------|
97
99
  | **Node.js** | 18+ | `node --version` |
98
100
 
99
- That's all. No Python, no pip, no manual binary downloads. Camoufox browser is downloaded automatically on first launch (~80MB, once).
101
+ That's all. Camoufox browser binary is downloaded automatically on first launch (~80MB, once).
100
102
 
101
- ## Features
103
+ ## All 65 Tools
102
104
 
103
- - **39 MCP tools** for full browser control
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)
109
-
110
- ## Tools (39)
111
-
112
- ### Browser Lifecycle
105
+ ### Browser Lifecycle (2)
113
106
 
114
107
  | Tool | Description |
115
108
  |------|-------------|
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. |
109
+ | `browser_launch` | Launch Camoufox stealth browser and navigate to URL. Browser persists between calls — cookies and sessions maintained. Options: `url`, `headless` (true/false), `humanize` (human-like mouse), `geoip` (auto timezone), `locale`, `width`, `height` |
110
+ | `browser_close` | Close browser gracefully. Cookies and localStorage are preserved in persistent profile at `~/.camoufox-mcp/profile/` |
118
111
 
119
- ### Navigation
112
+ ### Navigation (4)
120
113
 
121
114
  | Tool | Description |
122
115
  |------|-------------|
123
- | `navigate` | Go to URL with configurable wait strategy (`domcontentloaded`, `load`, `networkidle`) and timeout |
116
+ | `navigate` | Go to URL with configurable wait strategy (`domcontentloaded`, `load`, `networkidle`) and timeout in ms |
124
117
  | `go_back` | Navigate back in browser history |
125
118
  | `go_forward` | Navigate forward in browser history |
126
119
  | `reload` | Reload current page |
127
120
 
128
- ### DOM & Page Content
121
+ ### DOM Snapshot & Page Content (6)
129
122
 
130
123
  | Tool | Description |
131
124
  |------|-------------|
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 |
125
+ | `browser_snapshot` | Get all visible interactive elements with ref IDs. Returns compact list — use ref IDs with `click`, `fill`, etc. **Always call after navigation to get fresh refs.** |
126
+ | `screenshot` | Capture viewport or full-page screenshot. Saved to `~/.camoufox-mcp/screenshots/`. Options: `name` (filename prefix), `full_page` |
127
+ | `get_text` | Get visible text from page or specific CSS selector. Truncated at 5000 chars for token efficiency. |
128
+ | `get_html` | Get inner or outer HTML from page or CSS selector. Truncated at 10000 chars. Options: `selector`, `outer` |
129
+ | `get_url` | Get current page URL and title |
130
+ | `save_pdf` | Export current page as PDF file |
138
131
 
139
- ### Element Interaction
132
+ ### Element Interaction (9)
140
133
 
141
134
  | Tool | Description |
142
135
  |------|-------------|
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) |
136
+ | `click` | Click element by ref ID from `browser_snapshot`. Auto JS-fallback when element is blocked by overlay. Options: `button` (left/right/middle), `dblclick` |
137
+ | `click_text` | Click element by its visible text content. Options: `exact` (true = exact match, false = partial) |
145
138
  | `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 |
139
+ | `hover` | Hover over element by ref ID — triggers hover effects, tooltips, dropdown menus |
140
+ | `fill` | Fill text into input or textarea by ref ID. Clears existing content first. Works for standard form inputs. |
141
+ | `select_option` | Select option from `<select>` dropdown by ref ID and option value/label |
149
142
  | `check` | Check a checkbox or radio button by ref ID |
150
143
  | `uncheck` | Uncheck a checkbox by ref ID |
151
- | `upload_file` | Upload file to a file input by ref ID |
144
+ | `upload_file` | Upload file to a file input element by ref ID. Takes absolute file path. |
145
+
146
+ ### Keyboard (2)
147
+
148
+ | Tool | Description |
149
+ |------|-------------|
150
+ | `type_text` | Type text character by character via keyboard. Options: `delay` (ms between keys). Use for masked inputs, OTP fields, date pickers — anything that doesn't support `fill`. |
151
+ | `press_key` | Press keyboard key or combination. Examples: `Enter`, `Escape`, `Tab`, `ArrowDown`, `Control+a`, `Meta+c`, `Shift+Tab`, `F5` |
152
+
153
+ ### Mouse XY (3)
154
+
155
+ | Tool | Description |
156
+ |------|-------------|
157
+ | `mouse_click_xy` | Click at exact x,y pixel coordinates on the page. Options: `button` (left/right/middle). Use when ref-based click isn't possible. |
158
+ | `mouse_move` | Move mouse cursor to exact x,y coordinates. Use for triggering hover effects at specific positions. |
159
+ | `drag_and_drop` | Drag element from one position to another by ref IDs. Use for sortable lists, kanban boards, file drop zones. |
160
+
161
+ ### Wait (4)
162
+
163
+ | Tool | Description |
164
+ |------|-------------|
165
+ | `wait_for` | Wait for CSS selector or text to become visible/hidden/attached/detached. Options: `selector`, `text`, `state`, `timeout` |
166
+ | `wait_for_navigation` | Wait for page load to complete after a click or form submission |
167
+ | `wait_for_url` | Wait for URL to match a substring or regex pattern. Use after actions that trigger redirects. |
168
+ | `wait_for_response` | Wait for a specific network response matching a URL pattern. Use to wait for API calls to complete. |
169
+
170
+ ### Tab Management (4)
171
+
172
+ | Tool | Description |
173
+ |------|-------------|
174
+ | `tab_list` | List all open tabs with index, URL, title, and active status |
175
+ | `tab_new` | Open new tab, optionally navigate to URL. New tab becomes active. |
176
+ | `tab_select` | Switch active tab by index from `tab_list` |
177
+ | `tab_close` | Close tab by index. Default: close active tab. |
178
+
179
+ ### Cookies (3)
180
+
181
+ | Tool | Description |
182
+ |------|-------------|
183
+ | `cookie_list` | List all cookies, optionally filter by domain. Shows name, value (truncated), domain. |
184
+ | `cookie_set` | Set a cookie with name, value, domain, and path |
185
+ | `cookie_delete` | Delete cookies by name and/or domain. Both empty = clear ALL cookies. |
186
+
187
+ ### Local Storage (3)
188
+
189
+ | Tool | Description |
190
+ |------|-------------|
191
+ | `localstorage_get` | Get all localStorage data or a specific key. Returns JSON for all, or value for specific key. |
192
+ | `localstorage_set` | Set a localStorage key-value pair |
193
+ | `localstorage_clear` | Clear all localStorage data |
152
194
 
153
- ### Keyboard
195
+ ### Session Storage (2)
154
196
 
155
197
  | Tool | Description |
156
198
  |------|-------------|
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` |
199
+ | `sessionstorage_get` | Get all sessionStorage data or a specific key |
200
+ | `sessionstorage_set` | Set a sessionStorage key-value pair |
159
201
 
160
- ### Wait
202
+ ### JavaScript (2)
161
203
 
162
204
  | Tool | Description |
163
205
  |------|-------------|
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 |
206
+ | `evaluate` | Execute JavaScript in page context and return result. Supports expressions and IIFE functions. |
207
+ | `inject_init_script` | Inject a script that runs automatically before every page load. Use for modifying page behavior, intercepting requests, etc. |
166
208
 
167
- ### Tab Management
209
+ ### Element Inspection (4)
168
210
 
169
211
  | Tool | Description |
170
212
  |------|-------------|
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) |
213
+ | `inspect_element` | Get detailed info about an element: tag, id, class, all attributes, bounding box, computed styles (font size, color, background), text content, value |
214
+ | `get_attribute` | Get a specific attribute value from an element by ref ID |
215
+ | `query_selector_all` | Query multiple elements by CSS selector. Returns text, tag, and optional attribute for all matches. Options: `limit` |
216
+ | `get_links` | Get all hyperlinks on the page with URL and text. Options: `filter` (URL pattern to match) |
175
217
 
176
- ### Cookies
218
+ ### Frames / Iframes (2)
177
219
 
178
220
  | Tool | Description |
179
221
  |------|-------------|
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 |
222
+ | `list_frames` | List all frames and iframes in the page with index, name, and URL |
223
+ | `frame_evaluate` | Execute JavaScript inside a specific frame/iframe by name or index. Use for interacting with embedded content. |
183
224
 
184
- ### JavaScript
225
+ ### Batch Operations (3)
185
226
 
186
227
  | Tool | Description |
187
228
  |------|-------------|
188
- | `evaluate` | Execute JavaScript in page context and return result |
229
+ | `batch_actions` | Execute multiple actions in one call. Each action: `{type, ref?, value?, text?, key?, timeout?}`. Types: click, fill, type, press, select, check, uncheck, wait. Reduces round-trips significantly. |
230
+ | `fill_form` | Fill multiple form fields at once and optionally click submit. Takes array of `{ref, value}` pairs + optional `submit_ref`. |
231
+ | `navigate_and_snapshot` | Navigate to URL then return element snapshot — two operations in one call. Saves a round-trip. |
189
232
 
190
- ### Scroll
233
+ ### Viewport (2)
234
+
235
+ | Tool | Description |
236
+ |------|-------------|
237
+ | `get_viewport_size` | Get current viewport width and height in pixels |
238
+ | `set_viewport_size` | Set viewport dimensions. Use for testing responsive layouts. |
239
+
240
+ ### Scroll (1)
191
241
 
192
242
  | Tool | Description |
193
243
  |------|-------------|
194
244
  | `scroll` | Scroll page in any direction: `up`, `down`, `left`, `right` with configurable `amount` in pixels |
195
245
 
196
- ### Dialog
246
+ ### Dialog (1)
247
+
248
+ | Tool | Description |
249
+ |------|-------------|
250
+ | `dialog_handle` | Pre-set handler for the next browser dialog (alert/confirm/prompt). Options: `accept` or `dismiss`, with optional `prompt_text` for prompt dialogs. Must be called BEFORE the action that triggers the dialog. |
251
+
252
+ ### Accessibility (1)
197
253
 
198
254
  | Tool | Description |
199
255
  |------|-------------|
200
- | `dialog_handle` | Pre-set handler for next alert/confirm/prompt dialog: `accept` or `dismiss` |
256
+ | `accessibility_snapshot` | Get accessibility tree snapshot — compact hierarchical view of page structure with roles and names. Useful for LLM understanding of complex pages. |
201
257
 
202
- ### Debug
258
+ ### Console & Network Capture (4)
203
259
 
204
260
  | Tool | Description |
205
261
  |------|-------------|
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) |
262
+ | `console_start` | Start capturing browser console messages (log, warn, error, info) |
263
+ | `console_get` | Retrieve captured console messages since `console_start`. Shows last 50 messages with type and text. |
264
+ | `network_start` | Start capturing network requests and responses |
265
+ | `network_get` | Retrieve captured network requests since `network_start`. Shows last 50 with method, status, URL. |
266
+
267
+ ### Debug & Health (3)
268
+
269
+ | Tool | Description |
270
+ |------|-------------|
271
+ | `server_status` | Health check — shows browser status, active tab count, current URL, profile directory |
272
+ | `get_page_errors` | Get JavaScript errors from the current page |
273
+ | `export_har` | Export captured network traffic as HAR (HTTP Archive) file for analysis in browser dev tools |
210
274
 
211
275
  ## Usage Examples
212
276
 
213
- ### Basic: Open site and interact
277
+ ### Basic: Open and interact
214
278
 
215
279
  ```
216
280
  browser_launch(url="https://example.com", headless=false)
217
- browser_snapshot() # see all interactive elements
218
- click(ref="e5") # click an element
281
+ browser_snapshot()
282
+ click(ref="e5")
219
283
  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
284
+ screenshot()
285
+ browser_close()
223
286
  ```
224
287
 
225
288
  ### Login flow
@@ -227,22 +290,47 @@ browser_close() # done, cookies saved
227
290
  ```
228
291
  browser_launch(url="https://site.com/login")
229
292
  browser_snapshot()
230
- fill(ref="e3", value="user@email.com") # email
293
+ fill(ref="e3", value="user@email.com")
231
294
  click(ref="e5") # Continue
232
295
  wait_for(selector='input[type="password"]')
233
296
  browser_snapshot()
234
- fill(ref="e2", value="mypassword") # password
297
+ fill(ref="e2", value="mypassword")
235
298
  click(ref="e4") # Sign in
236
299
  wait_for_navigation()
237
300
  browser_snapshot() # verify logged in
238
301
  ```
239
302
 
303
+ ### Fill form in one call
304
+
305
+ ```
306
+ browser_snapshot()
307
+ fill_form(
308
+ fields=[
309
+ {ref: "e3", value: "John Doe"},
310
+ {ref: "e5", value: "john@example.com"},
311
+ {ref: "e7", value: "Hello world"}
312
+ ],
313
+ submit_ref="e10"
314
+ )
315
+ ```
316
+
317
+ ### Batch actions (reduce round-trips)
318
+
319
+ ```
320
+ batch_actions(actions=[
321
+ {type: "click", ref: "e5"},
322
+ {type: "wait", timeout: 1000},
323
+ {type: "fill", ref: "e8", value: "search query"},
324
+ {type: "press", key: "Enter"}
325
+ ])
326
+ ```
327
+
240
328
  ### Multi-tab research
241
329
 
242
330
  ```
243
331
  browser_launch(url="https://github.com")
244
332
  tab_new(url="https://stackoverflow.com")
245
- tab_list() # see both tabs
333
+ tab_list()
246
334
  tab_select(index=0) # switch to GitHub
247
335
  ```
248
336
 
@@ -251,15 +339,46 @@ tab_select(index=0) # switch to GitHub
251
339
  ```
252
340
  browser_launch(url="https://google.com")
253
341
  browser_snapshot()
254
- click(ref="e5") # click search box
342
+ click(ref="e5")
255
343
  type_text(text="mcp-camoufox npm")
256
344
  press_key(key="Enter")
257
345
  ```
258
346
 
259
- ## How It Works
347
+ ### Wait for API response
260
348
 
261
349
  ```
262
- AI Agent (Claude, Cursor, etc.)
350
+ click(ref="e10") # trigger action
351
+ wait_for_response(url_pattern="/api/data") # wait for API call
352
+ browser_snapshot() # see updated page
353
+ ```
354
+
355
+ ### Inspect and debug
356
+
357
+ ```
358
+ inspect_element(ref="e5") # detailed element info
359
+ get_links(filter="github.com") # all GitHub links
360
+ query_selector_all(selector=".product-card") # all matching elements
361
+ ```
362
+
363
+ ### Work with iframes
364
+
365
+ ```
366
+ list_frames()
367
+ frame_evaluate(frame_index=1, expression="document.title")
368
+ ```
369
+
370
+ ### Manage storage
371
+
372
+ ```
373
+ localstorage_get() # dump all localStorage
374
+ localstorage_set(key="token", value="abc123")
375
+ cookie_list(domain="example.com")
376
+ ```
377
+
378
+ ## Architecture
379
+
380
+ ```
381
+ AI Agent (Claude, Cursor, Windsurf, VS Code)
263
382
  |
264
383
  | MCP Protocol (stdio JSON-RPC)
265
384
  v
@@ -274,34 +393,34 @@ Camoufox (Patched Firefox binary)
274
393
  Website (Cloudflare, bot detection — bypassed)
275
394
  ```
276
395
 
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.
396
+ **Juggler, not CDP** Camoufox is Firefox-based. Sites that detect Chrome DevTools Protocol automation cannot detect Camoufox.
397
+
398
+ **Persistent profile** — Browser state stored at `~/.camoufox-mcp/profile/`. Cookies, localStorage, IndexedDB survive across sessions.
278
399
 
279
- **Why persistent context?** Browser profile is stored at `~/.camoufox-mcp/profile/`. Cookies, localStorage, and IndexedDB survive across sessions. Login once, stay logged in.
400
+ **Ref-based interaction** `browser_snapshot` tags elements with `data-mcp-ref` attributes. More token-efficient than raw HTML, more reliable than CSS selectors.
280
401
 
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.
402
+ **JS click fallback** When Playwright's actionability checks fail (element behind overlay), automatically falls back to `element.click()` via JavaScript.
282
403
 
283
404
  ## Persistent Data
284
405
 
285
406
  | Path | Purpose |
286
407
  |------|---------|
287
408
  | `~/.camoufox-mcp/profile/` | Browser profile (cookies, localStorage, cache) |
288
- | `~/.camoufox-mcp/screenshots/` | Screenshots and PDFs |
409
+ | `~/.camoufox-mcp/screenshots/` | Screenshots, PDFs, HAR exports |
289
410
 
290
- To reset (clear all cookies and sessions):
291
- ```bash
292
- rm -rf ~/.camoufox-mcp/profile/
293
- ```
411
+ Reset all data: `rm -rf ~/.camoufox-mcp/`
294
412
 
295
413
  ## Troubleshooting
296
414
 
297
415
  | Problem | Solution |
298
416
  |---------|----------|
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)` |
417
+ | "Browser not running" | Call `browser_launch` first |
418
+ | Click fails / element intercepted | Auto JS-fallback handles most cases. Try `press_key("Escape")` to dismiss overlays, then `browser_snapshot` |
419
+ | Stale ref IDs | Refs regenerate on each `browser_snapshot` call. Always snapshot after navigation. |
420
+ | Window too large | `browser_launch(width=1024, height=768)` |
302
421
  | 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. |
422
+ | Snapshot too large | Normal for element-heavy pages (Wikipedia). Use `get_text` or `evaluate` instead. |
423
+ | iframe content not accessible | Use `list_frames` + `frame_evaluate` to interact with iframe content |
305
424
 
306
425
  ## License
307
426
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mcp-camoufox",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
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",