slimbrowser-mcp 0.1.1 → 0.1.3

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.
Files changed (2) hide show
  1. package/README.md +631 -55
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,105 +1,681 @@
1
- # slimbrowser-mcp
1
+ <p align="center">
2
+ <h1 align="center">SlimBrowser MCP</h1>
3
+ <p align="center">
4
+ <strong>Token-efficient browser automation for AI agents</strong>
5
+ </p>
6
+ <p align="center">
7
+ A Model Context Protocol (MCP) server that gives AI agents full browser control —<br/>
8
+ navigate, click, type, extract data, capture sessions, and debug — all through a<br/>
9
+ clean, structured tool interface optimized for minimal token overhead.
10
+ </p>
11
+ <p align="center">
12
+ <a href="#quickstart">Quickstart</a> &nbsp;&bull;&nbsp;
13
+ <a href="#mcp-tool-catalog">Tool Catalog</a> &nbsp;&bull;&nbsp;
14
+ <a href="#mcp-resources">Resources</a> &nbsp;&bull;&nbsp;
15
+ <a href="#mcp-prompts">Prompts</a> &nbsp;&bull;&nbsp;
16
+ <a href="#client-integrations">Client Integrations</a> &nbsp;&bull;&nbsp;
17
+ <a href="#remote-chrome">Remote Chrome</a> &nbsp;&bull;&nbsp;
18
+ <a href="#configuration">Configuration</a>
19
+ </p>
20
+ </p>
21
+
22
+ ---
23
+
24
+ ## Why SlimBrowser MCP?
25
+
26
+ Most browser MCP servers dump full DOM trees and bloated HTML into your context window. That means **more tokens, higher cost, and slower agents**. SlimBrowser takes a fundamentally different approach — structured observations with three resolution modes, compact element IDs for surgical interactions, and delta-based updates that only send what changed.
27
+
28
+ ### Token Usage Comparison
29
+
30
+ > Real-world benchmark: scraping 85 posts from the same website.
2
31
 
3
- A token-efficient browser MCP server for AI agents.
32
+ ```
33
+ ┌───────────────────────┬───────────┬─────────────┬────────────┐
34
+ │ Tool │ Same task │ Tokens used │ Savings │
35
+ ├───────────────────────┼───────────┼─────────────┼────────────┤
36
+ │ Chrome DevTools MCP │ 85 posts │ ~290,000 │ baseline │
37
+ ├───────────────────────┼───────────┼─────────────┼────────────┤
38
+ │ Claude in Chrome │ 85 posts │ ~100,000 │ 65% │
39
+ ├───────────────────────┼───────────┼─────────────┼────────────┤
40
+ │ SlimBrowser MCP │ 85 posts │ ~44,000 │ 85% │
41
+ └───────────────────────┴───────────┴─────────────┴────────────┘
42
+ ```
43
+
44
+ **SlimBrowser uses 85% fewer tokens** than Chrome DevTools MCP and **56% fewer** than Claude in Chrome — for the exact same task.
45
+
46
+ ### How Token Savings Work
47
+
48
+ | Technique | How It Saves Tokens |
49
+ |-----------|-------------------|
50
+ | **SUMMARY observation mode** | Returns only interactive elements with compact EIDs — not the entire DOM tree |
51
+ | **REGION mode** | Focuses on a specific area of the page instead of dumping everything |
52
+ | **Delta-based updates** | After the first observation, only changes are sent — not the full page again |
53
+ | **Element IDs (EIDs)** | Refer to elements by short IDs (`eid: "e14"`) instead of verbose CSS selectors or XPaths |
54
+ | **Structured JSON responses** | Clean, parseable output — no HTML/markdown noise for the model to wade through |
55
+ | **Macro tools** | `browser_fill_form` replaces 4+ individual tool calls with one |
56
+ | **Budget tracking** | Built-in token/screenshot/retry budgets prevent runaway context growth |
57
+ | **Paginated diagnostics** | Console logs and network requests are paginated — fetch only what you need |
4
58
 
5
- - Chrome-only, CDP-first
6
- - Low-token observation model (`SUMMARY` by default)
7
- - Auto session capture/playback
8
- - Screenshot export with file paths returned to the agent
59
+ ### Key Advantages
9
60
 
10
- ## Quickstart (End Users)
61
+ - **85% token reduction** — proven in real-world benchmarks against leading alternatives
62
+ - **3 observation modes** — SUMMARY, REGION, and FULL let agents choose the right level of detail
63
+ - **42 specialized tools** — from one-click form fills to paginated network request inspection
64
+ - **Session capture & replay** — every action is recorded; generate visual playback HTML automatically
65
+ - **Remote Chrome support** — connect to Chrome instances running on remote machines, Docker containers, or cloud VMs
66
+ - **Multi-tab orchestration** — open, switch, pin, and close tabs with full state tracking
67
+ - **Built-in diagnostics** — console logs, network requests, performance metrics, and execution traces
68
+ - **6 AI prompt templates** — pre-built workflows for scraping, testing, security audits, and more
69
+ - **12 MCP resources** — subscribe to live session state via the `ab://` URI scheme
11
70
 
12
- ### 1) Run doctor
71
+ ---
72
+
73
+ ## Quickstart
74
+
75
+ **Prerequisites:** Node.js >= 18, Chrome/Chromium installed locally (or a remote Chrome instance).
76
+
77
+ Run the diagnostic check:
13
78
 
14
79
  ```bash
15
- npx -y slimbrowser-mcp doctor
80
+ npx -y slimbrowser-mcp@latest doctor
16
81
  ```
17
82
 
18
- ### 2) Start MCP server
83
+ Start the MCP server:
19
84
 
20
85
  ```bash
21
- npx -y slimbrowser-mcp
86
+ npx -y slimbrowser-mcp@latest
87
+ ```
88
+
89
+ Start with options:
90
+
91
+ ```bash
92
+ npx -y slimbrowser-mcp@latest \
93
+ --headless=false \
94
+ --enable-session-capture=true \
95
+ --session-capture-dir=/tmp/slimbrowser-mcp-playbacks
96
+ ```
97
+
98
+ Verify it works — ask your AI agent to run:
99
+
100
+ ```
101
+ 1. browser_create_session
102
+ 2. browser_navigate → url: "https://example.com"
103
+ 3. browser_observe → mode: "SUMMARY"
104
+ 4. browser_screenshot
105
+ ```
106
+
107
+ ---
108
+
109
+ ## MCP Tool Catalog
110
+
111
+ SlimBrowser exposes **42 tools** organized into 9 categories. Every tool follows consistent conventions:
112
+
113
+ - `session_id` is **always optional** — omit it to use the default session
114
+ - `tab_id` is **optional** — omit it to target the active tab
115
+ - `timeout_ms` is **optional** — override the default wait timeout
116
+ - Tools marked **read-only** make no mutations; tools marked **idempotent** are safe to retry
117
+
118
+ ---
119
+
120
+ ### Session Management
121
+
122
+ Create, inspect, and close browser sessions with optional session capture for full playback.
123
+
124
+ | Tool | Description | Key Parameters |
125
+ |------|-------------|----------------|
126
+ | `browser_create_session` | Create a new browser session | `tenant_id?`, `profile?`, `browser?`, `policy?` |
127
+ | `browser_get_session` | Get session details | `session_id?` |
128
+ | `browser_close_session` | Close a session (auto-finalizes capture) | `session_id?`, `final_feedback?` |
129
+ | `browser_set_default_session` | Set the default session for this client | `session_id` |
130
+ | `browser_get_session_capture` | Get capture/playback metadata | `session_id?` |
131
+ | `browser_finalize_session_capture` | Finalize recording and generate playback HTML | `session_id?`, `final_feedback?` |
132
+
133
+ <details>
134
+ <summary><strong>Session profiles & policies</strong></summary>
135
+
136
+ **Profiles** control default behavior presets:
137
+
138
+ | Profile | Use Case |
139
+ |---------|----------|
140
+ | `agent` | General-purpose AI agent browsing (default) |
141
+ | `test` | E2E test automation |
142
+ | `security` | Security auditing and passive crawling |
143
+ | `scrape` | Data extraction and scraping |
144
+
145
+ **Policies** control security boundaries:
146
+
147
+ | Policy | Behavior |
148
+ |--------|----------|
149
+ | `strict` | Restricted navigation, no script eval |
150
+ | `configurable` | Balanced defaults with overrides (default) |
151
+ | `unrestricted` | Full access, no guardrails |
152
+
153
+ </details>
154
+
155
+ <details>
156
+ <summary><strong>Session capture output</strong></summary>
157
+
158
+ When session capture is enabled, each tool call produces a frame:
159
+
160
+ ```
161
+ /tmp/slimbrowser-mcp-playbacks/
162
+ {session_id}/
163
+ playback/
164
+ 001_browser_navigate.png
165
+ 002_browser_click.png
166
+ 003_browser_type.png
167
+ ...
168
+ manifest.json
169
+ playback.html ← open this to replay visually
170
+ ```
171
+
172
+ </details>
173
+
174
+ ---
175
+
176
+ ### Observation & Navigation
177
+
178
+ Read page state and navigate between URLs. The observation system is the core of SlimBrowser's token efficiency.
179
+
180
+ | Tool | Description | Key Parameters | Traits |
181
+ |------|-------------|----------------|--------|
182
+ | `browser_observe` | Read current page state | `mode?`, `region?` | Read-only, Idempotent |
183
+ | `browser_snapshot` | Capture a point-in-time observation | `mode?`, `region?` | Read-only, Idempotent |
184
+ | `browser_navigate` | Navigate to a URL | `url`, `timeout_ms?` | |
185
+ | `browser_back` | Go back in history | `timeout_ms?` | |
186
+ | `browser_forward` | Go forward in history | `timeout_ms?` | |
187
+ | `browser_reload` | Reload current page | `timeout_ms?` | |
188
+
189
+ <details>
190
+ <summary><strong>Observation modes — the core of token efficiency</strong></summary>
191
+
192
+ The observation system is what makes SlimBrowser dramatically more token-efficient than alternatives. Instead of dumping the entire DOM, you choose exactly how much detail you need:
193
+
194
+ | Mode | Token Cost | What You Get | When to Use |
195
+ |------|-----------|--------------|-------------|
196
+ | `SUMMARY` | **~50-200 tokens** | Page title, URL, interactable elements with compact EIDs, state hints | Default — use for 90% of interactions |
197
+ | `REGION` | **~200-500 tokens** | Focused observation of a specific page region | When you need detail on a specific area |
198
+ | `FULL` | **~500-2000 tokens** | Complete page content with all elements | Last resort when SUMMARY isn't enough |
199
+
200
+ Compare this to other tools that send **5,000-30,000 tokens per page observation** regardless of what you need.
201
+
202
+ The observation payload includes:
203
+ - **Interactables** — clickable/typeable elements with compact `eid`, `role`, `name`, `hint`, `state`, and `bbox`
204
+ - **Delta** — only what changed since the last observation (subsequent calls are even cheaper)
205
+ - **Budget** — remaining token/screenshot/retry budgets to prevent runaway context growth
206
+
207
+ **Pro tip:** Start with `SUMMARY` mode. Only escalate to `REGION` or `FULL` if the agent needs more context. This single practice can cut your token usage by 80%+ compared to full-DOM approaches.
208
+
209
+ </details>
210
+
211
+ ---
212
+
213
+ ### Interaction
214
+
215
+ Click, type, select, scroll, and wait. All interaction tools return a normalized action response.
216
+
217
+ | Tool | Description | Key Parameters |
218
+ |------|-------------|----------------|
219
+ | `browser_click` | Click an element by EID | `eid`, `timeout_ms?` |
220
+ | `browser_type` | Type text into an element | `eid`, `text`, `timeout_ms?` |
221
+ | `browser_select` | Select a dropdown option | `eid`, `option`, `timeout_ms?` |
222
+ | `browser_scroll` | Scroll the page | `dx?`, `dy?`, `timeout_ms?` |
223
+ | `browser_wait_for` | Wait for a condition to be true | `predicate`, `timeout_ms?` |
224
+
225
+ <details>
226
+ <summary><strong>Action response format</strong></summary>
227
+
228
+ Every interaction tool returns:
229
+
230
+ ```json
231
+ {
232
+ "action_id": "act_abc123",
233
+ "status": "OK | FAILED | AMBIGUOUS | BLOCKED",
234
+ "message": "Human-readable result",
235
+ "evidence": [],
236
+ "delta": { "...changes since last observation..." },
237
+ "budget": { "...remaining budgets..." }
238
+ }
239
+ ```
240
+
241
+ | Status | Meaning |
242
+ |--------|---------|
243
+ | `OK` | Action completed successfully |
244
+ | `FAILED` | Action could not be performed |
245
+ | `AMBIGUOUS` | Multiple matches found — refine your selector |
246
+ | `BLOCKED` | Action blocked by policy or page state |
247
+
248
+ </details>
249
+
250
+ ---
251
+
252
+ ### Tab Management
253
+
254
+ Open, switch, pin, and close tabs. Full multi-tab orchestration for complex workflows.
255
+
256
+ | Tool | Description | Key Parameters | Traits |
257
+ |------|-------------|----------------|--------|
258
+ | `browser_open_tab` | Open a new tab | `url?` (defaults to `about:blank`) | |
259
+ | `browser_list_tabs` | List all tabs in session | | Read-only, Idempotent |
260
+ | `browser_switch_tab` | Switch the active tab | `tab_id` | |
261
+ | `browser_close_tab` | Close a tab | `tab_id` | |
262
+ | `browser_pin_tab` | Pin or unpin a tab | `tab_id`, `pinned?` | |
263
+
264
+ ---
265
+
266
+ ### Macro & Discovery Tools
267
+
268
+ High-level tools that combine multiple primitives for common operations.
269
+
270
+ | Tool | Description | Key Parameters |
271
+ |------|-------------|----------------|
272
+ | `browser_fill_form` | Fill multiple form fields at once | `fields` (object: `label -> value`) |
273
+ | `browser_click_by_text` | Click the first element matching text | `text`, `timeout_ms?` |
274
+ | `browser_type_by_label` | Type into an input matching a label | `label`, `text`, `timeout_ms?` |
275
+ | `browser_find_interactables` | Search for interactive elements | `query` |
276
+
277
+ <details>
278
+ <summary><strong>Example: fill a login form in one call</strong></summary>
279
+
280
+ ```json
281
+ {
282
+ "tool": "browser_fill_form",
283
+ "arguments": {
284
+ "fields": {
285
+ "Email": "user@example.com",
286
+ "Password": "••••••••"
287
+ }
288
+ }
289
+ }
22
290
  ```
23
291
 
24
- No `.env` is required for default usage.
292
+ This finds each field by label and types the value — replacing what would be 4+ separate tool calls.
25
293
 
26
- ## Connect to Claude Code
294
+ </details>
27
295
 
28
- Add server:
296
+ ---
297
+
298
+ ### Data Extraction & Artifacts
299
+
300
+ Extract structured data from pages, capture screenshots, and manage session artifacts.
301
+
302
+ | Tool | Description | Key Parameters | Traits |
303
+ |------|-------------|----------------|--------|
304
+ | `browser_extract` | Extract structured data using a JSON schema | `schema?` | Read-only, Idempotent |
305
+ | `browser_screenshot` | Capture a screenshot | `output_dir?`, `file_name?` | Idempotent |
306
+ | `browser_list_artifacts` | List all session artifacts | | Read-only, Idempotent |
307
+
308
+ <details>
309
+ <summary><strong>Screenshot output</strong></summary>
310
+
311
+ ```json
312
+ {
313
+ "artifact": {
314
+ "id": "art_xyz",
315
+ "path": "/internal/path/screenshot.png",
316
+ "size_bytes": 45320,
317
+ "created_at": "2025-01-15T10:30:00Z"
318
+ },
319
+ "artifact_path": "/internal/path/screenshot.png",
320
+ "saved_path": "/tmp/my-dir/screenshot.png",
321
+ "exported_path": "/tmp/my-dir/screenshot.png"
322
+ }
323
+ ```
324
+
325
+ </details>
326
+
327
+ ---
328
+
329
+ ### Diagnostics & Performance
330
+
331
+ Inspect console logs, network traffic, dialogs, and performance metrics — all through paginated, structured APIs.
332
+
333
+ | Tool | Description | Key Parameters | Traits |
334
+ |------|-------------|----------------|--------|
335
+ | `browser_evaluate_script` | Execute JavaScript in the page | `script`, `args?` | |
336
+ | `browser_list_console_messages` | Read console logs (paginated) | `cursor?`, `limit?` | Read-only, Idempotent |
337
+ | `browser_get_console_message` | Get a single console message | `message_id` | Read-only, Idempotent |
338
+ | `browser_list_network_requests` | Read network requests (paginated) | `cursor?`, `limit?` | Read-only, Idempotent |
339
+ | `browser_get_network_request` | Get a single network request | `request_id` | Read-only, Idempotent |
340
+ | `browser_list_dialogs` | Read alert/confirm/prompt dialogs | `cursor?`, `limit?` | Read-only, Idempotent |
341
+ | `browser_handle_dialog` | Accept or dismiss a dialog | `dialog_id`, `action?`, `text?` | |
342
+ | `browser_get_performance` | Get navigation & resource timing | | Read-only, Idempotent |
343
+
344
+ ---
345
+
346
+ ### Tracing & Replay
347
+
348
+ Record execution traces and replay them for debugging and reproducibility.
349
+
350
+ | Tool | Description | Traits |
351
+ |------|-------------|--------|
352
+ | `browser_get_trace` | Get all trace events for a session | Read-only, Idempotent |
353
+ | `browser_replay_trace` | Replay recorded trace events | Idempotent |
354
+
355
+ ---
356
+
357
+ ### Capability & Mode
358
+
359
+ Query and configure runtime capabilities.
360
+
361
+ | Tool | Description | Key Parameters | Traits |
362
+ |------|-------------|----------------|--------|
363
+ | `browser_capabilities` | Get supported browsers, modes, and features | | Read-only, Idempotent |
364
+ | `browser_get_headless_mode` | Check current headless/headed mode | | Read-only, Idempotent |
365
+ | `browser_set_headless_mode` | Switch between headless and headed | `headless` (boolean) | |
366
+
367
+ ---
368
+
369
+ ## MCP Resources
370
+
371
+ SlimBrowser exposes **12 resources** via the `ab://` URI scheme. Clients can read these directly or subscribe to live updates.
372
+
373
+ | URI | Description | Type |
374
+ |-----|-------------|------|
375
+ | `ab://sessions` | Default session pointer and client state | Static |
376
+ | `ab://session/{session_id}/state` | Session metadata and status | Dynamic |
377
+ | `ab://session/{session_id}/tabs` | Current tab graph snapshot | Dynamic |
378
+ | `ab://session/{session_id}/trace` | Execution trace events | Dynamic |
379
+ | `ab://session/{session_id}/artifacts` | Artifact metadata list | Dynamic |
380
+ | `ab://session/{session_id}/artifact/{artifact_id}` | Single artifact metadata | Dynamic |
381
+ | `ab://session/{session_id}/capture` | Capture/playback state and paths | Dynamic |
382
+ | `ab://session/{session_id}/tab/{tab_id}/observation?mode=` | Tab observation (SUMMARY/REGION/FULL) | Dynamic |
383
+ | `ab://session/{session_id}/console?cursor=` | Paginated console messages | Paginated |
384
+ | `ab://session/{session_id}/network?cursor=` | Paginated network requests | Paginated |
385
+ | `ab://session/{session_id}/dialogs?cursor=` | Paginated dialog records | Paginated |
386
+ | `ab://session/{session_id}/performance/latest` | Latest performance metrics | Dynamic |
387
+
388
+ **Subscriptions:** Use `resources/subscribe` and `resources/unsubscribe` to receive live updates when session state changes.
389
+
390
+ ---
391
+
392
+ ## MCP Prompts
393
+
394
+ SlimBrowser ships with **6 pre-built prompt templates** — ready-made workflows that agents can invoke directly.
395
+
396
+ | Prompt | Purpose | Required Arg |
397
+ |--------|---------|--------------|
398
+ | `agent_task_min_tokens` | Plan and execute a workflow with minimal token overhead | `goal` |
399
+ | `e2e_test_stabilization` | Recover and stabilize flaky E2E test scenarios | `scenario` |
400
+ | `security_passive_crawl` | Non-destructive security crawl with diagnostics | `scope` |
401
+ | `schema_scrape_pagination` | Schema-driven extraction across paginated content | `schema` (JSON) |
402
+ | `checkout_multistep_runner` | Robust multi-step checkout automation | `target` |
403
+ | `triage_failed_action_with_artifacts` | Diagnose failures using traces and artifacts | `failure_context` |
404
+
405
+ **Completions:** The server provides intelligent argument completions for `browser`, `profile`, `mode`, `session_id`, `tab_id`, `url`, `schema`, `eid`, and `text` parameters.
406
+
407
+ ---
408
+
409
+ ## Client Integrations
410
+
411
+ ### Codex
29
412
 
30
413
  ```bash
31
- claude mcp add --scope local slimbrowser -- npx -y slimbrowser-mcp
414
+ # Add
415
+ codex mcp add slimbrowser -- \
416
+ npx -y slimbrowser-mcp@latest \
417
+ --headless=false \
418
+ --enable-session-capture=true \
419
+ --session-capture-dir=/tmp/slimbrowser-mcp-playbacks
420
+
421
+ # List / Remove
422
+ codex mcp list
423
+ codex mcp remove slimbrowser
32
424
  ```
33
425
 
34
- Check status:
426
+ ### Claude Code
35
427
 
36
428
  ```bash
37
- /mcp
429
+ # Add (user scope)
430
+ claude mcp add --scope user slimbrowser -- \
431
+ npx -y slimbrowser-mcp@latest \
432
+ --headless=false \
433
+ --enable-session-capture=true \
434
+ --session-capture-dir=/tmp/slimbrowser-mcp-playbacks
435
+
436
+ # List / Remove
437
+ claude mcp list --scope user
438
+ claude mcp remove --scope user slimbrowser
38
439
  ```
39
440
 
40
- Remove server:
441
+ ### Gemini CLI
41
442
 
42
443
  ```bash
43
- claude mcp remove --scope local slimbrowser
444
+ # Add
445
+ gemini mcp add slimbrowser \
446
+ npx -y slimbrowser-mcp@latest \
447
+ --headless=false \
448
+ --enable-session-capture=true \
449
+ --session-capture-dir=/tmp/slimbrowser-mcp-playbacks
450
+
451
+ # List / Remove
452
+ gemini mcp list
453
+ gemini mcp remove slimbrowser
44
454
  ```
45
455
 
46
- ## What the Agent Can Do
456
+ ### Claude Desktop
457
+
458
+ Add to your Claude Desktop MCP configuration:
459
+
460
+ ```json
461
+ {
462
+ "mcpServers": {
463
+ "slimbrowser": {
464
+ "command": "npx",
465
+ "args": [
466
+ "-y",
467
+ "slimbrowser-mcp@latest",
468
+ "--headless=false",
469
+ "--enable-session-capture=true",
470
+ "--session-capture-dir=/tmp/slimbrowser-mcp-playbacks"
471
+ ]
472
+ }
473
+ }
474
+ }
475
+ ```
47
476
 
48
- Core tools include:
477
+ ### Cursor
478
+
479
+ Edit `~/.cursor/mcp.json` (Windows: `%USERPROFILE%\.cursor\mcp.json`):
480
+
481
+ ```json
482
+ {
483
+ "mcpServers": {
484
+ "slimbrowser": {
485
+ "command": "npx",
486
+ "args": [
487
+ "-y",
488
+ "slimbrowser-mcp@latest",
489
+ "--headless=false",
490
+ "--enable-session-capture=true",
491
+ "--session-capture-dir=/tmp/slimbrowser-mcp-playbacks"
492
+ ]
493
+ }
494
+ }
495
+ }
496
+ ```
49
497
 
50
- - Session: `browser_create_session`, `browser_get_session`, `browser_close_session`
51
- - Observe/Navigate: `browser_observe`, `browser_navigate`, `browser_back`, `browser_forward`, `browser_reload`
52
- - Interact: `browser_click`, `browser_type`, `browser_select`, `browser_scroll`, `browser_wait_for`
53
- - Tabs: `browser_open_tab`, `browser_list_tabs`, `browser_switch_tab`, `browser_close_tab`
54
- - Data/Artifacts: `browser_extract`, `browser_screenshot`, `browser_list_artifacts`
55
- - Diagnostics: `browser_list_console_messages`, `browser_list_network_requests`, `browser_get_performance`
498
+ ### Windsurf
499
+
500
+ Edit `~/.codeium/windsurf/mcp_config.json` (Windows: `%USERPROFILE%\.codeium\windsurf\mcp_config.json`):
501
+
502
+ ```json
503
+ {
504
+ "mcpServers": {
505
+ "slimbrowser": {
506
+ "command": "npx",
507
+ "args": [
508
+ "-y",
509
+ "slimbrowser-mcp@latest",
510
+ "--headless=false",
511
+ "--enable-session-capture=true",
512
+ "--session-capture-dir=/tmp/slimbrowser-mcp-playbacks"
513
+ ]
514
+ }
515
+ }
516
+ }
517
+ ```
518
+
519
+ ---
56
520
 
57
- Full catalog: [docs/MCP_TOOL_CATALOG.md](docs/MCP_TOOL_CATALOG.md)
521
+ ## Remote Chrome
58
522
 
59
- ## Screenshots and Playback
523
+ SlimBrowser supports connecting to **remote Chrome/Chromium instances** — run the browser on a remote server, Docker container, CI runner, or cloud VM, and control it from anywhere.
60
524
 
61
- - `browser_screenshot` returns artifact metadata and saved file path.
62
- - Session capture starts with session creation (if enabled).
63
- - When the task ends, the agent should call `browser_finalize_session_capture`.
64
- - Final playback file path is returned, so it can be used in reports.
525
+ ### Connect to a Remote Chrome Instance
65
526
 
66
- Default capture directory:
527
+ Use the `--chrome-debugger-address` flag to point SlimBrowser at a Chrome instance exposing its DevTools protocol:
67
528
 
68
529
  ```bash
69
- /tmp/slimbrowser-mcp-playbacks
530
+ npx -y slimbrowser-mcp@latest \
531
+ --chrome-debugger-address=192.168.1.100:9222
70
532
  ```
71
533
 
72
- ## Minimal Configuration (Optional)
534
+ ### Launch Chrome with Remote Debugging
73
535
 
74
- Set only if you want overrides:
536
+ On the remote machine, start Chrome with debugging enabled:
75
537
 
76
538
  ```bash
77
- # MCP transport/runtime
78
- MCP_TRANSPORT=stdio
79
- MCP_RUNTIME_MODE=embedded
539
+ # Linux / macOS
540
+ google-chrome \
541
+ --remote-debugging-port=9222 \
542
+ --remote-debugging-address=0.0.0.0 \
543
+ --no-first-run \
544
+ --no-default-browser-check \
545
+ --user-data-dir=/tmp/chrome-remote
546
+
547
+ # Docker
548
+ docker run -d \
549
+ -p 9222:9222 \
550
+ --name chrome-remote \
551
+ chromedp/headless-shell:latest \
552
+ --remote-debugging-address=0.0.0.0 \
553
+ --remote-debugging-port=9222
554
+ ```
80
555
 
81
- # Chrome mode
82
- CHROME_HEADLESS=false
556
+ ### Client Configuration for Remote Chrome
83
557
 
84
- # Session capture
85
- MCP_ENABLE_SESSION_CAPTURE=true
86
- MCP_SESSION_CAPTURE_DIR=/tmp/slimbrowser-mcp-playbacks
558
+ **CLI agents (Codex, Claude Code, Gemini CLI):**
559
+
560
+ ```bash
561
+ codex mcp add slimbrowser -- \
562
+ npx -y slimbrowser-mcp@latest \
563
+ --chrome-debugger-address=your-server:9222 \
564
+ --headless=true
87
565
  ```
88
566
 
89
- Config resolution order:
567
+ **JSON-based clients (Claude Desktop, Cursor, Windsurf):**
568
+
569
+ ```json
570
+ {
571
+ "mcpServers": {
572
+ "slimbrowser": {
573
+ "command": "npx",
574
+ "args": [
575
+ "-y",
576
+ "slimbrowser-mcp@latest",
577
+ "--chrome-debugger-address=your-server:9222",
578
+ "--headless=true"
579
+ ]
580
+ }
581
+ }
582
+ }
583
+ ```
584
+
585
+ ### Custom Chrome Binary & Profile
586
+
587
+ For environments with non-standard Chrome installations:
588
+
589
+ ```bash
590
+ npx -y slimbrowser-mcp@latest \
591
+ --chrome-binary-path=/opt/google/chrome/chrome \
592
+ --chrome-user-data-dir=/home/user/.config/chromium
593
+ ```
594
+
595
+ ### Common Remote Scenarios
596
+
597
+ | Scenario | Flags |
598
+ |----------|-------|
599
+ | Chrome on another machine | `--chrome-debugger-address=<host>:9222` |
600
+ | Chrome in Docker | `--chrome-debugger-address=localhost:9222` (with `-p 9222:9222`) |
601
+ | Chrome on a cloud VM | `--chrome-debugger-address=<vm-ip>:9222` (ensure port is open) |
602
+ | Skip auto-launch, use existing Chrome | `--chrome-launch-on-start=false --chrome-debugger-address=localhost:9222` |
603
+ | Custom Chrome binary | `--chrome-binary-path=/path/to/chrome` |
604
+ | Custom Chrome profile | `--chrome-user-data-dir=/path/to/profile` |
605
+
606
+ ---
607
+
608
+ ## Configuration
609
+
610
+ ### Command-Line Flags
611
+
612
+ All flags can be passed directly as command arguments — no `.env` file required.
90
613
 
91
- 1. `--config <path>`
92
- 2. `MCP_CONFIG=<path>`
93
- 3. `./configs/mcp.toml`
94
- 4. `./mcp.toml`
95
- 5. `$HOME/.config/slimbrowser-mcp/mcp.toml`
96
- 6. Built-in defaults
614
+ #### Transport & Runtime
615
+
616
+ | Flag | Values | Default | Description |
617
+ |------|--------|---------|-------------|
618
+ | `--transport` | `stdio`, `http`, `both` | `stdio` | MCP transport mode |
619
+ | `--runtime-mode` | `embedded`, `gateway` | `embedded` | Run browser engine in-process or connect to a gateway |
620
+ | `--config` | `<path>` | — | Path to a TOML config file |
621
+
622
+ #### Browser Control
623
+
624
+ | Flag | Values | Default | Description |
625
+ |------|--------|---------|-------------|
626
+ | `--headless` | `true`, `false` | `true` | Run Chrome in headless or headed mode |
627
+ | `--autostart` | `auto`, `drivers`, `none` | `auto` | Browser autostart behavior |
628
+ | `--chrome-launch-on-start` | `true`, `false` | `true` | Auto-launch Chrome when server starts |
629
+ | `--chrome-binary-path` | `<path>` | — | Path to Chrome/Chromium binary |
630
+ | `--chrome-debugger-address` | `<host:port>` | — | Connect to an existing Chrome DevTools Protocol endpoint |
631
+ | `--chrome-user-data-dir` | `<path>` | — | Chrome user data directory (profile) |
632
+
633
+ #### Session Capture
634
+
635
+ | Flag | Values | Default | Description |
636
+ |------|--------|---------|-------------|
637
+ | `--enable-session-capture` | `true`, `false` | `true` | Record screenshots after each tool call |
638
+ | `--session-capture-dir` | `<path>` | `/tmp/slimbrowser-mcp-playbacks` | Output directory for capture frames |
639
+
640
+ ### MCP Protocol Details
641
+
642
+ | Property | Value |
643
+ |----------|-------|
644
+ | Protocol version | `2025-11-25` |
645
+ | HTTP binding | `127.0.0.1:3100` |
646
+ | HTTP endpoint | `/mcp` |
647
+ | Auth | Bearer tokens, origin-based CORS |
648
+ | Transports | stdio (default), HTTP, both |
649
+
650
+ ---
97
651
 
98
652
  ## Troubleshooting
99
653
 
100
- - If `/mcp` shows `connecting` or `failed`, run: `npx -y slimbrowser-mcp doctor`
101
- - If Chrome cannot be controlled, confirm Chrome is installed and retry.
102
- - If a tool fails, use `browser_get_trace` and `browser_list_artifacts` for debugging evidence.
654
+ **Server won't connect or shows `connecting` / `failed`:**
655
+
656
+ ```bash
657
+ npx -y slimbrowser-mcp@latest doctor
658
+ ```
659
+
660
+ **Chrome not found:**
661
+ - Ensure Chrome/Chromium is installed locally, or
662
+ - Point to it with `--chrome-binary-path=/path/to/chrome`
663
+
664
+ **Remote Chrome not reachable:**
665
+ - Verify the remote Chrome was started with `--remote-debugging-port=9222 --remote-debugging-address=0.0.0.0`
666
+ - Check firewall rules allow traffic on the debugging port
667
+ - Test connectivity: `curl http://<host>:9222/json/version`
668
+
669
+ **Action failures:**
670
+ - Use `browser_get_trace` to inspect the execution trace
671
+ - Use `browser_list_artifacts` to find screenshots and other evidence
672
+ - Use the `triage_failed_action_with_artifacts` prompt for AI-assisted diagnosis
673
+
674
+ **Session capture not working:**
675
+ - Ensure `--enable-session-capture=true` is set
676
+ - Check that `--session-capture-dir` points to a writable directory
677
+
678
+ ---
103
679
 
104
680
  ## License
105
681
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "slimbrowser-mcp",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "npx bootstrap launcher for slimbrowser-mcp",
5
5
  "publishConfig": {
6
6
  "access": "public"