@browsa/mcp 0.12.0 → 0.13.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
@@ -214,7 +214,7 @@ Everything else from 0.5 is in groups you turn on with `BROWSA_MCP_TOOLS` (comma
214
214
  | `cdp` | `start_browser`, `stop_browser` (a CDP address, to drive the browser from your own code) |
215
215
  | `captcha_page` | `detect_captcha`, `solve_captcha_on_page`, `captcha_allowance`: captcha solving for a browser of your own, [below](#captchas-in-your-own-browser) |
216
216
  | `captcha` | `solve_captcha_task` (Browsa's captcha API, for pages outside a Browsa browser; the answer says what the solve cost), `list_captcha_types` (every type with its parameters, price and measured pass rate), `report_captcha_result` (tell Browsa whether the site took a solution; an incorrect report refunds that solve once, within limits: within 15 minutes of the solve, and a capped share of the workspace's solves of the last 24 hours. The answer's `refunded` says whether it did) |
217
- | `profiles` | `list_profiles`, `create_profile`, `open_profile`, `close_profile`, `update_profile`, `delete_profile`, `profile_runs`, `clone_profile`, `bulk_profiles`: [saved profiles](#saved-profiles) |
217
+ | `profiles` | `list_profiles`, `create_profile`, `open_profile`, `close_profile`, `update_profile`, `delete_profile`, `profile_runs`, `clone_profile`, `bulk_profiles`, `profile_cookies`, `import_profile_cookies`, `list_extensions`, `add_extension`, `delete_extension`: [saved profiles](#saved-profiles) |
218
218
  | `admin` | `credits`, `list_browsers`, `list_identities`, `proxy_network`, `list_llm_keys`, `list_models` |
219
219
  | `all` | every group |
220
220
 
@@ -226,21 +226,26 @@ A tool name works too (`BROWSA_MCP_TOOLS=run_task,credits`). A leading `-` takes
226
226
 
227
227
  ### Saved profiles
228
228
 
229
- A saved profile is a browser that keeps its cookies, logins and fingerprint between sessions: log in once, and every later browser on it starts logged in. The nine tools are in the `profiles` group, so they are not in the default ten (`BROWSA_MCP_TOOLS=profiles`).
229
+ A saved profile is a browser that keeps its cookies, logins and fingerprint between sessions: log in once, and every later browser on it starts logged in. The fourteen tools are in the `profiles` group, so they are not in the default ten (`BROWSA_MCP_TOOLS=profiles`).
230
230
 
231
231
  | Tool | Does |
232
232
  |---|---|
233
233
  | `list_profiles` | Saved profiles: `profile_id`, `name`, `notes`, `tags`, `favorite`, `exit_setting`, `status`, `open_session`. Filters: `tag`, `favorite`, `include_deleted`, `limit` |
234
- | `create_profile` | Create one (`name`, `notes`, `tags`, `favorite`, `country`, `os_type`, `captcha`, `proxy`) and open its first browser; charged on creation and every 30 days |
234
+ | `create_profile` | Create one (`name`, `notes`, `tags`, `favorite`, `country`, `os_type`, `captcha`, `proxy`, `timezone`, `languages`, `startup`, `extensions`) and open its first browser; charged on creation and every 30 days |
235
235
  | `open_profile` | Open a browser on it (`start_url`, `ttl`, `idle_timeout`, `country`, `restart`); returns `cdp_http`, `cdp_url`, `live_url`. A browser on a saved profile is $0.10 an hour, billed per minute; unused time is refunded when it closes. If one is already open, that browser is returned and nothing is charged (`restart: true` opens a new one) |
236
236
  | `close_profile` | Stop its open browser and save the cookies; the profile stays |
237
- | `update_profile` | Set `name`, `notes`, `tags` (replaces the list), `favorite` or `location` (`{network, country}`, `{proxy_id}`, `{none: true}` or `{country}`; needs no open browser, applies from the next open); `""` clears name and notes |
237
+ | `update_profile` | Set `name`, `notes`, `tags` (replaces the list), `favorite`, `location` (`{network, country}`, `{proxy_id}`, `{none: true}` or `{country}`) or settings: `start_page`, `screen_resolution`, `webrtc_mode`, `geolocation_mode`, `geolocation_data`, `media_devices_mode`, `port_scan_protection`, `captcha`, `timezone`, `languages`, `startup`, `extensions`. Location and settings need no open browser and apply from the next open; the operating system can't be changed; `""` clears name and notes |
238
238
  | `clone_profile` | A new profile with the settings of another (`name`, `tags`; `proxy` or `proxy_id` only when the source's exit cannot be copied); new fingerprint, empty, charged like `create_profile` |
239
239
  | `bulk_profiles` | `ids` (1 to 50) and `action`: `close`, `delete`, `tag`, `untag` (with `tags`), `favorite`, `unfavorite`; one result per id |
240
+ | `profile_cookies` | The cookies of its open browser (`domain` filters); needs an open browser |
241
+ | `import_profile_cookies` | Set cookies in its open browser from `cookies` (a list) or `netscape` (cookies.txt text); skipped ones are listed with a reason |
242
+ | `list_extensions` | The workspace's extension library |
243
+ | `add_extension` | Add one from a Chrome Web Store address (`store_url`) or a local `.zip` (`zip_path`, up to 20 MB); attach it with `update_profile` (`extensions`, up to 5). Sites that look for extensions can see it |
244
+ | `delete_extension` | Delete one from the library by `extension_id`; it leaves every profile it was on |
240
245
  | `delete_profile` | Delete it for good, with its cookies |
241
246
  | `profile_runs` | Its browser sessions, newest first, with `cost_usd` |
242
247
 
243
- Errors keep the API's `code`: `SESSION_OPEN` (close the browser first), `EXIT_CHANGING` (retry in a few seconds), `PROXY_NOT_COPYABLE`, `NOT_A_SAVED_PROFILE`, `NO_OPEN_SESSION`. `list_identities` (admin group) is the older name for `list_profiles` and keeps working. Pass a profile's id to `run_task` or `start_browser` as `profile_id` to run on it.
248
+ Errors keep the API's `code`: `SESSION_OPEN` (close the browser first), `EXIT_CHANGING` (retry in a few seconds), `PROXY_NOT_COPYABLE`, `NOT_A_SAVED_PROFILE`, `NO_OPEN_SESSION`, `SETTING_FIXED`, `EXTENSION_NOT_FOUND`, `EXTENSION_LIMIT`. A timezone or language that does not match the exit country can look unusual to a site; leave them on automatic unless you need them. `list_identities` (admin group) is the older name for `list_profiles` and keeps working. Pass a profile's id to `run_task` or `start_browser` as `profile_id` to run on it.
244
249
 
245
250
  ### What the tool list costs
246
251
 
@@ -256,9 +261,9 @@ The tool definitions a client loads before the first message, per setting. Token
256
261
  | `schedules` | `schedules,-core` | 2 | 505 |
257
262
  | `webhooks` | `webhooks,-core` | 3 | 281 |
258
263
  | `cdp` | `cdp,-core` | 2 | 795 |
259
- | `profiles` | `profiles,-core` | 9 | 2,264 |
264
+ | `profiles` | `profiles,-core` | 13 | 3,546 |
260
265
  | `admin` | `admin,-core` | 6 | 640 |
261
- | everything | `all` | 46 | 9,843 |
266
+ | everything | `all` | 50 | 11,126 |
262
267
 
263
268
  A group adds its row to the default's 1,903. Prompts are fetched only when picked and add nothing. The annotations are about 200 of the default's tokens (0.8.0 listed the same nine tools in 1,244).
264
269
 
package/dist/server.js CHANGED
@@ -682,7 +682,7 @@ var catalogue_snapshot_default = {
682
682
  import { BrowsaError } from "browsa";
683
683
 
684
684
  // src/config.ts
685
- var VERSION = "0.12.0";
685
+ var VERSION = "0.13.1";
686
686
  var USER_AGENT = `browsa-mcp/${VERSION}`;
687
687
  var API_KEY = process.env.BROWSA_API_KEY?.trim() || void 0;
688
688
  var BASE_URL = (process.env.BROWSA_BASE_URL || "https://browsa.io").replace(/\/+$/, "");
@@ -740,7 +740,7 @@ var GROUPS = {
740
740
  cdp: ["start_browser", "stop_browser"],
741
741
  captcha: ["solve_captcha_task", "list_captcha_types", "report_captcha_result"],
742
742
  captcha_page: ["detect_captcha", "solve_captcha_on_page", "captcha_allowance"],
743
- profiles: ["list_profiles", "create_profile", "open_profile", "close_profile", "update_profile", "delete_profile", "profile_runs", "clone_profile", "bulk_profiles"],
743
+ profiles: ["list_profiles", "create_profile", "open_profile", "close_profile", "update_profile", "delete_profile", "profile_runs", "clone_profile", "bulk_profiles", "profile_cookies", "import_profile_cookies", "list_extensions", "add_extension", "delete_extension"],
744
744
  admin: ["credits", "list_browsers", "list_identities", "proxy_network", "list_llm_keys", "list_models"]
745
745
  };
746
746
  var CORE_TOOLS = ["open", "observe", "act", "read", "screenshot", "secrets", "handoff", "flow", "close", "fetch_page"];
@@ -1831,6 +1831,11 @@ var ANNOTATIONS = {
1831
1831
  bulk_profiles: destructive("Act on several profiles"),
1832
1832
  delete_profile: destructive("Delete a saved profile", { idempotentHint: true }),
1833
1833
  profile_runs: read("A profile's sessions"),
1834
+ profile_cookies: read("Read a profile's cookies"),
1835
+ import_profile_cookies: write("Set cookies in a profile"),
1836
+ list_extensions: read("List extensions"),
1837
+ add_extension: write("Add an extension"),
1838
+ delete_extension: destructive("Delete an extension", { idempotentHint: true }),
1834
1839
  proxy_network: read("Proxy network"),
1835
1840
  list_llm_keys: read("List saved LLM keys"),
1836
1841
  list_models: read("List models")
@@ -1874,6 +1879,13 @@ async function apiPost(path, payload, timeoutMs = 9e4) {
1874
1879
  signal: AbortSignal.timeout(timeoutMs)
1875
1880
  }), { idempotent: false }));
1876
1881
  }
1882
+ async function apiPostFile(path, field, data, filename, timeoutMs = 12e4) {
1883
+ return parse(await fetchRetry(`${BASE_URL}${path}`, () => {
1884
+ const form = new FormData();
1885
+ form.append(field, new Blob([data]), filename);
1886
+ return { method: "POST", headers: headers(false), body: form, signal: AbortSignal.timeout(timeoutMs) };
1887
+ }, { idempotent: false }));
1888
+ }
1877
1889
  async function apiPatch(path, payload, timeoutMs = 3e4) {
1878
1890
  return parse(await fetchRetry(`${BASE_URL}${path}`, () => ({
1879
1891
  method: "PATCH",
@@ -3704,6 +3716,8 @@ function keptBrowserFields(raw) {
3704
3716
  }
3705
3717
 
3706
3718
  // src/profiles.ts
3719
+ import { readFile, stat } from "fs/promises";
3720
+ import { basename } from "path";
3707
3721
  var ID = { type: "string", description: "The profile id (agt_..., from list_profiles or create_profile)." };
3708
3722
  var PROFILE_TOOLS = [
3709
3723
  "list_profiles",
@@ -3714,8 +3728,34 @@ var PROFILE_TOOLS = [
3714
3728
  "delete_profile",
3715
3729
  "profile_runs",
3716
3730
  "clone_profile",
3717
- "bulk_profiles"
3731
+ "bulk_profiles",
3732
+ "profile_cookies",
3733
+ "import_profile_cookies",
3734
+ "list_extensions",
3735
+ "add_extension",
3736
+ "delete_extension"
3718
3737
  ];
3738
+ var TIMEZONE = {
3739
+ type: "string",
3740
+ description: 'An IANA timezone such as "Europe/Berlin", or "auto" (default) to follow the exit country. One that does not match the exit country can look unusual to a site.'
3741
+ };
3742
+ var LANGUAGES = {
3743
+ type: "array",
3744
+ items: { type: "string" },
3745
+ maxItems: 6,
3746
+ description: '1 to 6 language tags, most preferred first, e.g. ["de-DE", "de", "en"]. [] (default) follows the exit country; a mismatch can look unusual to a site.'
3747
+ };
3748
+ var STARTUP = {
3749
+ type: "string",
3750
+ enum: ["start_page", "restore"],
3751
+ description: '"start_page" (default) or "restore": reopen the tabs of the last session (up to 10).'
3752
+ };
3753
+ var EXTENSIONS = {
3754
+ type: "array",
3755
+ items: { type: "string" },
3756
+ maxItems: 5,
3757
+ description: "Extension ids from list_extensions, loaded at the next open. Replaces the list; [] removes them all. Sites that look for extensions can see them."
3758
+ };
3719
3759
  var TAGS = {
3720
3760
  type: "array",
3721
3761
  items: { type: "string" },
@@ -3759,6 +3799,10 @@ var profileTools = [
3759
3799
  country: { type: "string", description: 'ISO-2 country, e.g. "us". Takes effect only with a proxy.' },
3760
3800
  os_type: { type: "string", description: 'Operating system the browser presents, e.g. "linux", "macos", "windows".' },
3761
3801
  captcha: { type: "string", enum: ["auto", "off"], description: '"auto" (default): Browsa solves captcha widgets in this browser by itself, charged per solve. "off": it never touches the browser.' },
3802
+ timezone: TIMEZONE,
3803
+ languages: LANGUAGES,
3804
+ startup: STARTUP,
3805
+ extensions: EXTENSIONS,
3762
3806
  proxy: {
3763
3807
  type: "object",
3764
3808
  description: `Your own proxy (host and port, or server) or a tier of Browsa's built-in network: {"network": "datacenter"} or {"network": "residential", "country": "us"}. The profile keeps it for every later session.`
@@ -3789,7 +3833,7 @@ var profileTools = [
3789
3833
  },
3790
3834
  {
3791
3835
  name: "update_profile",
3792
- description: "Change a saved profile: name, notes, tags (replaces the whole list; [] clears it), favorite, or location (where its next browser leaves from). A field you leave out stays as it is, and an empty string clears name or notes. Changing the location needs no open browser. Free.",
3836
+ description: "Change a saved profile: name, notes, tags (replaces the whole list; [] clears it), favorite, location (where its next browser leaves from), or its settings: start_page, screen, webrtc, geolocation, media devices, port scan protection, captcha, timezone, languages, startup, extensions. A field you leave out stays as it is, and an empty string clears name or notes. Location and settings need no open browser (409 SESSION_OPEN otherwise) and apply from the next open_profile. The operating system can't be changed (SETTING_FIXED). Free.",
3793
3837
  inputSchema: {
3794
3838
  type: "object",
3795
3839
  required: ["profile_id"],
@@ -3799,7 +3843,19 @@ var profileTools = [
3799
3843
  notes: { type: "string", description: "New notes, up to 1500 characters." },
3800
3844
  tags: TAGS,
3801
3845
  favorite: { type: "boolean", description: "Star or unstar the profile." },
3802
- location: LOCATION
3846
+ location: LOCATION,
3847
+ start_page: { type: "string", description: 'The page a new browser opens on; "" clears it.' },
3848
+ screen_resolution: { type: "string", description: '"1366x768", "mobile-iphone" or "mobile-android-pixel"; "" for the default.' },
3849
+ webrtc_mode: { type: "string", enum: ["masked", "real", "disabled", ""] },
3850
+ geolocation_mode: { type: "string", enum: ["prompt", "allow", "block", ""] },
3851
+ geolocation_data: { type: "string", description: '"lat,lng", e.g. "52.52,13.40"; "" for the default.' },
3852
+ media_devices_mode: { type: "string", enum: ["masked", "real", ""] },
3853
+ port_scan_protection: { type: "string", enum: ["masked", "real", ""] },
3854
+ captcha: { type: "string", enum: ["auto", "off"] },
3855
+ timezone: TIMEZONE,
3856
+ languages: LANGUAGES,
3857
+ startup: STARTUP,
3858
+ extensions: EXTENSIONS
3803
3859
  }
3804
3860
  }
3805
3861
  },
@@ -3844,6 +3900,49 @@ var profileTools = [
3844
3900
  tags: TAGS
3845
3901
  }
3846
3902
  }
3903
+ },
3904
+ {
3905
+ name: "profile_cookies",
3906
+ description: "Read the cookies of the browser open on a saved profile (name, value, domain, path, expires, http_only, secure, same_site). Needs an open browser (NO_OPEN_SESSION: open_profile first). The values are secrets: do not repeat them. Free.",
3907
+ inputSchema: {
3908
+ type: "object",
3909
+ required: ["profile_id"],
3910
+ properties: { profile_id: ID, domain: { type: "string", description: 'Only this domain and its subdomains, e.g. "example.com".' } }
3911
+ }
3912
+ },
3913
+ {
3914
+ name: "import_profile_cookies",
3915
+ description: "Set cookies in the browser open on a saved profile. Send cookies (a list: this API's shape or a browser cookie export) or netscape (the text of a cookies.txt file). At most 5000 cookies and 4 MB. Unusable cookies are skipped and listed with a reason; the rest are set. They are saved with the profile when its browser closes. Needs an open browser (NO_OPEN_SESSION). Free.",
3916
+ inputSchema: {
3917
+ type: "object",
3918
+ required: ["profile_id"],
3919
+ properties: {
3920
+ profile_id: ID,
3921
+ cookies: { type: "array", items: { type: "object" }, maxItems: 5e3, description: "Cookies to set." },
3922
+ netscape: { type: "string", description: "The content of a cookies.txt file. Use this or cookies." }
3923
+ }
3924
+ }
3925
+ },
3926
+ {
3927
+ name: "list_extensions",
3928
+ description: "List the workspace's extension library (id, name, version): Chrome extensions a saved profile can load. Attach them with update_profile (extensions). Free.",
3929
+ inputSchema: { type: "object", properties: {} }
3930
+ },
3931
+ {
3932
+ name: "add_extension",
3933
+ description: "Add a Chrome extension to the workspace library, from a Chrome Web Store address (store_url) or a local .zip file (zip_path, at most 20 MB). At most 20. Attach it with update_profile (extensions); it loads at the next open_profile. Sites that look for extensions can see it, and it may open its own welcome tab when the browser starts. Free.",
3934
+ inputSchema: {
3935
+ type: "object",
3936
+ properties: {
3937
+ store_url: { type: "string", description: "The extension's Chrome Web Store address (.../detail/<name>/<id>)." },
3938
+ zip_path: { type: "string", description: "Path of a .zip of the extension on this machine. Use this or store_url." }
3939
+ }
3940
+ }
3941
+ },
3942
+ {
3943
+ name: "delete_extension",
3944
+ description: "Delete an extension from the workspace library by id (from list_extensions). It leaves every profile it was on. Free.",
3945
+ inputSchema: { type: "object", required: ["extension_id"], properties: { extension_id: { type: "string", description: "The extension id from list_extensions." } } }
3847
3946
  }
3848
3947
  ];
3849
3948
  function ok2(payload) {
@@ -3852,6 +3951,7 @@ function ok2(payload) {
3852
3951
  function fail2(message, extra) {
3853
3952
  return { isError: true, content: [{ type: "text", text: JSON.stringify(extra ? { error: message, ...extra } : { error: message }, null, 2) }] };
3854
3953
  }
3954
+ var MAX_EXTENSION_ZIP = 20 * 1024 * 1024;
3855
3955
  var seg = (id) => encodeURIComponent(String(id));
3856
3956
  function profileView(a) {
3857
3957
  return {
@@ -3861,6 +3961,11 @@ function profileView(a) {
3861
3961
  ...a.tags != null ? { tags: a.tags } : {},
3862
3962
  ...a.favorite != null ? { favorite: a.favorite } : {},
3863
3963
  ...a.exit_setting != null ? { exit_setting: a.exit_setting } : {},
3964
+ ...a.timezone != null ? { timezone: a.timezone } : {},
3965
+ ...a.languages != null ? { languages: a.languages } : {},
3966
+ ...a.startup != null ? { startup: a.startup } : {},
3967
+ ...a.extensions != null ? { extensions: a.extensions } : {},
3968
+ ...a.last_tabs != null ? { last_tabs: a.last_tabs } : {},
3864
3969
  status: a.status,
3865
3970
  open_session: a.open_session ?? null,
3866
3971
  created_at: a.created_at
@@ -3880,7 +3985,7 @@ function browserView(a) {
3880
3985
  }
3881
3986
  async function callProfiles(name, args) {
3882
3987
  try {
3883
- if (!["list_profiles", "create_profile", "bulk_profiles"].includes(name) && !args.profile_id) return fail2("profile_id is required");
3988
+ if (!["list_profiles", "create_profile", "bulk_profiles", "list_extensions", "add_extension", "delete_extension"].includes(name) && !args.profile_id) return fail2("profile_id is required");
3884
3989
  switch (name) {
3885
3990
  case "list_profiles": {
3886
3991
  const q = new URLSearchParams();
@@ -3894,7 +3999,7 @@ async function callProfiles(name, args) {
3894
3999
  }
3895
4000
  case "create_profile": {
3896
4001
  const body = {};
3897
- for (const k of ["name", "notes", "tags", "favorite", "country", "os_type", "captcha", "proxy"]) if (args[k] != null) body[k] = args[k];
4002
+ for (const k of ["name", "notes", "tags", "favorite", "country", "os_type", "captcha", "proxy", "timezone", "languages", "startup", "extensions"]) if (args[k] != null) body[k] = args[k];
3898
4003
  return ok2(browserView(await apiPost("/v1/profiles", body)));
3899
4004
  }
3900
4005
  case "open_profile": {
@@ -3926,7 +4031,13 @@ async function callProfiles(name, args) {
3926
4031
  else if (typeof loc.country === "string") body.country = loc.country;
3927
4032
  else return fail2("location needs network, proxy_id, none or country");
3928
4033
  }
3929
- if (!Object.keys(body).length) return fail2("send name, notes, tags, favorite or location");
4034
+ if (typeof args.start_page === "string") body.initial_url = args.start_page;
4035
+ for (const k of ["screen_resolution", "webrtc_mode", "geolocation_mode", "geolocation_data", "media_devices_mode", "port_scan_protection", "captcha", "timezone", "startup"]) {
4036
+ if (typeof args[k] === "string") body[k] = args[k];
4037
+ }
4038
+ if (Array.isArray(args.languages)) body.languages = args.languages;
4039
+ if (Array.isArray(args.extensions)) body.extensions = args.extensions;
4040
+ if (!Object.keys(body).length) return fail2("send name, notes, tags, favorite or location, or a setting");
3930
4041
  return ok2(profileView(await apiPatch(`/v1/profiles/${seg(args.profile_id)}`, body)));
3931
4042
  }
3932
4043
  case "clone_profile": {
@@ -3942,6 +4053,53 @@ async function callProfiles(name, args) {
3942
4053
  const r = await apiPost("/v1/profiles/bulk", body);
3943
4054
  return ok2({ results: r?.results ?? [] });
3944
4055
  }
4056
+ case "profile_cookies": {
4057
+ const q = typeof args.domain === "string" && args.domain ? `?domain=${encodeURIComponent(args.domain)}` : "";
4058
+ const r = await apiGet(`/v1/profiles/${seg(args.profile_id)}/cookies${q}`);
4059
+ return ok2({ cookies: r?.cookies ?? [], count: r?.count ?? (r?.cookies ?? []).length });
4060
+ }
4061
+ case "import_profile_cookies": {
4062
+ const hasList = Array.isArray(args.cookies);
4063
+ const hasText = typeof args.netscape === "string" && args.netscape !== "";
4064
+ if (hasList === hasText) return fail2("send cookies (a list) or netscape (cookies.txt text), not both");
4065
+ const body = hasList ? { cookies: args.cookies } : { format: "netscape", text: args.netscape };
4066
+ const r = await apiPost(`/v1/profiles/${seg(args.profile_id)}/cookies`, body);
4067
+ return ok2({ imported: r?.imported ?? 0, skipped: r?.skipped ?? [] });
4068
+ }
4069
+ case "list_extensions": {
4070
+ const r = await apiGet("/v1/extensions");
4071
+ return ok2({ extensions: r?.extensions ?? [] });
4072
+ }
4073
+ case "add_extension": {
4074
+ const hasUrl = typeof args.store_url === "string" && args.store_url !== "";
4075
+ const hasZip = typeof args.zip_path === "string" && args.zip_path !== "";
4076
+ if (hasUrl === hasZip) return fail2("send store_url or zip_path, not both and not neither");
4077
+ if (hasUrl) return ok2(await apiPost("/v1/extensions", { store_url: args.store_url }));
4078
+ const path = args.zip_path;
4079
+ if (!path.toLowerCase().endsWith(".zip")) return fail2("zip_path must be a .zip file");
4080
+ let size;
4081
+ try {
4082
+ const st = await stat(path);
4083
+ if (!st.isFile()) return fail2(`zip_path is not a file: ${path}`);
4084
+ size = st.size;
4085
+ } catch {
4086
+ return fail2(`cannot read zip_path: ${path}`);
4087
+ }
4088
+ if (size === 0) return fail2("the zip file is empty");
4089
+ if (size > MAX_EXTENSION_ZIP) return fail2("an extension file is at most 20 MB");
4090
+ let data;
4091
+ try {
4092
+ data = await readFile(path);
4093
+ } catch {
4094
+ return fail2(`cannot read zip_path: ${path}`);
4095
+ }
4096
+ return ok2(await apiPostFile("/v1/extensions", "file", data, basename(path)));
4097
+ }
4098
+ case "delete_extension": {
4099
+ if (typeof args.extension_id !== "string" || !args.extension_id) return fail2("extension_id is required");
4100
+ await apiDelete(`/v1/extensions/${seg(args.extension_id)}`);
4101
+ return ok2({ deleted: args.extension_id });
4102
+ }
3945
4103
  case "delete_profile":
3946
4104
  await apiDelete(`/v1/profiles/${seg(args.profile_id)}`);
3947
4105
  return ok2({ deleted: args.profile_id });
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.12.0",
5
+ "version": "0.13.1",
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.12.0",
3
+ "version": "0.13.1",
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",