mcp-camoufox 0.5.0 → 0.5.2
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/README.md +29 -4
- package/dist/index.js +32 -51
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
|
|
12
12
|
</div>
|
|
13
13
|
|
|
14
|
-
The most feature-rich stealth browser MCP server. **
|
|
14
|
+
The most feature-rich stealth browser MCP server. **79 tools** for full browser control powered by [Camoufox](https://github.com/daijro/camoufox) — a Firefox fork with C++ level anti-detection that bypasses Cloudflare, bot detection, and anti-automation.
|
|
15
15
|
|
|
16
16
|
> **One command. No Python. No manual setup. Everything auto-installs.**
|
|
17
17
|
|
|
@@ -39,7 +39,7 @@ claude mcp add camoufox -- npx -y mcp-camoufox@latest
|
|
|
39
39
|
| redf0x1/camofox-mcp | 45 | Yes | No (clone) | Yes |
|
|
40
40
|
| Sekinal/camoufox-mcp | 49 | Yes | No (clone) | Yes |
|
|
41
41
|
| Playwright CLI | 60+ | No | Yes | Yes |
|
|
42
|
-
| **[mcp-camoufox](https://github.com/RobithYusuf/mcp-camoufox)** | **
|
|
42
|
+
| **[mcp-camoufox](https://github.com/RobithYusuf/mcp-camoufox)** | **79** | **Yes** | **Yes** | **Yes** |
|
|
43
43
|
|
|
44
44
|
## Setup
|
|
45
45
|
|
|
@@ -234,7 +234,7 @@ Or via UI: Agent Panel > `...` > MCP Servers > Manage MCP Servers > View raw con
|
|
|
234
234
|
|
|
235
235
|
That's all. Camoufox browser binary (~80MB) downloads automatically on first launch.
|
|
236
236
|
|
|
237
|
-
## All
|
|
237
|
+
## All 79 Tools
|
|
238
238
|
|
|
239
239
|
### Browser Lifecycle (2)
|
|
240
240
|
|
|
@@ -395,6 +395,30 @@ That's all. Camoufox browser binary (~80MB) downloads automatically on first lau
|
|
|
395
395
|
| `console_start` / `console_get` | Capture and retrieve browser console messages |
|
|
396
396
|
| `network_start` / `network_get` | Capture and retrieve network requests |
|
|
397
397
|
|
|
398
|
+
### Compound (reduce round-trips) (4)
|
|
399
|
+
|
|
400
|
+
| Tool | Description |
|
|
401
|
+
|------|-------------|
|
|
402
|
+
| `wait_and_snapshot` | Wait for selector/text + return snapshot in one call |
|
|
403
|
+
| `back_and_snapshot` | Navigate back + return snapshot |
|
|
404
|
+
| `reload_and_snapshot` | Reload page + return snapshot |
|
|
405
|
+
| `click_and_snapshot` | Click + wait + return snapshot. Perfect for buttons that trigger navigation. |
|
|
406
|
+
|
|
407
|
+
### Smart Selectors (skip snapshot) (3)
|
|
408
|
+
|
|
409
|
+
| Tool | Description |
|
|
410
|
+
|------|-------------|
|
|
411
|
+
| `find_by_text` | Find element by visible text, returns ref. Skip `browser_snapshot` when you know exact text. |
|
|
412
|
+
| `find_by_label` | Find input by label text, returns ref. |
|
|
413
|
+
| `find_by_placeholder` | Find input by placeholder, returns ref. |
|
|
414
|
+
|
|
415
|
+
### Session Portability (2)
|
|
416
|
+
|
|
417
|
+
| Tool | Description |
|
|
418
|
+
|------|-------------|
|
|
419
|
+
| `cookie_export` | Export all cookies as JSON (for transfer) |
|
|
420
|
+
| `cookie_import` | Import cookies from JSON (restore session) |
|
|
421
|
+
|
|
398
422
|
### Scraping & Extraction (4)
|
|
399
423
|
|
|
400
424
|
| Tool | Description |
|
|
@@ -404,13 +428,14 @@ That's all. Camoufox browser binary (~80MB) downloads automatically on first lau
|
|
|
404
428
|
| `extract_table` | Extract HTML table as JSON array with auto-detected headers |
|
|
405
429
|
| `scrape_page` | Smart scraper: auto-extract main content (strips nav/footer), links, meta, headings. Smart truncation at paragraph boundary. |
|
|
406
430
|
|
|
407
|
-
### Debug (
|
|
431
|
+
### Debug (4)
|
|
408
432
|
|
|
409
433
|
| Tool | Description |
|
|
410
434
|
|------|-------------|
|
|
411
435
|
| `server_status` | Health check: browser status, tabs, URL |
|
|
412
436
|
| `get_page_errors` | JS errors from page |
|
|
413
437
|
| `export_har` | Export network traffic as HAR file |
|
|
438
|
+
| `page_stats` | Element count, page size, load metrics + extraction strategy recommendation |
|
|
414
439
|
|
|
415
440
|
## Examples
|
|
416
441
|
|
package/dist/index.js
CHANGED
|
@@ -113,6 +113,37 @@ const server = new McpServer({
|
|
|
113
113
|
version: "0.2.0",
|
|
114
114
|
});
|
|
115
115
|
// ── Tools: Browser Lifecycle ───────────────────────────────────────────────
|
|
116
|
+
async function ensureCamoufoxBinary() {
|
|
117
|
+
const { execSync } = await import("child_process");
|
|
118
|
+
const { existsSync } = await import("fs");
|
|
119
|
+
const { join: pathJoin } = await import("path");
|
|
120
|
+
const os = await import("os");
|
|
121
|
+
const homeDir = os.homedir();
|
|
122
|
+
const platform = os.platform();
|
|
123
|
+
let cacheDir;
|
|
124
|
+
if (platform === "darwin") {
|
|
125
|
+
cacheDir = pathJoin(homeDir, "Library", "Caches", "camoufox");
|
|
126
|
+
}
|
|
127
|
+
else if (platform === "win32") {
|
|
128
|
+
cacheDir = pathJoin(process.env.LOCALAPPDATA || pathJoin(homeDir, "AppData", "Local"), "camoufox");
|
|
129
|
+
}
|
|
130
|
+
else {
|
|
131
|
+
cacheDir = pathJoin(process.env.XDG_CACHE_HOME || pathJoin(homeDir, ".cache"), "camoufox");
|
|
132
|
+
}
|
|
133
|
+
const versionFile = pathJoin(cacheDir, "version.json");
|
|
134
|
+
if (existsSync(versionFile))
|
|
135
|
+
return;
|
|
136
|
+
console.error("\n" + "=".repeat(60));
|
|
137
|
+
console.error("[mcp-camoufox] First-time setup: downloading Camoufox (~500MB)");
|
|
138
|
+
console.error("[mcp-camoufox] Please wait 2-5 minutes...");
|
|
139
|
+
console.error("=".repeat(60) + "\n");
|
|
140
|
+
const cmd = platform === "win32" ? "npx.cmd" : "npx";
|
|
141
|
+
execSync(`${cmd} camoufox-js fetch`, {
|
|
142
|
+
stdio: "inherit", timeout: 900000,
|
|
143
|
+
env: { ...process.env, npm_config_yes: "true" },
|
|
144
|
+
});
|
|
145
|
+
console.error("\n[mcp-camoufox] Download complete.\n");
|
|
146
|
+
}
|
|
116
147
|
server.tool("browser_launch", "Launch Camoufox stealth browser and navigate to URL. Browser persists between calls. Call this first.", {
|
|
117
148
|
url: z.string().default("about:blank").describe("URL to navigate to"),
|
|
118
149
|
headless: z.boolean().default(true).describe("Run without visible window"),
|
|
@@ -133,57 +164,7 @@ server.tool("browser_launch", "Launch Camoufox stealth browser and navigate to U
|
|
|
133
164
|
ensureDirs();
|
|
134
165
|
const w = width > 0 ? width : 1280;
|
|
135
166
|
const h = height > 0 ? height : 800;
|
|
136
|
-
|
|
137
|
-
// camoufox-js does NOT auto-download — we handle it here
|
|
138
|
-
await (async () => {
|
|
139
|
-
const { execSync } = await import("child_process");
|
|
140
|
-
const { existsSync, readdirSync } = await import("fs");
|
|
141
|
-
const { join: pathJoin } = await import("path");
|
|
142
|
-
const os = await import("os");
|
|
143
|
-
// Detect cache dir per platform (same logic as camoufox-js pkgman.ts)
|
|
144
|
-
const homeDir = os.homedir();
|
|
145
|
-
const platform = os.platform();
|
|
146
|
-
let cacheDir;
|
|
147
|
-
if (platform === "darwin") {
|
|
148
|
-
cacheDir = pathJoin(homeDir, "Library", "Caches", "camoufox");
|
|
149
|
-
}
|
|
150
|
-
else if (platform === "win32") {
|
|
151
|
-
cacheDir = pathJoin(process.env.LOCALAPPDATA || pathJoin(homeDir, "AppData", "Local"), "camoufox");
|
|
152
|
-
}
|
|
153
|
-
else {
|
|
154
|
-
cacheDir = pathJoin(process.env.XDG_CACHE_HOME || pathJoin(homeDir, ".cache"), "camoufox");
|
|
155
|
-
}
|
|
156
|
-
// Check if binary exists (look for version.json inside cache dir)
|
|
157
|
-
const versionFile = pathJoin(cacheDir, "version.json");
|
|
158
|
-
const isInstalled = existsSync(versionFile);
|
|
159
|
-
if (!isInstalled) {
|
|
160
|
-
console.error("");
|
|
161
|
-
console.error("=".repeat(60));
|
|
162
|
-
console.error("[mcp-camoufox] First-time setup: downloading Camoufox browser");
|
|
163
|
-
console.error("[mcp-camoufox] This is ~500MB and only happens once.");
|
|
164
|
-
console.error("[mcp-camoufox] Please wait 2-5 minutes...");
|
|
165
|
-
console.error("=".repeat(60));
|
|
166
|
-
console.error("");
|
|
167
|
-
try {
|
|
168
|
-
// Use npx to run camoufox-js CLI fetch command
|
|
169
|
-
const cmd = platform === "win32" ? "npx.cmd" : "npx";
|
|
170
|
-
execSync(`${cmd} camoufox-js fetch`, {
|
|
171
|
-
stdio: "inherit",
|
|
172
|
-
timeout: 900000, // 15 min max
|
|
173
|
-
env: { ...process.env, npm_config_yes: "true" },
|
|
174
|
-
});
|
|
175
|
-
console.error("");
|
|
176
|
-
console.error("[mcp-camoufox] Download complete! Browser ready.");
|
|
177
|
-
console.error("");
|
|
178
|
-
}
|
|
179
|
-
catch (fetchErr) {
|
|
180
|
-
console.error(`[mcp-camoufox] Auto-download failed: ${fetchErr.message?.slice(0, 200)}`);
|
|
181
|
-
console.error("[mcp-camoufox] Try manually: npx camoufox-js fetch");
|
|
182
|
-
throw new Error("Camoufox browser binary not found. Auto-download failed. " +
|
|
183
|
-
"Please run manually: npx camoufox-js fetch");
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
})();
|
|
167
|
+
await ensureCamoufoxBinary();
|
|
187
168
|
const ctx = await Camoufox({
|
|
188
169
|
headless,
|
|
189
170
|
humanize,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mcp-camoufox",
|
|
3
|
-
"version": "0.5.
|
|
4
|
-
"description": "MCP server for stealth browser automation via Camoufox —
|
|
3
|
+
"version": "0.5.2",
|
|
4
|
+
"description": "MCP server for stealth browser automation via Camoufox — 79 tools, Chrome DevTools MCP-level power with anti-bot stealth",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"bin": {
|