@browsa/mcp 0.5.0 → 0.6.0
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 +128 -89
- package/dist/server.js +1038 -147
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -5,28 +5,28 @@
|
|
|
5
5
|
|
|
6
6
|
# @browsa/mcp
|
|
7
7
|
|
|
8
|
-
**
|
|
9
|
-
|
|
10
|
-
MCP (Model Context Protocol) server for [Browsa](https://browsa.io): turn any LLM into a real-browser agent with one config line. The agent gets a fresh cloud browser running Phantom, Browsa's own browser, and a live view link so you can watch it work.
|
|
8
|
+
**Real cloud browsers for any MCP client.** Your model opens a Phantom browser (Browsa's own), 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.
|
|
11
9
|
|
|
12
10
|
[](https://www.npmjs.com/package/@browsa/mcp)
|
|
13
11
|
|
|
14
|
-
|
|
12
|
+
You need a Browsa API key: [app.browsa.io/dashboard/keys](https://app.browsa.io/dashboard/keys). Replace `agt_live_...` below with it.
|
|
13
|
+
|
|
14
|
+
## Install
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
- Return results as structured JSON
|
|
19
|
-
- Use your own HTTP or SOCKS5 proxy per browser (free), or Browsa's built-in proxy network: datacenter or residential, billed per GB from credits (see `proxy_network`)
|
|
20
|
-
- Stay logged in across calls via persistent identities
|
|
21
|
-
- Run your robots (saved browser jobs) and read their rows
|
|
16
|
+
[](https://cursor.com/en/install-mcp?name=browsa&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkBicm93c2EvbWNwIl0sImVudiI6eyJCUk9XU0FfQVBJX0tFWSI6ImFndF9saXZlXy4uLiJ9fQ==)
|
|
17
|
+
[](https://insiders.vscode.dev/redirect/mcp/install?name=browsa&config=%7B%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40browsa%2Fmcp%22%5D%2C%22env%22%3A%7B%22BROWSA_API_KEY%22%3A%22agt_live_...%22%7D%7D)
|
|
22
18
|
|
|
23
|
-
|
|
19
|
+
After a one-click install, put your key in place of `agt_live_...` in the client's MCP settings.
|
|
24
20
|
|
|
25
|
-
|
|
21
|
+
### Claude Code
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
claude mcp add browsa -e BROWSA_API_KEY=agt_live_... -- npx -y @browsa/mcp
|
|
25
|
+
```
|
|
26
26
|
|
|
27
27
|
### Claude Desktop
|
|
28
28
|
|
|
29
|
-
Edit
|
|
29
|
+
Settings, Developer, Edit Config (`claude_desktop_config.json`):
|
|
30
30
|
|
|
31
31
|
```json
|
|
32
32
|
{
|
|
@@ -34,113 +34,152 @@ Edit `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS) o
|
|
|
34
34
|
"browsa": {
|
|
35
35
|
"command": "npx",
|
|
36
36
|
"args": ["-y", "@browsa/mcp"],
|
|
37
|
-
"env": {
|
|
38
|
-
"BROWSA_API_KEY": "agt_live_..."
|
|
39
|
-
}
|
|
37
|
+
"env": { "BROWSA_API_KEY": "agt_live_..." }
|
|
40
38
|
}
|
|
41
39
|
}
|
|
42
40
|
}
|
|
43
41
|
```
|
|
44
42
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
Restart Claude Desktop. Ask: *"Go to news.ycombinator.com and tell me the top story title."*
|
|
43
|
+
Restart Claude Desktop.
|
|
48
44
|
|
|
49
45
|
### Cursor
|
|
50
46
|
|
|
51
|
-
`~/.cursor/mcp.json
|
|
47
|
+
The button above, the link `cursor://anysphere.cursor-deeplink/mcp/install?name=browsa&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkBicm93c2EvbWNwIl0sImVudiI6eyJCUk9XU0FfQVBJX0tFWSI6ImFndF9saXZlXy4uLiJ9fQ==`, or the same `mcpServers` block as Claude Desktop in `~/.cursor/mcp.json`.
|
|
52
48
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
"env": { "BROWSA_API_KEY": "agt_live_..." }
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
}
|
|
49
|
+
### VS Code
|
|
50
|
+
|
|
51
|
+
The button above, or:
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
code --add-mcp '{"name":"browsa","command":"npx","args":["-y","@browsa/mcp"],"env":{"BROWSA_API_KEY":"agt_live_..."}}'
|
|
63
55
|
```
|
|
64
56
|
|
|
65
|
-
###
|
|
57
|
+
### Windsurf
|
|
66
58
|
|
|
67
|
-
|
|
59
|
+
`~/.codeium/windsurf/mcp_config.json`, the same `mcpServers` block as Claude Desktop.
|
|
68
60
|
|
|
69
|
-
|
|
61
|
+
### Any other MCP client
|
|
70
62
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
| `BROWSA_LLM_KEY_ID` | no | Id of a saved LLM key to use by default (see `list_llm_keys`). Without it, the workspace's default saved key for the model's provider is used |
|
|
75
|
-
| `BROWSA_LLM_API_KEY` | no | A per-task LLM provider key sent with every task. Not needed once a key is saved at [dashboard/llm-keys](https://app.browsa.io/dashboard/llm-keys). Wins over `BROWSA_LLM_KEY_ID` |
|
|
76
|
-
| `BROWSA_LLM` | no | Default LLM, e.g. `anthropic:claude-sonnet-5-5`, or a hosted tier such as `browsa-fast`. Unset: the saved key's provider default model (`claude-opus-5-5` with `BROWSA_LLM_API_KEY`) |
|
|
77
|
-
| `BROWSA_COUNTRY` | no | Default egress country (e.g. `US`) |
|
|
78
|
-
| `BROWSA_BASE_URL` | no | Override prod URL (staging / self-hosted) |
|
|
79
|
-
| `BROWSA_CAPTCHA_URL` | no | Captcha API for `solve_captcha_task`. Default: https://captcha.browsa.io (`BROWSA_BASE_URL` + `/captcha-api` when that is set) |
|
|
63
|
+
Command `npx -y @browsa/mcp`, environment `BROWSA_API_KEY`. Transport: stdio. Registry name: `io.browsa/browsa`.
|
|
64
|
+
|
|
65
|
+
Then ask: *"Open books.toscrape.com and list the first five titles with their prices."*
|
|
80
66
|
|
|
81
|
-
|
|
67
|
+
## Tools
|
|
82
68
|
|
|
83
|
-
|
|
69
|
+
Nine tools are on by default. Their schemas are about 1.2k tokens in total.
|
|
84
70
|
|
|
85
|
-
|
|
71
|
+
| Tool | What it does |
|
|
72
|
+
|---|---|
|
|
73
|
+
| `open` | Opens a cloud browser and goes to `url`. Returns the browser id, a live view link and the first view. Options: `country`, `profile` (a saved identity), `proxy`, `ttl` (default 10m). |
|
|
74
|
+
| `observe` | The page as text, one line per element: `[id] role "name" state`. Default budget 1500 tokens, up to 6000. `scope: page` for the whole page, `expand` for one container in full, `find` (text or `/regex/`) for only the matching lines. |
|
|
75
|
+
| `act` | One action with real input: click, type, press, select, check, uncheck, hover, scroll, navigate, back, forward, reload, wait, upload, dialog, press_and_hold, solve_captcha. Answers with what changed (at most 400 tokens) or a fresh view. |
|
|
76
|
+
| `read` | The full content of one container, with no model: `as: text`, `table` (TSV) or `links`. |
|
|
77
|
+
| `screenshot` | A JPEG of the viewport, the full page (`full`) or one element (`id`). |
|
|
78
|
+
| `secrets` | Your saved secrets: names, kinds, the sites each may be typed on, and whether it has a one-time code. Never values. |
|
|
79
|
+
| `handoff` | A single-use live link for a person to take over: a captcha the solver gave up on, a login, a decision. The next `observe` or `act` says when the page moved on. |
|
|
80
|
+
| `flow` | `start` records your `act` and `read` steps, `save` stores them as a Browsa recipe, `run` replays it with no model calls, `list` shows them. |
|
|
81
|
+
| `close` | Closes the browser. |
|
|
86
82
|
|
|
87
|
-
|
|
88
|
-
- **A model named**: there is no fallback. The tool returns an error (code `LLM_KEY_REQUIRED`) that says to save a key at [app.browsa.io/dashboard/llm-keys](https://app.browsa.io/dashboard/llm-keys), set `BROWSA_LLM_API_KEY`, or pass `llm: "browsa"`.
|
|
83
|
+
`browser_id` is optional everywhere: it defaults to the last browser used.
|
|
89
84
|
|
|
90
|
-
|
|
85
|
+
### What an answer looks like
|
|
91
86
|
|
|
92
|
-
`
|
|
87
|
+
The first line of every `act` answer is one of `ok`, `failed`, `blocked`, `challenge`, `stale`, `dialog` or `secret_origin`, and when something stopped it says what to do next:
|
|
93
88
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
89
|
+
```
|
|
90
|
+
ok
|
|
91
|
+
after: type [3] "poetry", then Enter
|
|
92
|
+
~ [3] searchbox "Search" value "poetry"
|
|
93
|
+
settled after 180 ms, 1 request (GET /search → 200)
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
```
|
|
97
|
+
stale: the page changed and those ids are gone; nothing was done. Fresh view:
|
|
98
|
+
page "Results" https://books.toscrape.com/...
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
```
|
|
102
|
+
challenge: turnstile check appeared; next: act solve_captcha, and if it stays, handoff
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
Errors work the same way: `error: AGENT_NOT_RUNNING: agent is destroyed` is followed by `next: this browser is gone (it expired or was closed); call open for a new one`.
|
|
106
|
+
|
|
107
|
+
### Secrets by reference
|
|
108
|
+
|
|
109
|
+
Save logins, one-time-code seeds and keys once in the dashboard (Secrets). The model sees only names:
|
|
100
110
|
|
|
101
|
-
|
|
111
|
+
```
|
|
112
|
+
secrets: 1 (values are never shown; type one with act {action: "type", id, secret: REF})
|
|
113
|
+
GITHUB login on github.com and subdomains refs GITHUB:username, GITHUB:password, TOTP:GITHUB one-time code
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
`act {"action": "type", "id": 14, "secret": "GITHUB:password"}` sends only the reference. Browsa types the value inside the browser, only when the page and the field are on the secret's sites (otherwise the answer is `secret_origin` and nothing is typed), writes an audit row, and shows `<secret>GITHUB:password</secret>` wherever the value would appear. The value never passes through this MCP server or the model.
|
|
117
|
+
|
|
118
|
+
### Flows: record once, replay with no model
|
|
119
|
+
|
|
120
|
+
```
|
|
121
|
+
flow {op: "start"}
|
|
122
|
+
act ... / read ... (do the task once)
|
|
123
|
+
flow {op: "save", name: "book-search", params: {query: "poetry"}}
|
|
124
|
+
flow {op: "run", name: "book-search", params: {query: "travel"}}
|
|
125
|
+
```
|
|
102
126
|
|
|
103
|
-
`
|
|
127
|
+
`params` on save names the values you typed that should change between runs: each example value becomes `{{query}}`. Secrets you typed are saved as references. A run costs the flow's `price_credits` when it succeeds; failed runs are free. When the site changed, `run` answers `site_changed` with the step that broke: redo it with `act` and save the flow again.
|
|
104
128
|
|
|
105
|
-
|
|
129
|
+
### Privacy
|
|
106
130
|
|
|
107
|
-
|
|
131
|
+
- Tokens in URLs (query and fragment parameters such as `token`, `key`, `session`, `code`, `signature`) are shown as `***` in every answer. `BROWSA_MCP_REDACT=off` turns this off for debugging.
|
|
132
|
+
- The server writes no files. Screenshots and page text come back inline; state (open browsers, a flow being recorded) is kept in memory.
|
|
133
|
+
- Live links are single use and expire.
|
|
108
134
|
|
|
109
|
-
##
|
|
135
|
+
## More tools (optional groups)
|
|
110
136
|
|
|
111
|
-
|
|
137
|
+
Everything else from 0.5 is in groups you turn on with `BROWSA_MCP_TOOLS` (comma separated) or the argument `--tools=...`:
|
|
138
|
+
|
|
139
|
+
| Group | Tools |
|
|
112
140
|
|---|---|
|
|
113
|
-
| `
|
|
114
|
-
| `
|
|
115
|
-
| `
|
|
116
|
-
| `
|
|
117
|
-
| `
|
|
118
|
-
| `
|
|
119
|
-
| `
|
|
120
|
-
| `
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
141
|
+
| `tasks` | `run_task`, `get_job`, `cancel_job`, `respond_to_job`, `list_job_files` |
|
|
142
|
+
| `robots` | `list_robots`, `run_robot`, `get_robot_run` |
|
|
143
|
+
| `schedules` | `create_schedule`, `list_schedules` |
|
|
144
|
+
| `webhooks` | `list_webhooks`, `create_webhook`, `delete_webhook` |
|
|
145
|
+
| `cdp` | `start_browser`, `stop_browser` (a CDP address, to drive the browser from your own code) |
|
|
146
|
+
| `captcha` | `solve_captcha_task` (Browsa's captcha API, for pages outside a Browsa browser) |
|
|
147
|
+
| `admin` | `credits`, `list_browsers`, `list_identities`, `proxy_network`, `list_llm_keys`, `list_models` |
|
|
148
|
+
| `all` | every group |
|
|
149
|
+
|
|
150
|
+
```json
|
|
151
|
+
"env": { "BROWSA_API_KEY": "agt_live_...", "BROWSA_MCP_TOOLS": "tasks,robots" }
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
A tool name works too (`BROWSA_MCP_TOOLS=run_task,credits`). Calling a tool whose group is off answers with the setting that turns it on.
|
|
155
|
+
|
|
156
|
+
## Upgrading from 0.5
|
|
157
|
+
|
|
158
|
+
0.6 lists nine tools instead of 25, so a model spends far fewer tokens on tool definitions before it starts.
|
|
159
|
+
|
|
160
|
+
- **To keep every 0.5 tool**, set `BROWSA_MCP_TOOLS=all`. Nothing else changes for them: same names, same arguments, same JSON answers.
|
|
161
|
+
- `start_browser` and `stop_browser` move to the `cdp` group. Use `open` and `close` instead: `open` also navigates and returns the first view.
|
|
162
|
+
- `observe` and `act` keep their names and arguments; `browser_id` is now optional. Their answers are plain text and the first line of `act` is the status, as above. `observe`'s default budget is 1500 tokens (it was 2000); pass `budget` for more.
|
|
163
|
+
- `run_task` and the other task tools are in the `tasks` group; robots in `robots`; credits, models, keys and identities in `admin`.
|
|
164
|
+
- The task tools still read `BROWSA_LLM`, `BROWSA_LLM_KEY_ID` and `BROWSA_LLM_API_KEY`.
|
|
165
|
+
|
|
166
|
+
## Env
|
|
167
|
+
|
|
168
|
+
| Var | Required | What |
|
|
169
|
+
|---|---|---|
|
|
170
|
+
| `BROWSA_API_KEY` | yes | Your `agt_live_*` key from [app.browsa.io/dashboard/keys](https://app.browsa.io/dashboard/keys) |
|
|
171
|
+
| `BROWSA_MCP_TOOLS` | no | Optional groups to turn on, e.g. `tasks,robots`, or `all` |
|
|
172
|
+
| `BROWSA_COUNTRY` | no | Default exit country for `open` (needs a proxy) |
|
|
173
|
+
| `BROWSA_MCP_REDACT` | no | `off` shows URL tokens (debugging only) |
|
|
174
|
+
| `BROWSA_LLM`, `BROWSA_LLM_KEY_ID`, `BROWSA_LLM_API_KEY` | no | Model and key for the `tasks` and `schedules` groups. Unset: the workspace's saved key, or Browsa's hosted model |
|
|
175
|
+
| `BROWSA_CAPTCHA_URL` | no | Captcha API for `solve_captcha_task` (default `https://captcha.browsa.io`) |
|
|
176
|
+
| `BROWSA_BASE_URL` | no | Another Browsa API (staging) |
|
|
177
|
+
|
|
178
|
+
## Links
|
|
140
179
|
|
|
141
180
|
- Docs: <https://browsa.io/docs>
|
|
181
|
+
- MCP guide: <https://browsa.io/guides/mcp-server>
|
|
142
182
|
- Support: <mailto:support@browsa.io>
|
|
143
|
-
- API reference: <https://browsa.io/docs>
|
|
144
183
|
|
|
145
184
|
## License
|
|
146
185
|
|