@browsa/mcp 0.8.1 → 0.8.3

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/dist/server.js CHANGED
@@ -12,7 +12,7 @@ import {
12
12
 
13
13
  // src/captcha/catalogue-snapshot.json
14
14
  var catalogue_snapshot_default = {
15
- asOf: "2026-11-21",
15
+ asOf: "2026-11-22",
16
16
  service: "https://captcha.browsa.io",
17
17
  types: [
18
18
  {
@@ -33,7 +33,7 @@ var catalogue_snapshot_default = {
33
33
  "websiteURL"
34
34
  ],
35
35
  proxy: "none",
36
- credits: 4e-3
36
+ credits: 0.01
37
37
  },
38
38
  {
39
39
  type: "ReCaptchaV2Classification",
@@ -135,8 +135,7 @@ var catalogue_snapshot_default = {
135
135
  title: "Rotate the disc",
136
136
  kind: "recognition",
137
137
  family: "rotate",
138
- status: "off",
139
- offReason: "switched off until a measured run passes",
138
+ status: "live",
140
139
  required: [
141
140
  "imageDisc",
142
141
  "imageBackground"
@@ -145,6 +144,7 @@ var catalogue_snapshot_default = {
145
144
  optional: [
146
145
  "discCssWidth",
147
146
  "bgCssWidth",
147
+ "discCenter",
148
148
  "websiteURL"
149
149
  ],
150
150
  proxy: "none",
@@ -155,14 +155,20 @@ var catalogue_snapshot_default = {
155
155
  title: "Click in order",
156
156
  kind: "recognition",
157
157
  family: "click_order",
158
- status: "off",
159
- offReason: "switched off until a measured run passes",
158
+ status: "live",
160
159
  required: [
161
160
  "image"
162
161
  ],
163
162
  oneOf: [],
164
163
  optional: [
165
164
  "references",
165
+ "referenceStrip",
166
+ "referenceCrop",
167
+ "split",
168
+ "crop",
169
+ "snap",
170
+ "what",
171
+ "strongFirst",
166
172
  "order",
167
173
  "count",
168
174
  "websiteURL"
@@ -170,6 +176,213 @@ var catalogue_snapshot_default = {
170
176
  proxy: "none",
171
177
  credits: 0.01
172
178
  },
179
+ {
180
+ type: "GeeTestGridTask",
181
+ title: "GeeTest v4 IconCrush and gobang",
182
+ kind: "recognition",
183
+ family: "geetest_v4_grid",
184
+ status: "live",
185
+ required: [
186
+ "kind",
187
+ "grid"
188
+ ],
189
+ oneOf: [],
190
+ optional: [
191
+ "websiteURL"
192
+ ],
193
+ proxy: "none",
194
+ credits: 8e-3
195
+ },
196
+ {
197
+ type: "GeeTestIconTask",
198
+ title: "GeeTest v4 icons in order",
199
+ kind: "recognition",
200
+ family: "geetest_v4_icon",
201
+ status: "live",
202
+ required: [
203
+ "image",
204
+ "references"
205
+ ],
206
+ oneOf: [],
207
+ optional: [
208
+ "hints",
209
+ "websiteURL"
210
+ ],
211
+ proxy: "none",
212
+ credits: 0.01
213
+ },
214
+ {
215
+ type: "GeeTestNineTask",
216
+ title: "GeeTest v4 nine photos",
217
+ kind: "recognition",
218
+ family: "geetest_v4_nine",
219
+ status: "live",
220
+ required: [
221
+ "reference"
222
+ ],
223
+ oneOf: [
224
+ [
225
+ "image",
226
+ "images"
227
+ ]
228
+ ],
229
+ optional: [
230
+ "count",
231
+ "tileBoxes",
232
+ "websiteURL"
233
+ ],
234
+ proxy: "none",
235
+ credits: 0.01
236
+ },
237
+ {
238
+ type: "GeeTestShapeTask",
239
+ title: "GeeTest v4 matching shape",
240
+ kind: "recognition",
241
+ family: "geetest_v4_svg",
242
+ status: "live",
243
+ required: [
244
+ "reference",
245
+ "frames",
246
+ "tileBoxes"
247
+ ],
248
+ oneOf: [],
249
+ optional: [
250
+ "websiteURL"
251
+ ],
252
+ proxy: "none",
253
+ credits: 0.01
254
+ },
255
+ {
256
+ type: "SliderGapTask",
257
+ title: "Slider gap (piece picture)",
258
+ kind: "recognition",
259
+ family: "slider_gap",
260
+ status: "live",
261
+ required: [
262
+ "imageBackground",
263
+ "imageSlice",
264
+ "top",
265
+ "bgCssWidth"
266
+ ],
267
+ oneOf: [],
268
+ optional: [
269
+ "sliceCssWidth",
270
+ "sliceCssHeight",
271
+ "sliceSprite",
272
+ "candidates",
273
+ "websiteURL"
274
+ ],
275
+ proxy: "none",
276
+ credits: 8e-3
277
+ },
278
+ {
279
+ type: "TileSwapTask",
280
+ title: "Swap two tiles",
281
+ kind: "recognition",
282
+ family: "tile_swap",
283
+ status: "live",
284
+ required: [
285
+ "image",
286
+ "rows",
287
+ "cols"
288
+ ],
289
+ oneOf: [],
290
+ optional: [
291
+ "websiteURL"
292
+ ],
293
+ proxy: "none",
294
+ credits: 8e-3
295
+ },
296
+ {
297
+ type: "JigsawTask",
298
+ title: "Jigsaw with decoy holes",
299
+ kind: "recognition",
300
+ family: "cutcaptcha",
301
+ status: "live",
302
+ required: [
303
+ "imageBackground",
304
+ "pieces"
305
+ ],
306
+ oneOf: [],
307
+ optional: [
308
+ "websiteURL"
309
+ ],
310
+ proxy: "none",
311
+ credits: 8e-3
312
+ },
313
+ {
314
+ type: "MtCaptchaTask",
315
+ title: "MTCaptcha",
316
+ kind: "recognition",
317
+ family: "mtcaptcha",
318
+ status: "live",
319
+ required: [
320
+ "body"
321
+ ],
322
+ oneOf: [],
323
+ optional: [
324
+ "escalate",
325
+ "websiteURL"
326
+ ],
327
+ proxy: "none",
328
+ credits: 0.01
329
+ },
330
+ {
331
+ type: "CyberSiaraTask",
332
+ title: "CyberSiARA animated letters",
333
+ kind: "recognition",
334
+ family: "cybersiara",
335
+ status: "live",
336
+ required: [],
337
+ oneOf: [
338
+ [
339
+ "body",
340
+ "images"
341
+ ]
342
+ ],
343
+ optional: [
344
+ "escalate",
345
+ "websiteURL"
346
+ ],
347
+ proxy: "none",
348
+ credits: 0.01
349
+ },
350
+ {
351
+ type: "AudioTask",
352
+ title: "Audio challenge",
353
+ kind: "recognition",
354
+ family: "recaptcha_audio",
355
+ status: "live",
356
+ required: [
357
+ "body"
358
+ ],
359
+ oneOf: [],
360
+ optional: [
361
+ "lang",
362
+ "websiteURL"
363
+ ],
364
+ proxy: "none",
365
+ credits: 0.01
366
+ },
367
+ {
368
+ type: "HCaptchaTask",
369
+ title: "hCaptcha challenge (picture in, actions out)",
370
+ kind: "recognition",
371
+ family: "hcaptcha",
372
+ status: "live",
373
+ required: [
374
+ "image",
375
+ "prompt"
376
+ ],
377
+ oneOf: [],
378
+ optional: [
379
+ "frameWidth",
380
+ "frameHeight",
381
+ "websiteURL"
382
+ ],
383
+ proxy: "none",
384
+ credits: 0.03
385
+ },
173
386
  {
174
387
  type: "TextCaptchaTask",
175
388
  title: "Question in words",
@@ -469,7 +682,8 @@ var catalogue_snapshot_default = {
469
682
  import { BrowsaError } from "browsa";
470
683
 
471
684
  // src/config.ts
472
- var VERSION = "0.8.1";
685
+ var VERSION = "0.8.3";
686
+ var USER_AGENT = `browsa-mcp/${VERSION}`;
473
687
  var API_KEY = process.env.BROWSA_API_KEY?.trim() || void 0;
474
688
  var BASE_URL = (process.env.BROWSA_BASE_URL || "https://browsa.io").replace(/\/+$/, "");
475
689
  var BASE_URL_SET = !!process.env.BROWSA_BASE_URL;
@@ -615,6 +829,7 @@ async function fetchRetry(url, init, opts) {
615
829
  }
616
830
 
617
831
  // src/captcha/client.ts
832
+ var CAPTCHA_UA = `${USER_AGENT} (captcha)`;
618
833
  var CAPTCHA_URL = (process.env.BROWSA_CAPTCHA_URL || (BASE_URL_SET ? `${BASE_URL}/captcha-api` : "https://captcha.browsa.io")).replace(/\/+$/, "");
619
834
  var POLL_MS = numEnv("BROWSA_CAPTCHA_POLL_MS", 3e3, 1);
620
835
  var WAIT_S = 20;
@@ -622,9 +837,9 @@ var IDEMPOTENT = /* @__PURE__ */ new Set(["types", "errors", "health", "getTaskR
622
837
  async function captchaCall(method, payload, opts = {}) {
623
838
  const timeoutMs = opts.timeoutMs ?? 3e4;
624
839
  const retries = opts.retries ?? RETRIES;
625
- const init = () => payload === null ? { method: "GET", headers: { Accept: "application/json", "User-Agent": "browsa-mcp" }, signal: AbortSignal.timeout(timeoutMs) } : {
840
+ const init = () => payload === null ? { method: "GET", headers: { Accept: "application/json", "User-Agent": CAPTCHA_UA }, signal: AbortSignal.timeout(timeoutMs) } : {
626
841
  method: "POST",
627
- headers: { "Content-Type": "application/json", Accept: "application/json", "User-Agent": "browsa-mcp" },
842
+ headers: { "Content-Type": "application/json", Accept: "application/json", "User-Agent": CAPTCHA_UA },
628
843
  body: JSON.stringify({ clientKey: API_KEY, ...payload }),
629
844
  signal: AbortSignal.timeout(timeoutMs)
630
845
  };
@@ -1618,7 +1833,7 @@ function annotate2(tool) {
1618
1833
  // src/api.ts
1619
1834
  import { BrowsaError as BrowsaError3 } from "browsa";
1620
1835
  function headers(json) {
1621
- const h = { "X-API-Key": API_KEY ?? "", Accept: "application/json", "User-Agent": `browsa-mcp/${VERSION}` };
1836
+ const h = { "X-API-Key": API_KEY ?? "", Accept: "application/json", "User-Agent": USER_AGENT };
1622
1837
  if (json) h["Content-Type"] = "application/json";
1623
1838
  return h;
1624
1839
  }
@@ -1938,7 +2153,8 @@ var coreTools = [
1938
2153
  country: { type: "string", description: "Exit country, e.g. us. Needs a proxy." },
1939
2154
  profile: { type: "string", description: "Saved identity id: keeps its cookies and logins." },
1940
2155
  proxy: { type: "object", description: "{network: datacenter|residential, country?} or your own {server, username?, password?}." },
1941
- ttl: { type: "string", description: "e.g. 10m (default), 1h." }
2156
+ ttl: { type: "string", description: "e.g. 10m (default), 1h, 8h (up to 24h), or until_stopped (runs until close, 30 min idle, or out of credits). Over 1h needs purchased credits." },
2157
+ idle_timeout: { type: "string", description: "Stop after this long with nothing connected, e.g. 10m; off = never." }
1942
2158
  }
1943
2159
  }
1944
2160
  },
@@ -2161,12 +2377,15 @@ async function open(args) {
2161
2377
  if (country) body.country = country;
2162
2378
  if (args.profile) body.agent_id = args.profile;
2163
2379
  if (args.proxy) body.proxy = args.proxy;
2380
+ if (args.idle_timeout) body.idle_timeout = args.idle_timeout;
2164
2381
  const a = await apiPost("/v1/agents", body, 12e4);
2165
2382
  const id = String(a.id);
2166
2383
  const b = stateOf(id);
2167
2384
  lastBrowser = id;
2168
2385
  const egress = args.proxy?.network ? `Browsa ${args.proxy.network} proxy` : args.proxy ? "your proxy" : "Browsa's address";
2169
- const head = [`ok: browser ${id} is open (Phantom, cloud, ${egress}), expires ${a.expires_at ?? "with its ttl"}; close it when done`];
2386
+ const ends = a.until_stopped ? "runs until you close it" : `expires ${a.expires_at ?? "with its ttl"}`;
2387
+ const head = [`ok: browser ${id} is open (Phantom, cloud, ${egress}), ${ends}; close it when done`];
2388
+ for (const w of Array.isArray(a.warnings) ? a.warnings : []) if (/ttl|until/i.test(String(w))) head.push(`note: ${w}`);
2170
2389
  if (a.live_url) head.push(`live view (single use, for a person): ${a.live_url}`);
2171
2390
  if (!args.url) {
2172
2391
  head.push("the page is blank; next: act with action navigate and a url");
@@ -2600,6 +2819,14 @@ var legacyTools = [
2600
2819
  type: "boolean",
2601
2820
  description: "Set false to stop the run from saving a login it creates as a workspace secret (on by default)."
2602
2821
  },
2822
+ keep_open: {
2823
+ type: "string",
2824
+ description: 'Keep the browser open after the task: "15m", "1h", "4h", "8h", "24h", any duration, or "until_stopped"; "none" (the default here) closes it. The result\'s `browser` gives its agent_id, expires_at and live_url, so the user can take over, extend it (POST /v1/agents/{id}/extend) or send a follow-up task on it (POST /v1/sessions/{session_id}/messages). Billed per minute like any browser; over 1h and until_stopped need a workspace that has bought credits.'
2825
+ },
2826
+ idle_timeout: {
2827
+ type: "string",
2828
+ description: 'With keep_open: stop after this long with nothing connected, e.g. "10m"; "off" = never.'
2829
+ },
2603
2830
  timeout_minutes: {
2604
2831
  type: "integer",
2605
2832
  description: "Max wall-clock minutes to wait before returning. Default 10.",
@@ -2653,7 +2880,8 @@ var legacyTools = [
2653
2880
  inputSchema: {
2654
2881
  type: "object",
2655
2882
  properties: {
2656
- ttl: { type: "string", description: 'How long to keep it, e.g. "5m" or "1h". Default 10m.' },
2883
+ ttl: { type: "string", description: 'How long to keep it, e.g. "5m", "1h", "8h" (up to 24h) or "until_stopped". Default 10m. Over 1h needs purchased credits.' },
2884
+ idle_timeout: { type: "string", description: 'Stop after this long with nothing connected, e.g. "10m"; "off" = never.' },
2657
2885
  country: { type: "string", description: 'ISO-2 country, e.g. "us". Takes effect only with a proxy.' },
2658
2886
  os_type: { type: "string", description: 'Operating system the browser presents, e.g. "macos", "windows".' },
2659
2887
  profile_id: {
@@ -2925,7 +3153,7 @@ function llmKeyError(e, choice) {
2925
3153
  }
2926
3154
  async function proxyNetwork() {
2927
3155
  const resp = await fetch(`${BASE_URL}/v1/proxy-network`, {
2928
- headers: { "X-API-Key": API_KEY, Accept: "application/json", "User-Agent": "browsa-mcp" }
3156
+ headers: { "X-API-Key": API_KEY, Accept: "application/json", "User-Agent": USER_AGENT }
2929
3157
  });
2930
3158
  const body = await resp.json().catch(() => ({}));
2931
3159
  if (resp.status === 404) return { enabled: false, tiers: [] };
@@ -3178,6 +3406,8 @@ async function callLegacy(name, args) {
3178
3406
  // Sent as is (snake_case) and only when given.
3179
3407
  secret_ids: Array.isArray(args.secret_ids) && args.secret_ids.length ? args.secret_ids : void 0,
3180
3408
  save_secrets: typeof args.save_secrets === "boolean" ? args.save_secrets : void 0,
3409
+ keep_open: typeof args.keep_open === "string" && args.keep_open ? args.keep_open : void 0,
3410
+ idle_timeout: typeof args.idle_timeout === "string" && args.idle_timeout ? args.idle_timeout : void 0,
3181
3411
  timeoutMs: (args.timeout_minutes ?? 10) * 6e4
3182
3412
  })
3183
3413
  );
@@ -3196,7 +3426,8 @@ async function callLegacy(name, args) {
3196
3426
  ...savedSecretFields(job),
3197
3427
  final_result: job.finalResult,
3198
3428
  error: job.errorMessage,
3199
- error_code: job.errorCode
3429
+ error_code: job.errorCode,
3430
+ ...keptBrowserFields(job.raw)
3200
3431
  });
3201
3432
  }
3202
3433
  case "get_job": {
@@ -3227,6 +3458,7 @@ async function callLegacy(name, args) {
3227
3458
  case "start_browser": {
3228
3459
  const a = await client.createAgent({
3229
3460
  ttl: args.ttl ?? "10m",
3461
+ idle_timeout: args.idle_timeout,
3230
3462
  country: args.country ?? DEFAULT_COUNTRY2,
3231
3463
  osType: args.os_type,
3232
3464
  agent_id: args.profile_id,
@@ -3344,6 +3576,22 @@ async function callLegacy(name, args) {
3344
3576
  return fail(e.message || String(e));
3345
3577
  }
3346
3578
  }
3579
+ function keptBrowserFields(raw) {
3580
+ const b = raw && typeof raw === "object" ? raw.browser : null;
3581
+ if (!b || typeof b !== "object" || !b.agent_id) return {};
3582
+ return {
3583
+ session_id: raw.session_id ?? b.session_id,
3584
+ browser: {
3585
+ agent_id: b.agent_id,
3586
+ status: b.status,
3587
+ expires_at: b.expires_at,
3588
+ until_stopped: b.until_stopped,
3589
+ live_url: b.live_url,
3590
+ extend_url: b.extend_url,
3591
+ messages_url: b.messages_url
3592
+ }
3593
+ };
3594
+ }
3347
3595
 
3348
3596
  // src/prompts.ts
3349
3597
  var PROMPTS = [
package/manifest.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "manifest_version": "0.2",
3
3
  "name": "browsa",
4
4
  "display_name": "Browsa",
5
- "version": "0.8.1",
5
+ "version": "0.8.3",
6
6
  "description": "Cloud browsers for AI agents, and captcha solving for a browser of your own.",
7
7
  "long_description": "Browsa gives a model a real cloud browser (Phantom): it reads the page as compact text, acts with real input, types saved secrets it never sees, hands over to a person when a check needs one, and replays what it did with no model calls. For agents that drive their own browser, the captcha tools find the captcha in a page's HTML locally and return a solution with the step to apply it in that browser.",
8
8
  "author": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@browsa/mcp",
3
- "version": "0.8.1",
3
+ "version": "0.8.3",
4
4
  "mcpName": "io.browsa/browsa",
5
5
  "description": "MCP server for Browsa: real cloud browsers (Phantom) for Claude, Cursor, VS Code and any MCP client, and captcha solving for a browser of your own",
6
6
  "license": "MIT",