@automatebrowser/mcp 0.3.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/package.json ADDED
@@ -0,0 +1,80 @@
1
+ {
2
+ "name": "@automatebrowser/mcp",
3
+ "version": "0.3.0",
4
+ "description": "MCP server for browser automation using AutomateBrowser",
5
+ "author": "AutomateBrowser",
6
+ "homepage": "https://farazpawle.github.io/automatebrowser/",
7
+ "bugs": "https://github.com/farazpawle/automatebrowser/issues",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/farazpawle/automatebrowser.git"
11
+ },
12
+ "type": "module",
13
+ "bin": {
14
+ "mcp-server-automatebrowser": "dist/index.js",
15
+ "automate-browser": "dist/cli.js"
16
+ },
17
+ "files": [
18
+ "dist",
19
+ "skills",
20
+ ".claude-plugin",
21
+ "CHANGELOG.md"
22
+ ],
23
+ "engines": {
24
+ "node": ">=18"
25
+ },
26
+ "scripts": {
27
+ "check": "npm run contracts:check && npm run typecheck && npm run typecheck:tests && npm run lint && npm run format:check && npm run test && npm run build && npm run verify:release && npm run tokens && npm run docs:generate && npm run smoke && npm audit --omit=dev",
28
+ "typecheck": "tsc --noEmit",
29
+ "typecheck:tests": "tsc --noEmit -p tsconfig.test.json",
30
+ "lint": "eslint .",
31
+ "format": "prettier --write .",
32
+ "format:check": "prettier --check .",
33
+ "test": "node scripts/run-tests.mjs",
34
+ "smoke": "node scripts/connection-smoke.cjs",
35
+ "tokens": "node scripts/count-tokens.mjs",
36
+ "verify:release": "node scripts/verify-release.mjs",
37
+ "docs:generate": "node scripts/generate-docs.mjs",
38
+ "contracts:generate": "node scripts/generate-browser-contract.mjs",
39
+ "contracts:check": "node scripts/generate-browser-contract.mjs --check",
40
+ "build": "tsup --format esm && shx chmod +x dist/*.js",
41
+ "prepare": "npm run build",
42
+ "watch": "tsup --format esm --watch",
43
+ "inspector": "CLIENT_PORT=9001 SERVER_PORT=9002 pnpx @modelcontextprotocol/inspector node dist/index.js",
44
+ "test:integration": "node scripts/integration-browser.mjs",
45
+ "test:live": "node scripts/live-checks.mjs",
46
+ "eval": "node scripts/eval-agent.mjs",
47
+ "memory:relay": "node scripts/relay-memory.mjs"
48
+ },
49
+ "dependencies": {
50
+ "@modelcontextprotocol/sdk": "^1.30.0",
51
+ "commander": "^13.1.0",
52
+ "ws": "^8.21.0",
53
+ "zod": "^3.24.2",
54
+ "zod-to-json-schema": "^3.25.2"
55
+ },
56
+ "overrides": {
57
+ "esbuild": "^0.28.1",
58
+ "hono": "^4.13.5",
59
+ "ip-address": "^10.5.0",
60
+ "fast-uri": "^3.1.7",
61
+ "qs": "^6.16.0"
62
+ },
63
+ "devDependencies": {
64
+ "@anthropic-ai/sdk": "^0.121.0",
65
+ "@eslint/js": "^10.0.1",
66
+ "@types/ws": "^8.18.0",
67
+ "ajv": "^8.20.0",
68
+ "ajv-formats": "^3.0.1",
69
+ "eslint": "^10.10.0",
70
+ "globals": "^16.5.0",
71
+ "gpt-tokenizer": "^3.4.0",
72
+ "prettier": "^3.9.6",
73
+ "puppeteer": "^25.9.0",
74
+ "shx": "^0.3.4",
75
+ "tsup": "^8.4.0",
76
+ "tsx": "^4.23.13",
77
+ "typescript": "^5.6.2",
78
+ "typescript-eslint": "^8.70.0"
79
+ }
80
+ }
@@ -0,0 +1,181 @@
1
+ ---
2
+ name: automate-browser
3
+ description: >
4
+ Drive the user's real, logged-in browser with AutomateBrowser — tab ownership, clicking and
5
+ filling, extraction, sessions, screenshots and diagnostics, across all 46 tools.
6
+ Read lines 11-24 of SKILL.md first to confirm scope.
7
+ ---
8
+
9
+ # AutomateBrowser
10
+
11
+ ## Scope Gate — Read First (Lines 11-24)
12
+
13
+ **This skill IS for:**
14
+ - Driving the user's real browser: navigating, clicking, filling, reading, extracting
15
+ - Choosing the right tool, and the right tab, out of the 46 tools this server serves
16
+ - Diagnosing a call that failed, did nothing, or collided with another agent
17
+
18
+ **This skill is NOT for:**
19
+ - Building or debugging AutomateBrowser itself — that is the maintainer skills, not this one
20
+ - Any other browser automation (Playwright, Puppeteer, chrome-devtools-mcp)
21
+
22
+ **Matches → keep reading. No match → stop.**
23
+
24
+ ---
25
+
26
+ ## Golden rules
27
+
28
+ 1. **Your tab is one you own — never the user's.** You either opened it or adopted it because you
29
+ were asked to. On your first action you are given a background tab automatically. There is no
30
+ fallback to "whatever tab is in front", and you must not build one.
31
+ 2. **Fresh work goes in a background tab.** That is the default; you do not have to ask for it.
32
+ 3. **To pick up work already in progress**, adopt it explicitly:
33
+ `browser_select_tab { url: "localhost:3000" }` — or by `title`. It is driven where it sits.
34
+ 4. **Only `browser_switch_tab` takes the user's focus.** Use it when, and only when, they asked to be
35
+ *shown* something. Same for `browser_new_tab { active: true }`.
36
+ 5. **Address elements by `ref`, never a raw CSS selector.** Refs come from `browser_snapshot` or the
37
+ much cheaper `browser_find`, and every interaction wants a human-readable `element` description
38
+ alongside the ref.
39
+ 6. **Release when you finish.** `browser_release_client` closes the tabs **you opened** and leaves
40
+ any tab you adopted from the user exactly where it was.
41
+ 7. **You are acting as the user.** Their logins, their address, their accounts. Respect rate limits
42
+ and terms of use, never type credentials you were not given, and leave their session as you found
43
+ it.
44
+
45
+ ## The standard loop
46
+
47
+ ```
48
+ adopt a tab → browser_select_tab (only to take over something the user has open)
49
+ navigate → browser_navigate { url } ← already returns a snapshot with refs
50
+ survey → browser_find { text: "..." } ← only when you did NOT just navigate
51
+ act → browser_click / browser_type / browser_fill_form (on refs)
52
+ verify → browser_read_page, or include: "snapshot" on click / type
53
+ ```
54
+
55
+ **Do not call `browser_find` straight after `browser_navigate`.** Navigation returns a full snapshot by
56
+ default — the refs you need are already in that reply, so a survey call there is a wasted round-trip.
57
+ Survey when you have arrived some other way, or when the page has changed under you.
58
+
59
+ Two habits that save most of the remaining round-trips:
60
+
61
+ - **`include: "snapshot"`** on click or type returns the fresh page in the same reply. (Navigation
62
+ does it for you; interactions do not, because most of them do not change the page enough to matter.)
63
+ - **`browser_fill_form`** fills every field at once. Never click-and-type field by field.
64
+
65
+ When something silently does nothing, `browser_issues` is the tool that sees it — CSP blocks, dropped
66
+ third-party cookies, CORS — none of which produce a console error.
67
+
68
+ ## Section index
69
+
70
+ Open the reference you need, at the lines you need. Do not read a whole file to answer one question.
71
+
72
+ <details><summary>references/tabs-and-multi-agent.md (156 lines) — which tab am I allowed to drive?</summary>
73
+
74
+ | Section | Lines |
75
+ |---|---|
76
+ | The one rule | 17-31 |
77
+ | Getting a tab — `new` vs `select` vs `switch` | 32-48 |
78
+ | A logged-out tab, and the setting it needs | 49-73 |
79
+ | Focus: who may take it | 74-83 |
80
+ | Finishing: what gets cleaned up | 84-109 |
81
+ | Two agents, one browser — claims, `TAB_CLAIMED`, `LEASE_LOST` | 110-131 |
82
+ | Several browsers | 132-147 |
83
+ | Being a good neighbour | 148-156 |
84
+
85
+ </details>
86
+
87
+ <details><summary>references/page-interaction.md (237 lines) — clicking, typing, waiting</summary>
88
+
89
+ | Section | Lines |
90
+ |---|---|
91
+ | Refs, not selectors | 18-30 |
92
+ | Finding an element cheaply | 31-50 |
93
+ | The interaction tools | 51-63 |
94
+ | Filling a form in one call | 64-107 |
95
+ | Clicking what a snapshot cannot name | 108-120 |
96
+ | Waiting for the page to catch up | 121-136 |
97
+ | The defaults includeSnapshot / waitUntil / settleMs already have | 137-152 |
98
+ | Reading a navigation's settled | 153-172 |
99
+ | When a navigation did not happen at all | 173-189 |
100
+ | Actionability: why a click refuses | 190-211 |
101
+ | When a ref goes stale | 212-237 |
102
+
103
+ </details>
104
+
105
+ <details><summary>references/reading-and-extraction.md (113 lines) — getting data out</summary>
106
+
107
+ | Section | Lines |
108
+ |---|---|
109
+ | Pick the cheapest tool that answers the question | 16-28 |
110
+ | The extraction loop | 29-39 |
111
+ | Extract with a function, not an expression | 40-64 |
112
+ | Big results go to a file | 65-81 |
113
+ | Pagination | 82-99 |
114
+ | What will bite you | 100-113 |
115
+
116
+ </details>
117
+
118
+ <details><summary>references/sessions-and-state.md (186 lines) — logins, cookies, dialogs, files</summary>
119
+
120
+ | Section | Lines |
121
+ |---|---|
122
+ | Start from "already signed in" | 19-32 |
123
+ | Never type credentials you were not given | 33-37 |
124
+ | 2FA, CAPTCHA and consent screens | 38-52 |
125
+ | Cookies and storage | 53-77 |
126
+ | Dialogs | 78-92 |
127
+ | Uploads and downloads | 93-105 |
128
+ | Restricted pages | 106-110 |
129
+ | When something works signed in and fails signed out | 111-120 |
130
+ | **Recipe** — a session that will not stick, in six calls | 121-182 |
131
+ | Leave the session as you found it | 183-186 |
132
+
133
+ </details>
134
+
135
+ <details><summary>references/capture-and-diagnostics.md (486 lines) — screenshots, logs, network, speed, recipes</summary>
136
+
137
+ | Section | Lines |
138
+ |---|---|
139
+ | Screenshots — incl. what a picture costs, the size ceiling and `ref` crops | 24-84 |
140
+ | A strip of stills — several frames on a timer | 85-114 |
141
+ | Screenshotting a tab the user is not looking at | 115-148 |
142
+ | Console logs — incl. paging | 149-162 |
143
+ | The issues feed: failures with no console error | 163-176 |
144
+ | Accessibility: a floor, not a pass | 177-205 |
145
+ | Network — incl. paging | 206-217 |
146
+ | The footers on every action | 218-237 |
147
+ | Performance — incl. the LCP breakdown and render-blocking list | 238-264 |
148
+ | Memory: is this page leaking? | 265-302 |
149
+ | Emulation | 303-311 |
150
+ | Advanced mode, and what it costs — incl. why there is NO certificate bypass | 312-369 |
151
+ | **Recipe** — "this page is slow", cheapest evidence first | 370-438 |
152
+ | **Recipe** — auditing a page for accessibility | 439-486 |
153
+
154
+ </details>
155
+
156
+ <details><summary>references/troubleshooting.md (136 lines) — when it will not drive the browser</summary>
157
+
158
+ | Section | Lines |
159
+ |---|---|
160
+ | Always start here — `browser_status` | 17-28 |
161
+ | The `link:` line — whether it is coming back | 29-45 |
162
+ | "No connection to browser extension" | 46-77 |
163
+ | A call that hangs, then times out | 78-83 |
164
+ | An action reports success but nothing happened | 84-93 |
165
+ | It acted on the wrong tab | 94-105 |
166
+ | The error codes | 106-126 |
167
+ | Three things that are not faults | 127-136 |
168
+
169
+ </details>
170
+
171
+ <details><summary>references/tool-reference.md (236 lines) — all 46 tools, arguments and gotchas</summary>
172
+
173
+ | Section | Lines |
174
+ |---|---|
175
+ | The tools — generated from the live schemas, grouped | 18-126 |
176
+ | Arguments and gotchas — hand-written, one row per tool | 127-236 |
177
+
178
+ The tables are regenerated by `npm run docs:generate` and the build fails if a tool exists with no
179
+ entry, so this list cannot fall behind the server.
180
+
181
+ </details>