mcp-camoufox 0.4.6 → 0.4.8

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/dist/index.js +22 -0
  2. package/package.json +3 -2
package/dist/index.js CHANGED
@@ -133,6 +133,28 @@ server.tool("browser_launch", "Launch Camoufox stealth browser and navigate to U
133
133
  ensureDirs();
134
134
  const w = width > 0 ? width : 1280;
135
135
  const h = height > 0 ? height : 800;
136
+ // Auto-download Camoufox binary if not installed
137
+ try {
138
+ const { execSync } = await import("child_process");
139
+ const { existsSync, readdirSync } = await import("fs");
140
+ const { join: pathJoin } = await import("path");
141
+ // Check common cache locations
142
+ const homeDir = process.env.HOME || process.env.USERPROFILE || "";
143
+ const cacheLocations = [
144
+ pathJoin(homeDir, ".cache", "camoufox"),
145
+ pathJoin(homeDir, "Library", "Caches", "camoufox"),
146
+ pathJoin(homeDir, "AppData", "Local", "camoufox"),
147
+ ];
148
+ const isInstalled = cacheLocations.some(dir => existsSync(dir) && readdirSync(dir).length > 2);
149
+ if (!isInstalled) {
150
+ console.error("[mcp-camoufox] Camoufox browser not found. Auto-downloading (~500MB, one-time)...");
151
+ execSync("npx camoufox-js fetch", { stdio: "inherit", timeout: 600000 });
152
+ console.error("[mcp-camoufox] Download complete.");
153
+ }
154
+ }
155
+ catch (e) {
156
+ console.error(`[mcp-camoufox] Auto-download check: ${e.message?.slice(0, 100)}`);
157
+ }
136
158
  const ctx = await Camoufox({
137
159
  headless,
138
160
  humanize,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mcp-camoufox",
3
- "version": "0.4.6",
3
+ "version": "0.4.8",
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",
@@ -16,7 +16,8 @@
16
16
  "build": "tsc",
17
17
  "start": "node dist/index.js",
18
18
  "dev": "tsc --watch",
19
- "prepublishOnly": "npm run build"
19
+ "prepublishOnly": "npm run build",
20
+ "postinstall": "npx camoufox-js fetch || echo '[mcp-camoufox] Browser will download on first launch.'"
20
21
  },
21
22
  "keywords": [
22
23
  "mcp",