abrasio-mcp 0.1.0__tar.gz

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.
@@ -0,0 +1,66 @@
1
+ # Publishes abrasio (Python SDK) to PyPI on every push of a version tag (v*.*.*).
2
+ #
3
+ # How to release:
4
+ # 1. Bump "version" in pyproject.toml
5
+ # 2. git add pyproject.toml && git commit -m "chore: bump to vX.Y.Z"
6
+ # 3. git tag vX.Y.Z && git push origin vX.Y.Z
7
+ #
8
+ # Required GitHub secret:
9
+ # PYPI_TOKEN — API token from pypi.org (Account Settings → API tokens → Add token)
10
+ # Scope: the "abrasio" project (or "Entire account" for the first publish)
11
+
12
+ name: Publish to PyPI
13
+
14
+ on:
15
+ push:
16
+ tags:
17
+ - "v*.*.*"
18
+
19
+ jobs:
20
+ publish:
21
+ name: Build & publish
22
+ runs-on: ubuntu-latest
23
+ permissions:
24
+ contents: write # needed to create a GitHub Release
25
+
26
+ steps:
27
+ - name: Checkout
28
+ uses: actions/checkout@v4
29
+
30
+ - name: Set up Python
31
+ uses: actions/setup-python@v5
32
+ with:
33
+ python-version: "3.11"
34
+
35
+ - name: Install build tools
36
+ run: pip install hatch build twine
37
+
38
+ - name: Verify version matches tag
39
+ run: |
40
+ PKG_VERSION="v$(python -c "import tomllib; print(tomllib.load(open('pyproject.toml','rb'))['project']['version'])")"
41
+ TAG_VERSION="${GITHUB_REF_NAME}"
42
+ if [ "$PKG_VERSION" != "$TAG_VERSION" ]; then
43
+ echo "❌ pyproject.toml version ($PKG_VERSION) does not match tag ($TAG_VERSION)"
44
+ exit 1
45
+ fi
46
+ echo "✅ Version match: $PKG_VERSION"
47
+
48
+ - name: Build wheel and sdist
49
+ run: python -m build
50
+
51
+ - name: Check distribution
52
+ run: twine check dist/*
53
+
54
+ - name: Publish to PyPI
55
+ run: twine upload dist/*
56
+ env:
57
+ TWINE_USERNAME: __token__
58
+ TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
59
+
60
+ - name: Create GitHub Release
61
+ uses: softprops/action-gh-release@v2
62
+ with:
63
+ tag_name: ${{ github.ref_name }}
64
+ name: "abrasio-mcp ${{ github.ref_name }}"
65
+ generate_release_notes: true
66
+ files: dist/*
@@ -0,0 +1,7 @@
1
+ # Build artifacts
2
+ dist/
3
+ *.egg-info/
4
+ __pycache__/
5
+ *.pyc
6
+ .venv/
7
+ venv/
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Scrape Technology
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,594 @@
1
+ Metadata-Version: 2.4
2
+ Name: abrasio-mcp
3
+ Version: 0.1.0
4
+ Summary: MCP server that exposes Abrasio as an agentic browser for AI models
5
+ Project-URL: Homepage, https://github.com/Scrape-Technology/abrasio-mcp
6
+ Project-URL: Repository, https://github.com/Scrape-Technology/abrasio-mcp
7
+ Author-email: Scrape Technology <joao.sobhie@scrapetechnology.com>
8
+ License: MIT License
9
+
10
+ Copyright (c) 2026 Scrape Technology
11
+
12
+ Permission is hereby granted, free of charge, to any person obtaining a copy
13
+ of this software and associated documentation files (the "Software"), to deal
14
+ in the Software without restriction, including without limitation the rights
15
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
16
+ copies of the Software, and to permit persons to whom the Software is
17
+ furnished to do so, subject to the following conditions:
18
+
19
+ The above copyright notice and this permission notice shall be included in all
20
+ copies or substantial portions of the Software.
21
+
22
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
28
+ SOFTWARE.
29
+ License-File: LICENSE
30
+ Keywords: abrasio,agent,ai-agent,browser-automation,mcp,patchright,stealth
31
+ Classifier: Development Status :: 4 - Beta
32
+ Classifier: Intended Audience :: Developers
33
+ Classifier: License :: OSI Approved :: MIT License
34
+ Classifier: Programming Language :: Python :: 3
35
+ Classifier: Programming Language :: Python :: 3.10
36
+ Classifier: Programming Language :: Python :: 3.11
37
+ Classifier: Programming Language :: Python :: 3.12
38
+ Requires-Python: >=3.10
39
+ Requires-Dist: abrasio>=0.1.2
40
+ Requires-Dist: mcp>=1.0.0
41
+ Provides-Extra: dev
42
+ Requires-Dist: pytest-asyncio>=0.21.0; extra == 'dev'
43
+ Requires-Dist: pytest>=7.0.0; extra == 'dev'
44
+ Description-Content-Type: text/markdown
45
+
46
+ # abrasio-mcp
47
+
48
+ MCP server that exposes **Abrasio** as an agentic browser for AI models.
49
+
50
+ Allows Claude, Cursor, and any MCP-compatible AI to control a real web browser with full anti-detection fingerprinting — the same stealth infrastructure used for web scraping, now driven by AI.
51
+
52
+ ---
53
+
54
+ ## How it works
55
+
56
+ ```
57
+ AI Model (Claude, Cursor, etc.)
58
+ │ MCP tool calls
59
+ ▼
60
+ abrasio-mcp server
61
+ │ Abrasio SDK
62
+ ▼
63
+ Patchright (undetected Playwright fork)
64
+ │ CDP WebSocket
65
+ ▼
66
+ Chrome (local stealth) OR Abrasio cloud worker (fingerprinted, residential IP)
67
+ ```
68
+
69
+ The MCP server holds a single persistent browser session. The AI calls tools to navigate, observe, and interact — no configuration needed between steps.
70
+
71
+ ---
72
+
73
+ ## Installation
74
+
75
+ ```bash
76
+ pip install abrasio-mcp
77
+ ```
78
+
79
+ Or install from source:
80
+
81
+ ```bash
82
+ cd abrasio-mcp
83
+ pip install -e .
84
+ ```
85
+
86
+ ---
87
+
88
+ ## Modes
89
+
90
+ ### Local mode (free)
91
+
92
+ No API key required. Launches Chrome on your machine with Patchright stealth patches.
93
+
94
+ ```bash
95
+ abrasio-mcp
96
+ ```
97
+
98
+ Best for: development, testing, scraping sites that don't require real residential IPs.
99
+
100
+ ### Cloud mode (paid)
101
+
102
+ Requires an Abrasio API key. The browser runs on Abrasio cloud infrastructure with:
103
+ - Real collected browser fingerprints (not spoofed)
104
+ - Residential or datacenter IP in the target region
105
+ - Persistent profiles that accumulate browser history
106
+
107
+ ```bash
108
+ ABRASIO_API_KEY=sk_live_xxx abrasio-mcp
109
+ ```
110
+
111
+ Best for: production agents, geo-targeted tasks, heavily protected sites.
112
+
113
+ ---
114
+
115
+ ## Configuration
116
+
117
+ All configuration is done via environment variables. No config files required.
118
+
119
+ | Variable | Default | Description |
120
+ |---|---|---|
121
+ | `ABRASIO_API_KEY` | _(none)_ | Cloud API key. If set, enables cloud mode. If unset, uses local mode. |
122
+ | `ABRASIO_HEADLESS` | `true` | Run browser headless. Set `false` to see the browser window (local mode only). |
123
+ | `ABRASIO_REGION` | _(none)_ | Target region for geo-configuration, e.g. `BR`, `US`, `DE`. Configures locale and timezone automatically. |
124
+ | `ABRASIO_HUMANIZE` | `false` | Set `true` to enable human-like interaction timing on all actions (slower but more realistic). |
125
+ | `ABRASIO_TRANSPORT` | `stdio` | MCP transport: `stdio` for local clients, `streamable-http` for remote/production. |
126
+ | `ABRASIO_HOST` | `127.0.0.1` | Bind host when using `streamable-http` transport. |
127
+ | `ABRASIO_PORT` | `8931` | Bind port when using `streamable-http` transport. |
128
+
129
+ ---
130
+
131
+ ## Integrations
132
+
133
+ ### Claude Desktop
134
+
135
+ Add to `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS) or `%APPDATA%\Claude\claude_desktop_config.json` (Windows):
136
+
137
+ ```json
138
+ {
139
+ "mcpServers": {
140
+ "abrasio": {
141
+ "command": "abrasio-mcp",
142
+ "env": {
143
+ "ABRASIO_API_KEY": "sk_live_xxx",
144
+ "ABRASIO_REGION": "BR"
145
+ }
146
+ }
147
+ }
148
+ }
149
+ ```
150
+
151
+ For local mode (no API key):
152
+
153
+ ```json
154
+ {
155
+ "mcpServers": {
156
+ "abrasio": {
157
+ "command": "abrasio-mcp",
158
+ "env": {
159
+ "ABRASIO_HEADLESS": "false"
160
+ }
161
+ }
162
+ }
163
+ }
164
+ ```
165
+
166
+ ### Claude Code
167
+
168
+ ```bash
169
+ claude mcp add abrasio -- abrasio-mcp
170
+ ```
171
+
172
+ With environment variables:
173
+
174
+ ```bash
175
+ claude mcp add abrasio -e ABRASIO_API_KEY=sk_live_xxx -e ABRASIO_REGION=BR -- abrasio-mcp
176
+ ```
177
+
178
+ ### Cursor
179
+
180
+ Add to `.cursor/mcp.json` in your project root:
181
+
182
+ ```json
183
+ {
184
+ "mcpServers": {
185
+ "abrasio": {
186
+ "command": "abrasio-mcp",
187
+ "env": {
188
+ "ABRASIO_API_KEY": "sk_live_xxx"
189
+ }
190
+ }
191
+ }
192
+ }
193
+ ```
194
+
195
+ ### Streamable HTTP (production / remote)
196
+
197
+ Start the server:
198
+
199
+ ```bash
200
+ ABRASIO_TRANSPORT=streamable-http \
201
+ ABRASIO_HOST=0.0.0.0 \
202
+ ABRASIO_PORT=8931 \
203
+ ABRASIO_API_KEY=sk_live_xxx \
204
+ abrasio-mcp
205
+ ```
206
+
207
+ Configure the client to connect to `http://your-server:8931/mcp`.
208
+
209
+ ---
210
+
211
+ ## Tools reference
212
+
213
+ The MCP server exposes 15 tools, organized in four groups.
214
+
215
+ ---
216
+
217
+ ### Navigation
218
+
219
+ #### `browser_navigate`
220
+
221
+ Navigate to a URL and wait for the page to load.
222
+
223
+ | Parameter | Type | Description |
224
+ |---|---|---|
225
+ | `url` | `string` | Full URL including scheme, e.g. `https://example.com` |
226
+
227
+ **Returns:** JSON object with `url` (final URL after redirects), `title`, and `status` (HTTP status code).
228
+
229
+ ```json
230
+ { "url": "https://example.com/home", "title": "Home — Example", "status": 200 }
231
+ ```
232
+
233
+ ---
234
+
235
+ #### `browser_go_back`
236
+
237
+ Go back to the previous page in browser history.
238
+
239
+ **Returns:** JSON object with `url` and `title` of the page navigated to.
240
+
241
+ ---
242
+
243
+ #### `browser_go_forward`
244
+
245
+ Go forward to the next page in browser history.
246
+
247
+ **Returns:** JSON object with `url` and `title`.
248
+
249
+ ---
250
+
251
+ #### `browser_reload`
252
+
253
+ Reload the current page.
254
+
255
+ **Returns:** JSON object with `url` and `title`.
256
+
257
+ ---
258
+
259
+ #### `browser_get_url`
260
+
261
+ Get the current page URL.
262
+
263
+ **Returns:** String with the current URL.
264
+
265
+ ---
266
+
267
+ ### Observation
268
+
269
+ #### `browser_screenshot`
270
+
271
+ Take a screenshot of the current page.
272
+
273
+ **Returns:** PNG image. Claude can see this image and use it to understand the visual state of the browser before deciding what to interact with.
274
+
275
+ > Use this at the start of a task and after each major interaction to confirm the expected result.
276
+
277
+ ---
278
+
279
+ #### `browser_get_text`
280
+
281
+ Extract all visible text from the current page body.
282
+
283
+ **Returns:** Plain text string. Useful for reading articles, prices, search results, or any text-based content without parsing HTML.
284
+
285
+ ---
286
+
287
+ #### `browser_get_html`
288
+
289
+ Get the inner HTML of an element.
290
+
291
+ | Parameter | Type | Default | Description |
292
+ |---|---|---|---|
293
+ | `selector` | `string` | `body` | CSS selector for the target element |
294
+
295
+ **Returns:** HTML string of the matched element.
296
+
297
+ ---
298
+
299
+ #### `browser_find_elements`
300
+
301
+ Find all interactive elements on the page.
302
+
303
+ **Returns:** JSON array. Each item represents a clickable, fillable, or otherwise interactive element:
304
+
305
+ ```json
306
+ [
307
+ {
308
+ "tag": "button",
309
+ "type": "submit",
310
+ "text": "Sign in",
311
+ "href": null,
312
+ "selector": "button.login-btn",
313
+ "x": 720,
314
+ "y": 412,
315
+ "visible": true
316
+ },
317
+ {
318
+ "tag": "input",
319
+ "type": "email",
320
+ "text": "",
321
+ "href": null,
322
+ "selector": "input[name=\"email\"]",
323
+ "x": 720,
324
+ "y": 340,
325
+ "visible": true
326
+ }
327
+ ]
328
+ ```
329
+
330
+ | Field | Description |
331
+ |---|---|
332
+ | `tag` | HTML tag name |
333
+ | `type` | Input type (`text`, `email`, `submit`, etc.) or `null` |
334
+ | `text` | Visible text, value, placeholder, or aria-label (up to 120 chars) |
335
+ | `href` | Link URL for anchor elements |
336
+ | `selector` | CSS selector hint — use this with `browser_click` and `browser_fill` |
337
+ | `x`, `y` | Center coordinates in the viewport |
338
+ | `visible` | Whether the element is within the current viewport |
339
+
340
+ > Call `browser_find_elements` before interacting to get the correct selector for `browser_click` and `browser_fill`.
341
+
342
+ ---
343
+
344
+ #### `browser_wait_for`
345
+
346
+ Wait for an element to appear in the DOM.
347
+
348
+ | Parameter | Type | Default | Description |
349
+ |---|---|---|---|
350
+ | `selector` | `string` | _(required)_ | CSS selector to wait for |
351
+ | `timeout` | `integer` | `10000` | Maximum wait time in milliseconds |
352
+
353
+ **Returns:** JSON object with `found: true`, the `selector`, and the element's `text` content.
354
+
355
+ Use this after triggering actions that cause loading states (form submissions, route changes, AJAX updates).
356
+
357
+ ---
358
+
359
+ ### Interaction
360
+
361
+ All interaction tools use the Abrasio human simulation layer:
362
+ - **Clicks** use WindMouse — a physics-based cursor movement algorithm that mimics real hand movement with gravity, wind perturbations, and velocity management.
363
+ - **Typing** uses character-level timing with realistic delays, burst typing, and occasional typos followed by backspace correction.
364
+ - **Scrolling** uses a 3-phase easing curve (acceleration → constant → deceleration).
365
+
366
+ ---
367
+
368
+ #### `browser_click`
369
+
370
+ Click an element by CSS selector.
371
+
372
+ | Parameter | Type | Description |
373
+ |---|---|---|
374
+ | `selector` | `string` | CSS selector for the element to click |
375
+
376
+ **Returns:** Confirmation string.
377
+
378
+ ```
379
+ Clicked: button#submit
380
+ ```
381
+
382
+ ---
383
+
384
+ #### `browser_fill`
385
+
386
+ Click a form input and fill it with text.
387
+
388
+ | Parameter | Type | Description |
389
+ |---|---|---|
390
+ | `selector` | `string` | CSS selector for the input element |
391
+ | `text` | `string` | Value to type into the field |
392
+
393
+ Clears any existing value, clicks the field, then types with human-like timing.
394
+
395
+ **Returns:** Confirmation string with character count.
396
+
397
+ > Prefer `browser_fill` over `browser_type` when targeting a specific input. Use `browser_type` only when the input is already focused.
398
+
399
+ ---
400
+
401
+ #### `browser_type`
402
+
403
+ Type text at the current cursor position.
404
+
405
+ | Parameter | Type | Description |
406
+ |---|---|---|
407
+ | `text` | `string` | Text to type |
408
+
409
+ Types into whichever element currently has focus. Useful for keyboard shortcuts, search boxes that open on click, or multi-step typing flows.
410
+
411
+ **Returns:** Confirmation string with character count.
412
+
413
+ ---
414
+
415
+ #### `browser_scroll`
416
+
417
+ Scroll the page vertically.
418
+
419
+ | Parameter | Type | Default | Description |
420
+ |---|---|---|---|
421
+ | `pixels` | `integer` | `800` | Pixels to scroll. Positive = down, negative = up. |
422
+
423
+ **Returns:** Confirmation string indicating direction and distance.
424
+
425
+ ---
426
+
427
+ #### `browser_hover`
428
+
429
+ Move the mouse over an element without clicking.
430
+
431
+ | Parameter | Type | Description |
432
+ |---|---|---|
433
+ | `selector` | `string` | CSS selector for the element to hover |
434
+
435
+ Uses WindMouse movement to reach the element. Useful for revealing dropdown menus, tooltips, or hover-triggered UI elements.
436
+
437
+ **Returns:** Confirmation string.
438
+
439
+ ---
440
+
441
+ #### `browser_press`
442
+
443
+ Press a keyboard key or key combination.
444
+
445
+ | Parameter | Type | Description |
446
+ |---|---|---|
447
+ | `key` | `string` | Key name or combination |
448
+
449
+ Common values:
450
+
451
+ | Key string | Action |
452
+ |---|---|
453
+ | `Enter` | Submit form / confirm |
454
+ | `Tab` | Move focus to next field |
455
+ | `Escape` | Close modal / cancel |
456
+ | `ArrowDown` / `ArrowUp` | Navigate dropdowns |
457
+ | `Control+a` | Select all |
458
+ | `Control+c` | Copy |
459
+ | `Meta+Return` | Submit (macOS) |
460
+
461
+ **Returns:** Confirmation string.
462
+
463
+ ---
464
+
465
+ ### Evaluation
466
+
467
+ #### `browser_evaluate`
468
+
469
+ Execute JavaScript in the current page context.
470
+
471
+ | Parameter | Type | Description |
472
+ |---|---|---|
473
+ | `script` | `string` | JavaScript expression or function |
474
+
475
+ The script can be a simple expression or a function that returns a value:
476
+
477
+ ```js
478
+ // Expression
479
+ document.title
480
+
481
+ // Arrow function
482
+ () => document.querySelectorAll('h2').length
483
+
484
+ // Function with logic
485
+ () => {
486
+ const el = document.querySelector('#price');
487
+ return el ? el.innerText.trim() : null;
488
+ }
489
+
490
+ // Read localStorage
491
+ () => ({ token: localStorage.getItem('auth_token') })
492
+ ```
493
+
494
+ **Returns:** JSON-serialized result of the script execution.
495
+
496
+ > Use this for data extraction that `browser_get_text` and `browser_get_html` cannot handle — structured data, counts, computed values, or interacting with the page's JavaScript environment.
497
+
498
+ ---
499
+
500
+ ## Patterns and best practices
501
+
502
+ ### Starting a task
503
+
504
+ Always begin with a screenshot to understand the current state:
505
+
506
+ ```
507
+ 1. browser_navigate("https://target.com")
508
+ 2. browser_screenshot() ← see what loaded
509
+ 3. browser_find_elements() ← discover available interactions
510
+ ```
511
+
512
+ ### Filling a login form
513
+
514
+ ```
515
+ 1. browser_navigate("https://site.com/login")
516
+ 2. browser_screenshot()
517
+ 3. browser_find_elements() ← get selectors for email/password fields
518
+ 4. browser_fill("input[name='email']", "user@example.com")
519
+ 5. browser_fill("input[name='password']", "secret")
520
+ 6. browser_click("button[type='submit']")
521
+ 7. browser_wait_for(".dashboard") ← wait for redirect
522
+ 8. browser_screenshot() ← confirm login succeeded
523
+ ```
524
+
525
+ ### Handling dynamic content
526
+
527
+ ```
528
+ 1. browser_click(".load-more-btn")
529
+ 2. browser_wait_for(".new-items-loaded") ← wait for content
530
+ 3. browser_get_text() ← extract updated content
531
+ ```
532
+
533
+ ### Extracting structured data
534
+
535
+ ```
536
+ 1. browser_navigate("https://shop.com/product/123")
537
+ 2. browser_evaluate("() => ({ name: document.querySelector('h1').innerText, price: document.querySelector('.price').innerText })")
538
+ ```
539
+
540
+ ### Navigating paginated results
541
+
542
+ ```
543
+ 1. browser_navigate("https://site.com/results?page=1")
544
+ 2. browser_get_text()
545
+ 3. browser_click("a[aria-label='Next page']")
546
+ 4. browser_wait_for(".results")
547
+ 5. browser_get_text()
548
+ ```
549
+
550
+ ---
551
+
552
+ ## Architecture
553
+
554
+ ```
555
+ abrasio-mcp/
556
+ ├── pyproject.toml
557
+ └── abrasio_mcp/
558
+ ├── __init__.py
559
+ ├── server.py # FastMCP server, tool registration, entry point
560
+ ├── browser.py # AbrasioBrowserAgent — wraps Abrasio SDK + Page
561
+ └── tools/
562
+ ├── __init__.py
563
+ ├── navigate.py # browser_navigate, go_back, go_forward, reload, get_url
564
+ ├── observe.py # browser_screenshot, get_text, get_html, find_elements, wait_for
565
+ ├── interact.py # browser_click, fill, type, scroll, hover, press
566
+ └── evaluate.py # browser_evaluate
567
+ ```
568
+
569
+ ### Session lifecycle
570
+
571
+ The browser session is lazy-started: the MCP server process starts immediately, and the browser only opens when the first tool is called. The session persists for the lifetime of the server process — navigation history, cookies, and localStorage are preserved across all tool calls.
572
+
573
+ On SIGTERM or SIGINT, the server calls `Abrasio.close()` which signals the worker to stop (in cloud mode) before dropping the CDP connection, ensuring proper billing finalization.
574
+
575
+ ### Browser agent (`browser.py`)
576
+
577
+ `AbrasioBrowserAgent` wraps `Abrasio` (the SDK's unified class) and holds a single `Page` object. All tools delegate to this agent. The `asyncio.Lock` on `ensure_started` prevents concurrent initialization if two tools are called in rapid succession before the browser is ready.
578
+
579
+ All interaction methods use the `human/actions.py` primitives from the Abrasio SDK directly — no custom mouse or keyboard simulation is implemented in `abrasio-mcp`.
580
+
581
+ ---
582
+
583
+ ## Requirements
584
+
585
+ - Python 3.10+
586
+ - `mcp >= 1.0.0`
587
+ - `abrasio >= 0.1.2` (installs `patchright` automatically)
588
+ - For cloud mode: an Abrasio API key (`sk_live_...`)
589
+
590
+ ---
591
+
592
+ ## License
593
+
594
+ MIT — Scrape Technology