@browsa/mcp 0.13.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 +4 -3
- package/dist/server.js +54 -9
- package/manifest.json +1 -1
- package/package.json +1 -1
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`, `profile_cookies`, `import_profile_cookies`, `list_extensions`, `add_extension`: [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,7 +226,7 @@ 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
|
|
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
|
|---|---|
|
|
@@ -240,7 +240,8 @@ A saved profile is a browser that keeps its cookies, logins and fingerprint betw
|
|
|
240
240
|
| `profile_cookies` | The cookies of its open browser (`domain` filters); needs an open browser |
|
|
241
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
242
|
| `list_extensions` | The workspace's extension library |
|
|
243
|
-
| `add_extension` | Add one from a Chrome Web Store address (`store_url`); attach it with `update_profile` (`extensions`, up to 5). Sites that look for extensions can see it |
|
|
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 |
|
|
244
245
|
| `delete_profile` | Delete it for good, with its cookies |
|
|
245
246
|
| `profile_runs` | Its browser sessions, newest first, with `cost_usd` |
|
|
246
247
|
|
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.13.
|
|
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", "profile_cookies", "import_profile_cookies", "list_extensions", "add_extension"],
|
|
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"];
|
|
@@ -1835,6 +1835,7 @@ var ANNOTATIONS = {
|
|
|
1835
1835
|
import_profile_cookies: write("Set cookies in a profile"),
|
|
1836
1836
|
list_extensions: read("List extensions"),
|
|
1837
1837
|
add_extension: write("Add an extension"),
|
|
1838
|
+
delete_extension: destructive("Delete an extension", { idempotentHint: true }),
|
|
1838
1839
|
proxy_network: read("Proxy network"),
|
|
1839
1840
|
list_llm_keys: read("List saved LLM keys"),
|
|
1840
1841
|
list_models: read("List models")
|
|
@@ -1878,6 +1879,13 @@ async function apiPost(path, payload, timeoutMs = 9e4) {
|
|
|
1878
1879
|
signal: AbortSignal.timeout(timeoutMs)
|
|
1879
1880
|
}), { idempotent: false }));
|
|
1880
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
|
+
}
|
|
1881
1889
|
async function apiPatch(path, payload, timeoutMs = 3e4) {
|
|
1882
1890
|
return parse(await fetchRetry(`${BASE_URL}${path}`, () => ({
|
|
1883
1891
|
method: "PATCH",
|
|
@@ -3708,6 +3716,8 @@ function keptBrowserFields(raw) {
|
|
|
3708
3716
|
}
|
|
3709
3717
|
|
|
3710
3718
|
// src/profiles.ts
|
|
3719
|
+
import { readFile, stat } from "fs/promises";
|
|
3720
|
+
import { basename } from "path";
|
|
3711
3721
|
var ID = { type: "string", description: "The profile id (agt_..., from list_profiles or create_profile)." };
|
|
3712
3722
|
var PROFILE_TOOLS = [
|
|
3713
3723
|
"list_profiles",
|
|
@@ -3722,7 +3732,8 @@ var PROFILE_TOOLS = [
|
|
|
3722
3732
|
"profile_cookies",
|
|
3723
3733
|
"import_profile_cookies",
|
|
3724
3734
|
"list_extensions",
|
|
3725
|
-
"add_extension"
|
|
3735
|
+
"add_extension",
|
|
3736
|
+
"delete_extension"
|
|
3726
3737
|
];
|
|
3727
3738
|
var TIMEZONE = {
|
|
3728
3739
|
type: "string",
|
|
@@ -3919,12 +3930,19 @@ var profileTools = [
|
|
|
3919
3930
|
},
|
|
3920
3931
|
{
|
|
3921
3932
|
name: "add_extension",
|
|
3922
|
-
description: "Add a Chrome extension to the workspace library from a Chrome Web Store address. At most 20. Attach it
|
|
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.",
|
|
3923
3934
|
inputSchema: {
|
|
3924
3935
|
type: "object",
|
|
3925
|
-
|
|
3926
|
-
|
|
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
|
+
}
|
|
3927
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." } } }
|
|
3928
3946
|
}
|
|
3929
3947
|
];
|
|
3930
3948
|
function ok2(payload) {
|
|
@@ -3933,6 +3951,7 @@ function ok2(payload) {
|
|
|
3933
3951
|
function fail2(message, extra) {
|
|
3934
3952
|
return { isError: true, content: [{ type: "text", text: JSON.stringify(extra ? { error: message, ...extra } : { error: message }, null, 2) }] };
|
|
3935
3953
|
}
|
|
3954
|
+
var MAX_EXTENSION_ZIP = 20 * 1024 * 1024;
|
|
3936
3955
|
var seg = (id) => encodeURIComponent(String(id));
|
|
3937
3956
|
function profileView(a) {
|
|
3938
3957
|
return {
|
|
@@ -3966,7 +3985,7 @@ function browserView(a) {
|
|
|
3966
3985
|
}
|
|
3967
3986
|
async function callProfiles(name, args) {
|
|
3968
3987
|
try {
|
|
3969
|
-
if (!["list_profiles", "create_profile", "bulk_profiles", "list_extensions", "add_extension"].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");
|
|
3970
3989
|
switch (name) {
|
|
3971
3990
|
case "list_profiles": {
|
|
3972
3991
|
const q = new URLSearchParams();
|
|
@@ -4052,8 +4071,34 @@ async function callProfiles(name, args) {
|
|
|
4052
4071
|
return ok2({ extensions: r?.extensions ?? [] });
|
|
4053
4072
|
}
|
|
4054
4073
|
case "add_extension": {
|
|
4055
|
-
|
|
4056
|
-
|
|
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 });
|
|
4057
4102
|
}
|
|
4058
4103
|
case "delete_profile":
|
|
4059
4104
|
await apiDelete(`/v1/profiles/${seg(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.13.
|
|
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.13.
|
|
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",
|