@browsa/mcp 0.8.0 → 0.8.2
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 +34 -15
- package/dist/server.js +341 -20
- package/manifest.json +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -10,8 +10,9 @@
|
|
|
10
10
|
**Captcha solving for a browser of your own.** An agent that already drives its own browser keeps it: `detect_captcha` finds the captcha in the page's HTML on your machine, `solve_captcha_on_page` returns the solution with the step to apply it in that browser. See [Captchas in your own browser](#captchas-in-your-own-browser).
|
|
11
11
|
|
|
12
12
|
[](https://www.npmjs.com/package/@browsa/mcp)
|
|
13
|
+
[](https://github.com/browsa-io/browsa/actions/workflows/ci.yml)
|
|
13
14
|
|
|
14
|
-
You need a Browsa API key: [app.browsa.io/dashboard/keys](https://app.browsa.io/dashboard/keys)
|
|
15
|
+
You need a Browsa API key: create one at [app.browsa.io/dashboard/keys](https://app.browsa.io/dashboard/keys) and replace `agt_live_...` below with it. New accounts get 100 free credits after email verification, no card.
|
|
15
16
|
|
|
16
17
|
## Install
|
|
17
18
|
|
|
@@ -105,7 +106,7 @@ Command `npx -y @browsa/mcp`, environment `BROWSA_API_KEY`. Transport: stdio. Re
|
|
|
105
106
|
|
|
106
107
|
### Only the captcha tools, next to a browser of your own
|
|
107
108
|
|
|
108
|
-
Three tools instead of nine, about
|
|
109
|
+
Three tools instead of nine, about 600 tokens of tool definitions, and a spend cap for the session:
|
|
109
110
|
|
|
110
111
|
```json
|
|
111
112
|
{
|
|
@@ -131,7 +132,7 @@ Then ask: *"Open books.toscrape.com and list the first five titles with their pr
|
|
|
131
132
|
|
|
132
133
|
## Tools
|
|
133
134
|
|
|
134
|
-
Nine tools are on by default. Their
|
|
135
|
+
Nine tools are on by default. Their definitions are about 1.45k tokens in total. Every tool carries MCP annotations (a title, `readOnlyHint`, `destructiveHint`), so a client can tell a read from an action before it asks you: see [Annotations](#annotations).
|
|
135
136
|
|
|
136
137
|
| Tool | What it does |
|
|
137
138
|
|---|---|
|
|
@@ -225,18 +226,32 @@ The tool definitions a client loads before the first message, per setting. Token
|
|
|
225
226
|
|
|
226
227
|
| Tools listed | `BROWSA_MCP_TOOLS` | Tools | Tokens (chars / 4) |
|
|
227
228
|
|---|---|---|---|
|
|
228
|
-
| default | (unset) | 9 | 1,
|
|
229
|
-
| the captcha tools for your own browser | `captcha_page,-core` | 3 |
|
|
230
|
-
| the captcha API tools | `captcha,-core` | 3 |
|
|
231
|
-
| `tasks` | `tasks,-core` | 5 | 1,
|
|
232
|
-
| `robots` | `robots,-core` | 3 |
|
|
233
|
-
| `schedules` | `schedules,-core` | 2 |
|
|
234
|
-
| `webhooks` | `webhooks,-core` | 3 |
|
|
235
|
-
| `cdp` | `cdp,-core` | 2 |
|
|
236
|
-
| `admin` | `admin,-core` | 6 |
|
|
237
|
-
| everything | `all` | 36 |
|
|
238
|
-
|
|
239
|
-
A group adds its row to the default's 1,
|
|
229
|
+
| default | (unset) | 9 | 1,450 |
|
|
230
|
+
| the captcha tools for your own browser | `captcha_page,-core` | 3 | 603 |
|
|
231
|
+
| the captcha API tools | `captcha,-core` | 3 | 765 |
|
|
232
|
+
| `tasks` | `tasks,-core` | 5 | 1,410 |
|
|
233
|
+
| `robots` | `robots,-core` | 3 | 496 |
|
|
234
|
+
| `schedules` | `schedules,-core` | 2 | 505 |
|
|
235
|
+
| `webhooks` | `webhooks,-core` | 3 | 281 |
|
|
236
|
+
| `cdp` | `cdp,-core` | 2 | 691 |
|
|
237
|
+
| `admin` | `admin,-core` | 6 | 575 |
|
|
238
|
+
| everything | `all` | 36 | 6,770 |
|
|
239
|
+
|
|
240
|
+
A group adds its row to the default's 1,450. 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).
|
|
241
|
+
|
|
242
|
+
### Annotations
|
|
243
|
+
|
|
244
|
+
| Hint | Tools |
|
|
245
|
+
|---|---|
|
|
246
|
+
| Read-only (`readOnlyHint: true`): changes nothing, spends nothing | `observe`, `read`, `screenshot`, `secrets`, `get_job`, `list_job_files`, `list_robots`, `get_robot_run`, `list_schedules`, `list_webhooks`, `list_captcha_types`, `detect_captcha`, `captcha_allowance`, `credits`, `list_browsers`, `list_identities`, `proxy_network`, `list_llm_keys`, `list_models` |
|
|
247
|
+
| Can change something for good (`destructiveHint: true`) | `act`, `flow`, `run_task`, `run_robot` (the page decides what a click does), `close`, `stop_browser`, `cancel_job`, `delete_webhook` |
|
|
248
|
+
| Writes, not destructive | `open`, `handoff`, `respond_to_job`, `create_schedule`, `create_webhook`, `start_browser`, `solve_captcha_task`, `solve_captcha_on_page`, `report_captcha_result` |
|
|
249
|
+
|
|
250
|
+
`detect_captcha` and `captcha_allowance` also say `openWorldHint: false`: they run inside the server process and make no request.
|
|
251
|
+
|
|
252
|
+
### Command line
|
|
253
|
+
|
|
254
|
+
`npx -y @browsa/mcp --help` prints the options and the environment variables, `--version` the version. Both exit at once and need no key; neither starts the server.
|
|
240
255
|
|
|
241
256
|
## Captchas in your own browser
|
|
242
257
|
|
|
@@ -303,6 +318,10 @@ Built-in prompts, listed only when their tools are on: **solve_captcha_on_my_pag
|
|
|
303
318
|
|
|
304
319
|
The full table is in [SECURITY.md](./SECURITY.md).
|
|
305
320
|
|
|
321
|
+
## Upgrading from 0.8.0
|
|
322
|
+
|
|
323
|
+
Nothing to change. 0.8.1 adds annotations on every tool, the server's `instructions`, and the `--help` and `--version` flags. Tool names, arguments and answers are the same.
|
|
324
|
+
|
|
306
325
|
## Upgrading from 0.7
|
|
307
326
|
|
|
308
327
|
Nothing to change. The default tool list is the same nine tools, and every existing tool keeps its name, arguments and answers. New in 0.8: the `captcha_page` group, the three captcha limits, `-name` in `BROWSA_MCP_TOOLS`, prompts, retries on `429` and gateway errors, and `list_captcha_types` and `detect_captcha` working without a key.
|
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-
|
|
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:
|
|
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: "
|
|
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: "
|
|
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,13 +682,54 @@ var catalogue_snapshot_default = {
|
|
|
469
682
|
import { BrowsaError } from "browsa";
|
|
470
683
|
|
|
471
684
|
// src/config.ts
|
|
472
|
-
var VERSION = "0.8.
|
|
685
|
+
var VERSION = "0.8.2";
|
|
473
686
|
var API_KEY = process.env.BROWSA_API_KEY?.trim() || void 0;
|
|
474
687
|
var BASE_URL = (process.env.BROWSA_BASE_URL || "https://browsa.io").replace(/\/+$/, "");
|
|
475
688
|
var BASE_URL_SET = !!process.env.BROWSA_BASE_URL;
|
|
476
689
|
var DEFAULT_COUNTRY = process.env.BROWSA_COUNTRY || void 0;
|
|
477
690
|
var KEYS_URL = "https://app.browsa.io/dashboard/keys";
|
|
478
|
-
var NO_KEY_MESSAGE = "BROWSA_API_KEY is not set.
|
|
691
|
+
var NO_KEY_MESSAGE = "BROWSA_API_KEY is not set. Create a key at " + KEYS_URL + ", add it to this MCP server's env, then restart the server.";
|
|
692
|
+
function cliFlag(argv = process.argv.slice(2)) {
|
|
693
|
+
if (argv.includes("--help") || argv.includes("-h")) return "help";
|
|
694
|
+
if (argv.includes("--version") || argv.includes("-v") || argv.includes("-V")) return "version";
|
|
695
|
+
return void 0;
|
|
696
|
+
}
|
|
697
|
+
var HELP = `browsa-mcp ${VERSION}: MCP server for Browsa (stdio)
|
|
698
|
+
|
|
699
|
+
Cloud browsers (Phantom) for an MCP client, and captcha solving for a browser of your own.
|
|
700
|
+
An MCP client starts this command; it speaks MCP on stdin and stdout.
|
|
701
|
+
|
|
702
|
+
Usage:
|
|
703
|
+
npx -y @browsa/mcp [--tools=<groups>]
|
|
704
|
+
npx -y @browsa/mcp --help | --version
|
|
705
|
+
|
|
706
|
+
Options:
|
|
707
|
+
--tools=<groups> Optional tool groups, comma separated (same as BROWSA_MCP_TOOLS):
|
|
708
|
+
tasks, robots, schedules, webhooks, cdp, captcha, captcha_page, admin, or all.
|
|
709
|
+
-name takes a group or a tool off; -core takes the nine core tools off.
|
|
710
|
+
-h, --help Print this and exit
|
|
711
|
+
-v, --version Print the version and exit
|
|
712
|
+
|
|
713
|
+
Environment:
|
|
714
|
+
BROWSA_API_KEY Your Browsa API key. Create a key at ${KEYS_URL}
|
|
715
|
+
Without it the tools are listed; detect_captcha, captcha_allowance
|
|
716
|
+
and list_captcha_types still answer.
|
|
717
|
+
BROWSA_MCP_TOOLS Optional tool groups, as --tools
|
|
718
|
+
BROWSA_BASE_URL Default https://browsa.io
|
|
719
|
+
BROWSA_COUNTRY Default exit country for open
|
|
720
|
+
BROWSA_LLM, BROWSA_LLM_KEY_ID, BROWSA_LLM_API_KEY Model settings for the tasks group
|
|
721
|
+
BROWSA_CAPTCHA_URL Default https://captcha.browsa.io
|
|
722
|
+
BROWSA_CAPTCHA_MAX_CREDITS, BROWSA_CAPTCHA_RATE_PER_MINUTE, BROWSA_CAPTCHA_CONCURRENCY
|
|
723
|
+
Local limits for captcha solves (off unless set)
|
|
724
|
+
BROWSA_MCP_RETRIES Default 2; 0 for none
|
|
725
|
+
BROWSA_MCP_REDACT=off Show URL tokens (debugging only)
|
|
726
|
+
|
|
727
|
+
Core tools (on by default): open, observe, act, read, screenshot, secrets, handoff, flow, close
|
|
728
|
+
|
|
729
|
+
Docs: https://browsa.io/guides/mcp-server
|
|
730
|
+
Source: https://github.com/browsa-io/browsa/tree/main/browsa-mcp
|
|
731
|
+
`;
|
|
732
|
+
var INSTRUCTIONS = "Browsa gives you a real cloud browser (Phantom) and, for a browser of your own, captcha solving. Browser tools: open a page, observe it as text (one line per element with an id), act on an id, read a container, and close the browser when done; a browser left open keeps running until its ttl. act answers with a status on its first line and, when something stopped, a `next:` line: follow it. Type saved secrets with act secret (their values never reach you); call handoff when a person has to step in. Opening a browser, tasks, robots and captcha solves spend the workspace's credits; reads and lists are free. Tools that are not listed are in optional groups: the error names the BROWSA_MCP_TOOLS setting that turns one on. Without BROWSA_API_KEY only detect_captcha, captcha_allowance and list_captcha_types answer.";
|
|
479
733
|
var REDACT = !/^(0|off|false|no)$/i.test(process.env.BROWSA_MCP_REDACT ?? "");
|
|
480
734
|
var GROUPS = {
|
|
481
735
|
tasks: ["run_task", "get_job", "cancel_job", "respond_to_job", "list_job_files"],
|
|
@@ -1517,6 +1771,63 @@ async function callCaptchaPage(name, args) {
|
|
|
1517
1771
|
}
|
|
1518
1772
|
}
|
|
1519
1773
|
|
|
1774
|
+
// src/annotations.ts
|
|
1775
|
+
var read = (title, extra = {}) => ({ title, readOnlyHint: true, destructiveHint: false, ...extra });
|
|
1776
|
+
var write = (title, extra = {}) => ({ title, readOnlyHint: false, destructiveHint: false, ...extra });
|
|
1777
|
+
var destructive = (title, extra = {}) => ({ title, readOnlyHint: false, destructiveHint: true, ...extra });
|
|
1778
|
+
var ANNOTATIONS = {
|
|
1779
|
+
// core
|
|
1780
|
+
open: write("Open a browser"),
|
|
1781
|
+
observe: read("Read the page as text"),
|
|
1782
|
+
act: destructive("Act on the page"),
|
|
1783
|
+
read: read("Read a container"),
|
|
1784
|
+
screenshot: read("Take a screenshot"),
|
|
1785
|
+
secrets: read("List saved secrets"),
|
|
1786
|
+
handoff: write("Hand over to a person"),
|
|
1787
|
+
flow: destructive("Record or replay a flow"),
|
|
1788
|
+
close: destructive("Close the browser", { idempotentHint: true }),
|
|
1789
|
+
// tasks
|
|
1790
|
+
run_task: destructive("Run an agent task"),
|
|
1791
|
+
get_job: read("Get a job"),
|
|
1792
|
+
cancel_job: destructive("Cancel a job", { idempotentHint: true }),
|
|
1793
|
+
respond_to_job: write("Answer a job's question"),
|
|
1794
|
+
list_job_files: read("List a job's files"),
|
|
1795
|
+
// robots
|
|
1796
|
+
list_robots: read("List robots"),
|
|
1797
|
+
run_robot: destructive("Run a robot"),
|
|
1798
|
+
get_robot_run: read("Get a robot run"),
|
|
1799
|
+
// schedules
|
|
1800
|
+
create_schedule: write("Create a schedule"),
|
|
1801
|
+
list_schedules: read("List schedules"),
|
|
1802
|
+
// webhooks
|
|
1803
|
+
list_webhooks: read("List webhooks"),
|
|
1804
|
+
create_webhook: write("Create a webhook"),
|
|
1805
|
+
delete_webhook: destructive("Delete a webhook", { idempotentHint: true }),
|
|
1806
|
+
// cdp
|
|
1807
|
+
start_browser: write("Start a browser for CDP"),
|
|
1808
|
+
stop_browser: destructive("Stop a browser", { idempotentHint: true }),
|
|
1809
|
+
// captcha
|
|
1810
|
+
solve_captcha_task: write("Solve a captcha task"),
|
|
1811
|
+
list_captcha_types: read("List captcha types"),
|
|
1812
|
+
report_captcha_result: write("Report a captcha result"),
|
|
1813
|
+
// captcha_page
|
|
1814
|
+
detect_captcha: read("Find the captcha in a page", { idempotentHint: true, openWorldHint: false }),
|
|
1815
|
+
solve_captcha_on_page: write("Solve a captcha for your browser"),
|
|
1816
|
+
captcha_allowance: read("Captcha allowance left", { openWorldHint: false }),
|
|
1817
|
+
// admin
|
|
1818
|
+
credits: read("Credit balance"),
|
|
1819
|
+
list_browsers: read("List browsers"),
|
|
1820
|
+
list_identities: read("List identities"),
|
|
1821
|
+
proxy_network: read("Proxy network"),
|
|
1822
|
+
list_llm_keys: read("List saved LLM keys"),
|
|
1823
|
+
list_models: read("List models")
|
|
1824
|
+
};
|
|
1825
|
+
function annotate2(tool) {
|
|
1826
|
+
const a = ANNOTATIONS[tool.name];
|
|
1827
|
+
if (!a) throw new Error(`tool ${tool.name} has no annotations (src/annotations.ts)`);
|
|
1828
|
+
return { ...tool, annotations: a };
|
|
1829
|
+
}
|
|
1830
|
+
|
|
1520
1831
|
// src/api.ts
|
|
1521
1832
|
import { BrowsaError as BrowsaError3 } from "browsa";
|
|
1522
1833
|
function headers(json) {
|
|
@@ -1995,7 +2306,7 @@ next: ${s}`;
|
|
|
1995
2306
|
case code === "STALE":
|
|
1996
2307
|
return next("the page changed; call observe and use the new ids");
|
|
1997
2308
|
case (e.status === 401 || code === "INVALID_API_KEY" || code === "MISSING_API_KEY"):
|
|
1998
|
-
return next(`BROWSA_API_KEY was refused;
|
|
2309
|
+
return next(`BROWSA_API_KEY was refused; create a key at ${KEYS_URL} and restart the server`);
|
|
1999
2310
|
case (e.status === 402 || /CREDIT/.test(code)):
|
|
2000
2311
|
return next("not enough credits; top up at https://app.browsa.io/dashboard/billing");
|
|
2001
2312
|
case e.status === 429:
|
|
@@ -2178,7 +2489,7 @@ flow: ${n}`;
|
|
|
2178
2489
|
function tsv(cells) {
|
|
2179
2490
|
return cells.map((c) => String(c ?? "").replace(/[\t\r\n]+/g, " ")).join(" ");
|
|
2180
2491
|
}
|
|
2181
|
-
async function
|
|
2492
|
+
async function read2(args) {
|
|
2182
2493
|
const b = browserOf(args);
|
|
2183
2494
|
const id = Math.floor(Number(args.id));
|
|
2184
2495
|
if (!id) throw new ToolError("error: id is required\nnext: an id of a container from observe");
|
|
@@ -2421,7 +2732,7 @@ async function callCore(name, args) {
|
|
|
2421
2732
|
case "act":
|
|
2422
2733
|
return { text: await act(args) };
|
|
2423
2734
|
case "read":
|
|
2424
|
-
return { text: await
|
|
2735
|
+
return { text: await read2(args) };
|
|
2425
2736
|
case "screenshot":
|
|
2426
2737
|
return await screenshot(args);
|
|
2427
2738
|
case "secrets":
|
|
@@ -3332,22 +3643,26 @@ function redactUrls(text) {
|
|
|
3332
3643
|
}
|
|
3333
3644
|
|
|
3334
3645
|
// src/server.ts
|
|
3335
|
-
|
|
3646
|
+
var FLAG = cliFlag();
|
|
3647
|
+
if (!FLAG && !API_KEY) {
|
|
3336
3648
|
console.error("[browsa-mcp] BROWSA_API_KEY is not set: tools are listed, but calls that reach Browsa will fail until it is.");
|
|
3337
|
-
console.error(`
|
|
3649
|
+
console.error(` Create a key at ${KEYS_URL}`);
|
|
3338
3650
|
}
|
|
3339
3651
|
var extras = enabledExtras();
|
|
3340
|
-
for (const w of extras.unknown) {
|
|
3652
|
+
for (const w of FLAG ? [] : extras.unknown) {
|
|
3341
3653
|
console.error(`[browsa-mcp] BROWSA_MCP_TOOLS: unknown group or tool "${w}" (groups: ${Object.keys(GROUPS).join(", ")}, all)`);
|
|
3342
3654
|
}
|
|
3343
3655
|
var tools = [
|
|
3344
3656
|
...coreTools.filter((t) => extras.core.has(t.name)),
|
|
3345
3657
|
...captchaPageTools.filter((t) => extras.tools.has(t.name)),
|
|
3346
3658
|
...legacyTools.filter((t) => extras.tools.has(t.name))
|
|
3347
|
-
];
|
|
3659
|
+
].map((t) => annotate2(t));
|
|
3348
3660
|
var listed = new Set(tools.map((t) => t.name));
|
|
3349
3661
|
setReportToolListed(listed.has("report_captcha_result"));
|
|
3350
|
-
var server = new Server(
|
|
3662
|
+
var server = new Server(
|
|
3663
|
+
{ name: "browsa", title: "Browsa", version: VERSION },
|
|
3664
|
+
{ capabilities: { tools: {}, prompts: {} }, instructions: INSTRUCTIONS }
|
|
3665
|
+
);
|
|
3351
3666
|
server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools }));
|
|
3352
3667
|
server.setRequestHandler(ListPromptsRequestSchema, async () => ({ prompts: listPrompts(listed) }));
|
|
3353
3668
|
server.setRequestHandler(GetPromptRequestSchema, async (req) => {
|
|
@@ -3388,7 +3703,13 @@ async function main() {
|
|
|
3388
3703
|
if (GROUPS.captcha_page.some((t) => listed.has(t))) void refreshCatalogue();
|
|
3389
3704
|
console.error(`[browsa-mcp] ${VERSION} ready (tools=${tools.length})`);
|
|
3390
3705
|
}
|
|
3391
|
-
|
|
3392
|
-
console.
|
|
3393
|
-
|
|
3394
|
-
|
|
3706
|
+
if (FLAG === "version") {
|
|
3707
|
+
console.log(VERSION);
|
|
3708
|
+
} else if (FLAG === "help") {
|
|
3709
|
+
console.log(HELP);
|
|
3710
|
+
} else {
|
|
3711
|
+
main().catch((e) => {
|
|
3712
|
+
console.error("[browsa-mcp] fatal:", e);
|
|
3713
|
+
process.exit(1);
|
|
3714
|
+
});
|
|
3715
|
+
}
|
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.
|
|
5
|
+
"version": "0.8.2",
|
|
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.
|
|
3
|
+
"version": "0.8.2",
|
|
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",
|