unbrowse 2.11.0 → 2.12.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.
package/README.md CHANGED
@@ -2,14 +2,43 @@
2
2
 
3
3
  This package installs the `unbrowse` CLI.
4
4
 
5
- Turn any website into a reusable API interface for agents. Unbrowse captures network traffic, reverse-engineers the real endpoints underneath the UI, and stores what it learns in a shared marketplace so the next agent can reuse it instantly.
5
+ Unbrowse is a local Model Context Protocol (MCP) server and CLI that turns any website into a reusable API interface for agents. It captures network traffic, reverse-engineers the real endpoints underneath the UI, and stores what it learns in a shared marketplace so the next agent can reuse it instantly.
6
6
 
7
7
  One agent learns a site once. Every later agent gets the fast path.
8
8
 
9
- Unbrowse is a drop-in browser for agents: same browser-shaped job in the stack, but with route learning, reuse, and browser fallback built in.
9
+ Unbrowse is a drop-in replacement for OpenClaw / `agent-browser` browser flows for agents: on the API-native path it is typically ~30x faster, ~90% cheaper, and turns repeated browser work into reusable route assets.
10
10
 
11
11
  > Security note: capture and execution stay local by default. Credentials stay on your machine. Learned API contracts are published to the shared marketplace only after capture. See [SKILL.md](./SKILL.md) for the full agent-facing API reference and tool-policy guidance.
12
12
 
13
+ ## MCP server
14
+
15
+ Unbrowse implements the Model Context Protocol over stdio. `unbrowse mcp` is the MCP server entrypoint.
16
+
17
+ - Protocol: JSON-RPC 2.0 MCP over stdio
18
+ - Handshake: `initialize`, `notifications/initialized`, `ping`
19
+ - Capability surface today: `tools/list` and `tools/call`
20
+ - Current MCP shape: tools only. No `resources/*` or `prompts/*` methods yet.
21
+ - Runtime model: the MCP server fronts the local Unbrowse runtime on `http://localhost:6969`; hosts talk standard MCP, and Unbrowse uses the local HTTP runtime behind the scenes.
22
+
23
+ Core MCP tools:
24
+
25
+ - Discovery: `unbrowse_health`, `unbrowse_search`, `unbrowse_resolve`, `unbrowse_execute`, `unbrowse_feedback`
26
+ - Auth/cache: `unbrowse_login`, `unbrowse_skills`, `unbrowse_skill`, `unbrowse_sessions`
27
+ - Browser capture: `unbrowse_go`, `unbrowse_snap`, `unbrowse_click`, `unbrowse_fill`, `unbrowse_type`, `unbrowse_press`, `unbrowse_select`, `unbrowse_scroll`, `unbrowse_submit`, `unbrowse_screenshot`, `unbrowse_text`, `unbrowse_markdown`, `unbrowse_cookies`, `unbrowse_eval`, `unbrowse_sync`, `unbrowse_close`
28
+
29
+ Typical MCP host config:
30
+
31
+ ```json
32
+ {
33
+ "mcpServers": {
34
+ "unbrowse": {
35
+ "command": "npx",
36
+ "args": ["-y", "unbrowse", "mcp"]
37
+ }
38
+ }
39
+ }
40
+ ```
41
+
13
42
  ## Quick start
14
43
 
15
44
  ```bash
@@ -18,9 +47,13 @@ git clone --single-branch --depth 1 https://github.com/unbrowse-ai/unbrowse.git
18
47
  cd ~/unbrowse && ./setup --host off
19
48
  ```
20
49
 
21
- `./setup` installs repo dependencies, prebuilds the packaged CLI runtime, installs a stable `unbrowse` shim, and then runs the real first-time bootstrap: ToS acceptance, agent registration + API-key caching, and lobster.cash wallet detection when present.
50
+ `./setup` installs repo dependencies, prebuilds the packaged CLI runtime, installs a stable `unbrowse` shim, and then runs the real first-time bootstrap: ToS acceptance, agent registration + API-key caching, and wallet detection when present.
22
51
 
23
- If a wallet is configured, that wallet address is synced onto your agent profile and becomes the destination for contributor payouts when your routes earn.
52
+ If a wallet is configured, that wallet address becomes the contributor/payment truth: it is synced onto your agent profile, used as the destination for contributor payouts when your routes earn, and used as the spending wallet for paid marketplace routes.
53
+
54
+ Recommended for new installs: set up Crossmint `lobster.cash` during bootstrap. `unbrowse setup` now encourages it, and when the tooling is already present it will try `npx @crossmint/lobster-cli setup` automatically. That wallet becomes the payout destination for contributed routes and the spending wallet for paid marketplace routes.
55
+
56
+ Unbrowse supports wallet providers such as Crossmint `lobster.cash` for x402-gated routes. If you use `lobster.cash`, set `LOBSTER_WALLET_ADDRESS`. Other providers can use `AGENT_WALLET_ADDRESS` and optional `AGENT_WALLET_PROVIDER`.
24
57
 
25
58
  For repeat npm use after a healthy publish:
26
59
 
@@ -29,6 +62,15 @@ npm install -g unbrowse
29
62
  unbrowse setup
30
63
  ```
31
64
 
65
+ For generic MCP hosts:
66
+
67
+ ```bash
68
+ git clone --single-branch --depth 1 https://github.com/unbrowse-ai/unbrowse.git ~/unbrowse
69
+ cd ~/unbrowse && ./setup --host mcp
70
+ ```
71
+
72
+ That writes a ready-to-import MCP config to `~/.config/unbrowse/mcp/unbrowse.json`. A generic template is also published at [`/mcp.json`](https://www.unbrowse.ai/mcp.json).
73
+
32
74
  If your agent host uses skills:
33
75
 
34
76
  ```bash
@@ -39,6 +81,14 @@ npx skills add unbrowse-ai/unbrowse
39
81
 
40
82
  Unbrowse no longer self-updates at runtime. If you already have Unbrowse installed, upgrade to the latest version after each release or the new flow may not work on your machine.
41
83
 
84
+ Check the exact command for your install with:
85
+
86
+ ```bash
87
+ unbrowse upgrade
88
+ ```
89
+
90
+ Codex and Claude installs now also get a session-start update hint during `unbrowse setup`, so newer releases are surfaced in the host before the CLI drifts too far behind.
91
+
42
92
  If you installed from a repo clone:
43
93
 
44
94
  ```bash
@@ -47,6 +97,14 @@ git pull --ff-only
47
97
  ./setup --host off
48
98
  ```
49
99
 
100
+ If you installed for a generic MCP host:
101
+
102
+ ```bash
103
+ cd ~/unbrowse
104
+ git pull --ff-only
105
+ ./setup --host mcp
106
+ ```
107
+
50
108
  If your agent host uses skills, rerun its skill install/update command too:
51
109
 
52
110
  ```bash
@@ -55,30 +113,33 @@ npx skills add unbrowse-ai/unbrowse
55
113
 
56
114
  Need help or want release updates? Join the Discord: [discord.gg/VWugEeFNsG](https://discord.gg/VWugEeFNsG)
57
115
 
58
- Every CLI command auto-starts the local server on `http://localhost:6969` by default. Override with `UNBROWSE_URL`, `PORT`, or `HOST`. On first startup it auto-registers as an agent with the marketplace and caches credentials in `~/.unbrowse/config.json`. `unbrowse setup` prompts for an email-shaped identity first; headless setups can provide `UNBROWSE_AGENT_EMAIL`.
59
- Canonical docs: [docs.unbrowse.ai](https://docs.unbrowse.ai)
60
-
61
- Every CLI command auto-starts the local server on `http://localhost:6969` by default. Override with `UNBROWSE_URL`, `PORT`, or `HOST`. On first startup it auto-registers as an agent with the marketplace and caches credentials in `~/.unbrowse/config.json`. `unbrowse setup` now prompts for an email-shaped identity first; headless setups can provide `UNBROWSE_AGENT_EMAIL`.
116
+ Every CLI command auto-starts the local runtime on `http://localhost:6969` by default, and `unbrowse mcp` uses that same runtime behind the MCP stdio surface. Override with `UNBROWSE_URL`, `PORT`, or `HOST`. On first startup it auto-registers as an agent with the marketplace and caches credentials in `~/.unbrowse/config.json`. `unbrowse setup` now prompts for an email-shaped identity first; headless setups can provide `UNBROWSE_AGENT_EMAIL`.
117
+ Public companion docs: [docs.unbrowse.ai](https://docs.unbrowse.ai)
62
118
 
63
119
  Works with Claude Code, Open Code, Cursor, Codex, Windsurf, and any agent host that can call a local CLI or skill.
64
120
 
65
121
  ## What setup does
66
122
 
67
- - Checks local prerequisites for the npm/npx flow.
123
+ - Checks the local runtime/package-manager environment for the repo bootstrap or packaged CLI path.
124
+ - Prebuilds the packaged CLI runtime and installs the stable `unbrowse` shim for the repo bootstrap path.
68
125
  - Verifies the bundled Kuri binary, or builds it from the vendored Kuri source when working from repo source with Zig installed.
69
126
  - Registers the Open Code `/unbrowse` command when Open Code is present.
127
+ - Runs the first-use flow: ToS, agent registration/API-key caching, wallet detection, and Crossmint `lobster.cash` encouragement.
70
128
  - Starts the local Unbrowse server unless `--no-start` is passed.
71
129
 
72
130
  ## Common commands
73
131
 
74
132
  ```bash
75
133
  unbrowse health
134
+ unbrowse mcp
76
135
  unbrowse resolve --intent "get trending searches" --url "https://google.com" --pretty
77
136
  unbrowse login --url "https://calendar.google.com"
78
137
  unbrowse skills
79
138
  unbrowse search --intent "get stock prices"
80
139
  ```
81
140
 
141
+ For most MCP hosts, the standard flow is `unbrowse_resolve` first, then `unbrowse_execute`. For JS-heavy or first-time capture workflows, use the browser tool chain: `unbrowse_go -> unbrowse_snap -> action tools -> unbrowse_submit/unbrowse_sync -> unbrowse_close`.
142
+
82
143
  ## Demo notes
83
144
 
84
145
  - First-time capture/indexing on a site can take 20-80 seconds. That is the slow path; repeats should be much faster.
@@ -91,12 +152,18 @@ If you tried Unbrowse on a site or API and could not get it to work, add it to [
91
152
 
92
153
  ## Docs
93
154
 
94
- The synced skill repo also carries the longer-form docs set:
155
+ The synced skill repo also carries the public docs set:
156
+
157
+ - [Quickstart](./docs/guides/quickstart.md)
158
+ - [API reference](./docs/api.md)
159
+ - [Deployment guide](./docs/deployment.md)
160
+ - [Release checklist](./docs/RELEASING.md)
161
+
162
+ Whitepaper companion docs:
95
163
 
96
164
  - [Whitepaper companion index](./docs/whitepaper/README.md)
97
165
  - [For Technical Readers](./docs/whitepaper/for-technical-readers.md)
98
166
  - [For Investors](./docs/whitepaper/for-investors.md)
99
- - [Analytics API](./docs/analytics-api.md)
100
167
 
101
168
  ## How it works
102
169
 
@@ -0,0 +1,22 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { dirname, join } from "node:path";
4
+ import { fileURLToPath } from "node:url";
5
+ import { spawn } from "node:child_process";
6
+
7
+ const __dirname = dirname(fileURLToPath(import.meta.url));
8
+ const cliPath = join(__dirname, "..", "dist", "cli.js");
9
+
10
+ const child = spawn(process.execPath, [cliPath, "upgrade", "--hint-only"], {
11
+ stdio: "inherit",
12
+ cwd: process.cwd(),
13
+ env: process.env,
14
+ });
15
+
16
+ child.on("exit", (code, signal) => {
17
+ if (signal) {
18
+ process.kill(process.pid, signal);
19
+ return;
20
+ }
21
+ process.exit(code ?? 0);
22
+ });
@@ -5,35 +5,106 @@
5
5
  * falls back to the package-managed Node launcher if not.
6
6
  */
7
7
 
8
- import { existsSync } from "node:fs";
8
+ import { existsSync, readFileSync } from "node:fs";
9
+ import { createRequire } from "node:module";
9
10
  import { join, dirname } from "node:path";
10
11
  import { fileURLToPath } from "node:url";
11
12
  import { spawn } from "node:child_process";
12
13
 
13
14
  const __dirname = dirname(fileURLToPath(import.meta.url));
15
+ const packageRoot = join(__dirname, "..");
14
16
  const binaryPath = join(__dirname, "unbrowse");
17
+ const launcherPath = join(__dirname, "unbrowse.js");
18
+ const require = createRequire(import.meta.url);
15
19
 
16
- if (existsSync(binaryPath)) {
17
- // Compiled binary — exec directly, replace this process
18
- const child = spawn(binaryPath, process.argv.slice(2), {
20
+ const REQUIRED_FALLBACK_PACKAGES = [
21
+ "tsx",
22
+ "bs58",
23
+ "@solana/kit",
24
+ "@cascade-fyi/splits-sdk",
25
+ ];
26
+
27
+ const KNOWN_BAD_FALLBACK_VERSIONS = new Set([
28
+ "2.10.2",
29
+ ]);
30
+
31
+ function readInstalledVersion() {
32
+ try {
33
+ const pkg = JSON.parse(readFileSync(join(packageRoot, "package.json"), "utf8"));
34
+ return typeof pkg.version === "string" ? pkg.version : "unknown";
35
+ } catch {
36
+ return "unknown";
37
+ }
38
+ }
39
+
40
+ function printRepairHelp(reason) {
41
+ const installedVersion = readInstalledVersion();
42
+ const lines = [
43
+ `[unbrowse] ${reason}`,
44
+ `[unbrowse] Installed package version: ${installedVersion}`,
45
+ "[unbrowse] Repair: npm uninstall -g unbrowse && npm install -g unbrowse@latest",
46
+ ];
47
+ process.stderr.write(lines.join("\n") + "\n");
48
+ }
49
+
50
+ function failInstall(reason, exitCode = 1) {
51
+ printRepairHelp(reason);
52
+ process.exit(exitCode);
53
+ }
54
+
55
+ function missingFallbackPackages() {
56
+ const missing = [];
57
+ for (const specifier of REQUIRED_FALLBACK_PACKAGES) {
58
+ try {
59
+ require.resolve(specifier);
60
+ } catch {
61
+ missing.push(specifier);
62
+ }
63
+ }
64
+ return missing;
65
+ }
66
+
67
+ function spawnEntrypoint(command, args) {
68
+ const child = spawn(command, args, {
19
69
  stdio: "inherit",
70
+ cwd: process.cwd(),
20
71
  env: process.env,
21
72
  });
73
+ child.on("error", (error) => {
74
+ const details = error instanceof Error ? error.message : String(error);
75
+ if (error && typeof error === "object" && "code" in error && error.code === "EACCES") {
76
+ failInstall(`Launch target is not executable (${command}). Global install permissions are corrupted.`);
77
+ }
78
+ failInstall(`Failed to launch ${command}: ${details}`);
79
+ });
22
80
  child.on("exit", (code, signal) => {
23
81
  if (signal) { process.kill(process.pid, signal); return; }
24
82
  process.exit(code ?? 1);
25
83
  });
84
+ }
85
+
86
+ if (process.argv.includes("--version") || process.argv.includes("-v")) {
87
+ process.stdout.write(`${readInstalledVersion()}\n`);
88
+ process.exit(0);
89
+ }
90
+
91
+ if (existsSync(binaryPath)) {
92
+ // Compiled binary — exec directly, replace this process
93
+ spawnEntrypoint(binaryPath, process.argv.slice(2));
26
94
  } else {
95
+ const installedVersion = readInstalledVersion();
96
+ if (KNOWN_BAD_FALLBACK_VERSIONS.has(installedVersion)) {
97
+ failInstall(
98
+ `Installed package version ${installedVersion} is known-bad in source fallback mode and shipped an incomplete runtime dependency set.`,
99
+ );
100
+ }
101
+
102
+ const missing = missingFallbackPackages();
103
+ if (missing.length > 0) {
104
+ failInstall(`Fallback runtime is missing required packages: ${missing.join(", ")}.`);
105
+ }
106
+
27
107
  // Fallback: delegate to the stable package launcher so
28
108
  // npm installs and npx use the same dependency resolution path.
29
- const launcherPath = join(__dirname, "unbrowse.js");
30
- const child = spawn(process.execPath, [launcherPath, ...process.argv.slice(2)], {
31
- stdio: "inherit",
32
- cwd: process.cwd(),
33
- env: process.env,
34
- });
35
- child.on("exit", (code, signal) => {
36
- if (signal) { process.kill(process.pid, signal); return; }
37
- process.exit(code ?? 1);
38
- });
109
+ spawnEntrypoint(process.execPath, [launcherPath, ...process.argv.slice(2)]);
39
110
  }