@ricardodeazambuja/browser-mcp-server 1.0.3 → 1.4.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/CHANGELOG-v1.3.0.md +42 -0
- package/CHANGELOG-v1.4.0.md +8 -0
- package/README.md +271 -45
- package/package.json +11 -10
- package/plugins/.gitkeep +0 -0
- package/src/.gitkeep +0 -0
- package/src/browser.js +152 -0
- package/src/cdp.js +58 -0
- package/src/index.js +126 -0
- package/src/tools/.gitkeep +0 -0
- package/src/tools/console.js +139 -0
- package/src/tools/docs.js +1611 -0
- package/src/tools/index.js +60 -0
- package/src/tools/info.js +139 -0
- package/src/tools/interaction.js +126 -0
- package/src/tools/keyboard.js +27 -0
- package/src/tools/media.js +264 -0
- package/src/tools/mouse.js +104 -0
- package/src/tools/navigation.js +72 -0
- package/src/tools/network.js +552 -0
- package/src/tools/pages.js +149 -0
- package/src/tools/performance.js +517 -0
- package/src/tools/security.js +470 -0
- package/src/tools/storage.js +467 -0
- package/src/tools/system.js +196 -0
- package/src/utils.js +131 -0
- package/tests/.gitkeep +0 -0
- package/tests/fixtures/.gitkeep +0 -0
- package/tests/fixtures/test-media.html +35 -0
- package/tests/fixtures/test-network.html +48 -0
- package/tests/fixtures/test-performance.html +61 -0
- package/tests/fixtures/test-security.html +33 -0
- package/tests/fixtures/test-storage.html +76 -0
- package/tests/run-all.js +50 -0
- package/{test-browser-automation.js → tests/test-browser-automation.js} +44 -5
- package/{test-mcp.js → tests/test-mcp.js} +9 -4
- package/tests/test-media-tools.js +168 -0
- package/tests/test-network.js +212 -0
- package/tests/test-performance.js +254 -0
- package/tests/test-security.js +203 -0
- package/tests/test-storage.js +192 -0
- package/CHANGELOG-v1.0.2.md +0 -126
- package/browser-mcp-server-playwright.js +0 -792
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# Changelog - v1.3.0 (2025-12-27)
|
|
2
|
+
|
|
3
|
+
This is a major architectural release that modularizes the entire codebase for better maintainability, testing, and extensibility.
|
|
4
|
+
|
|
5
|
+
## ⭐ New Features
|
|
6
|
+
|
|
7
|
+
- **Modular Architecture**: The codebase is now organization into focused modules in `src/`:
|
|
8
|
+
- `src/index.js`: Main entry point and MCP protocol handler
|
|
9
|
+
- `src/browser.js`: Centralized browser connection and state management
|
|
10
|
+
- `src/tools/`: Dedicated modules for each tool category (navigation, interaction, media, etc.)
|
|
11
|
+
- `src/utils.js`: Shared utilities
|
|
12
|
+
- **Plugin System**: New `plugins/` directory allows adding specialized tool modules that are auto-discovered by `src/tools/index.js`.
|
|
13
|
+
- **Improved Test Suite**: Tests are now organized in the `tests/` directory with `fixtures/`.
|
|
14
|
+
- **Reduced Bundle Size**: The main entry point is now cleaner and easier to maintain.
|
|
15
|
+
|
|
16
|
+
## 🛠 Refactoring
|
|
17
|
+
|
|
18
|
+
- **Source Code**: Moved all source code from the root directory to `src/`.
|
|
19
|
+
- **Entry Point**: Replaced the monolithic `browser-mcp-server-playwright.js` with `src/index.js`.
|
|
20
|
+
- **Tool Logic**: Extracted tool implementations from the main server file into:
|
|
21
|
+
- `src/tools/navigation.js`
|
|
22
|
+
- `src/tools/interaction.js`
|
|
23
|
+
- `src/tools/media.js`
|
|
24
|
+
- `src/tools/system.js`
|
|
25
|
+
- `src/tools/console.js`
|
|
26
|
+
- `src/tools/info.js`
|
|
27
|
+
- `src/tools/mouse.js`
|
|
28
|
+
- `src/tools/keyboard.js`
|
|
29
|
+
- `src/tools/pages.js`
|
|
30
|
+
- **Utilities**: Extracted `debugLog`, `loadPlaywright`, and `findChromeExecutable` to `src/utils.js`.
|
|
31
|
+
|
|
32
|
+
## 🧹 Cleanup
|
|
33
|
+
|
|
34
|
+
- Removed the legacy `browser-mcp-server-playwright.js` wrapper file.
|
|
35
|
+
- Removed old `.tgz` build artifacts.
|
|
36
|
+
- Updated `package.json` to point `main` and `bin` to `src/index.js`.
|
|
37
|
+
|
|
38
|
+
## 🧪 Testing
|
|
39
|
+
|
|
40
|
+
- Verified all 36 tools function correctly after modularization.
|
|
41
|
+
- Verified MCP protocol communication.
|
|
42
|
+
- Verified browser connection strategies (Antigravity, System Chrome, Playwright).
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# Changelog - v1.4.0 (2026-01-01)
|
|
2
|
+
|
|
3
|
+
- ✅ **Full Power User Suite**: Added 26 CDP-based tools for performance, network, security, and storage analysis (63 tools total)
|
|
4
|
+
- ✅ **Version Unification**: Centralized version management to use `package.json` as the single source of truth
|
|
5
|
+
- ✅ **Performance Profiling**: Added CPU profiling, heap snapshots, and web vitals monitoring
|
|
6
|
+
- ✅ **Network Analysis**: Added request monitoring, HAR export, and WebSocket inspection
|
|
7
|
+
- ✅ **Security Testing**: Added security header inspection, CSP monitoring, and certificate details
|
|
8
|
+
- ✅ **Storage Inspection**: Added IndexedDB, Cache Storage, and Service Worker management
|
package/README.md
CHANGED
|
@@ -2,14 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
A universal browser automation MCP server using Playwright. Control Chrome programmatically through the Model Context Protocol.
|
|
4
4
|
|
|
5
|
-
**
|
|
5
|
+
**63 powerful browser automation tools** including multi-tab management, media monitoring/control, low-level interaction, session recording, CDP-based performance profiling, network analysis, security testing, and on-demand documentation.
|
|
6
6
|
|
|
7
7
|
## Features
|
|
8
8
|
|
|
9
9
|
- ✅ **Smart Chrome Detection**: Automatically finds and uses system Chrome/Chromium
|
|
10
10
|
- ✅ **Three-Tier Strategy**: Antigravity Chrome → System Chrome → Playwright Chromium
|
|
11
11
|
- ✅ **Universal**: Works with Antigravity, Claude Desktop, and any MCP client
|
|
12
|
-
- ✅ **
|
|
12
|
+
- ✅ **63 Tools**: Media control, multi-tab, pixel-based interaction, CDP power user tools, and more
|
|
13
|
+
- ✅ **On-Demand Docs**: Built-in documentation tool with return schemas and examples
|
|
13
14
|
- ✅ **Auto-Install**: Playwright installed automatically via npm (no manual setup)
|
|
14
15
|
- ✅ **Safe**: Isolated browser profile (won't touch your personal Chrome)
|
|
15
16
|
- ✅ **Console Capture**: Debug JavaScript errors in real-time
|
|
@@ -73,8 +74,8 @@ npx playwright install chromium
|
|
|
73
74
|
|
|
74
75
|
```bash
|
|
75
76
|
# Download the main file directly (no git required)
|
|
76
|
-
curl -o
|
|
77
|
-
https://raw.githubusercontent.com/ricardodeazambuja/browser-mcp-server/main/
|
|
77
|
+
curl -o src/index.js \
|
|
78
|
+
https://raw.githubusercontent.com/ricardodeazambuja/browser-mcp-server/main/src/index.js
|
|
78
79
|
|
|
79
80
|
# Install Playwright
|
|
80
81
|
npm install playwright
|
|
@@ -93,7 +94,7 @@ Add to your Claude Desktop config (`~/Library/Application Support/Claude/claude_
|
|
|
93
94
|
"mcpServers": {
|
|
94
95
|
"browser-tools": {
|
|
95
96
|
"command": "node",
|
|
96
|
-
"args": ["/absolute/path/to/
|
|
97
|
+
"args": ["/absolute/path/to/src/index.js"]
|
|
97
98
|
}
|
|
98
99
|
}
|
|
99
100
|
}
|
|
@@ -123,7 +124,7 @@ Add to `~/.gemini/antigravity/mcp_config.json`:
|
|
|
123
124
|
"mcpServers": {
|
|
124
125
|
"browser-tools": {
|
|
125
126
|
"command": "node",
|
|
126
|
-
"args": ["/home/username/.gemini/antigravity/
|
|
127
|
+
"args": ["/home/username/.gemini/antigravity/src/index.js"]
|
|
127
128
|
}
|
|
128
129
|
}
|
|
129
130
|
}
|
|
@@ -151,12 +152,12 @@ Add the browser-mcp-server using the Claude CLI:
|
|
|
151
152
|
```bash
|
|
152
153
|
# Install the MCP server with default isolated profile
|
|
153
154
|
claude mcp add --transport stdio browser \
|
|
154
|
-
-- node /absolute/path/to/
|
|
155
|
+
-- node /absolute/path/to/src/index.js
|
|
155
156
|
|
|
156
157
|
# Or with custom browser profile for more control
|
|
157
158
|
claude mcp add --transport stdio browser \
|
|
158
159
|
--env MCP_BROWSER_PROFILE=/path/to/custom/profile \
|
|
159
|
-
-- node /absolute/path/to/
|
|
160
|
+
-- node /absolute/path/to/src/index.js
|
|
160
161
|
```
|
|
161
162
|
|
|
162
163
|
**Using NPM:**
|
|
@@ -202,11 +203,11 @@ Add the browser-mcp-server using the Gemini CLI commands:
|
|
|
202
203
|
**Using local installation:**
|
|
203
204
|
```bash
|
|
204
205
|
# Install the MCP server with default isolated profile
|
|
205
|
-
gemini mcp add browser node /absolute/path/to/
|
|
206
|
+
gemini mcp add browser node /absolute/path/to/src/index.js
|
|
206
207
|
|
|
207
208
|
# Or with custom browser profile
|
|
208
209
|
gemini mcp add -e MCP_BROWSER_PROFILE=/path/to/custom/profile browser \
|
|
209
|
-
node /absolute/path/to/
|
|
210
|
+
node /absolute/path/to/src/index.js
|
|
210
211
|
```
|
|
211
212
|
|
|
212
213
|
**Using NPM:**
|
|
@@ -243,40 +244,197 @@ gemini mcp remove browser
|
|
|
243
244
|
|
|
244
245
|
```bash
|
|
245
246
|
# Add with specific scope (user vs project)
|
|
246
|
-
gemini mcp add -s user browser node /path/to/
|
|
247
|
+
gemini mcp add -s user browser node /path/to/src/index.js
|
|
247
248
|
|
|
248
249
|
# Add with timeout configuration
|
|
249
|
-
gemini mcp add --timeout 30000 browser node /path/to/
|
|
250
|
+
gemini mcp add --timeout 30000 browser node /path/to/src/index.js
|
|
250
251
|
|
|
251
252
|
# Skip tool confirmation prompts (use with caution)
|
|
252
|
-
gemini mcp add --trust browser node /path/to/
|
|
253
|
+
gemini mcp add --trust browser node /path/to/src/index.js
|
|
253
254
|
```
|
|
254
255
|
|
|
255
|
-
## Available Tools (
|
|
256
|
+
## Available Tools (63)
|
|
257
|
+
|
|
258
|
+
### Documentation
|
|
259
|
+
1. **browser_docs(toolName?)** - Get detailed docs, return schemas, examples, and caveats for any tool
|
|
260
|
+
|
|
261
|
+
### Multi-Page Management
|
|
262
|
+
2. **browser_list_pages()** - List all open tabs/pages
|
|
263
|
+
3. **browser_new_page(url?)** - Open a new tab
|
|
264
|
+
4. **browser_switch_page(index)** - Switch active tab
|
|
265
|
+
5. **browser_close_page(index?)** - Close a tab
|
|
266
|
+
|
|
267
|
+
### Media Awareness & Control
|
|
268
|
+
6. **browser_get_media_summary()** - List all audio/video elements with state
|
|
269
|
+
7. **browser_get_audio_analysis(durationMs?, selector?)** - Analyze audio output (volume, spectrum)
|
|
270
|
+
8. **browser_control_media(selector, action, value?)** - Play, pause, mute, seek
|
|
256
271
|
|
|
257
272
|
### Navigation & Interaction
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
273
|
+
9. **browser_navigate(url)** - Navigate to a URL
|
|
274
|
+
10. **browser_click(selector)** - Click an element (selector-based)
|
|
275
|
+
11. **browser_type(selector, text)** - Type text into an input
|
|
276
|
+
12. **browser_scroll(x?, y?)** - Scroll the page (generic)
|
|
277
|
+
13. **browser_reload()** - Reload current page
|
|
278
|
+
14. **browser_go_back()** - Navigate back
|
|
279
|
+
15. **browser_go_forward()** - Navigate forward
|
|
280
|
+
16. **browser_wait(ms)** - Pause execution
|
|
281
|
+
|
|
282
|
+
### Low-Level Interaction
|
|
283
|
+
17. **browser_mouse_move(x, y)** - Move mouse to pixel coordinates
|
|
284
|
+
18. **browser_mouse_click(x?, y?, button?, count?)** - Click at pixel coordinates
|
|
285
|
+
19. **browser_mouse_drag(fromX, fromY, toX, toY)** - Drag and drop
|
|
286
|
+
20. **browser_mouse_wheel(deltaX, deltaY)** - Scroll mouse wheel
|
|
287
|
+
21. **browser_press_key(key)** - Send keyboard event (e.g. "Enter")
|
|
262
288
|
|
|
263
289
|
### Information Gathering
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
290
|
+
22. **browser_screenshot(fullPage?)** - Capture screenshot
|
|
291
|
+
23. **browser_get_text(selector)** - Get text from element
|
|
292
|
+
24. **browser_get_dom(selector?)** - Get DOM structure
|
|
293
|
+
25. **browser_read_page()** - Get page metadata (title, URL)
|
|
294
|
+
26. **browser_evaluate(code)** - Execute JavaScript
|
|
295
|
+
|
|
296
|
+
### Console Debugging
|
|
297
|
+
27. **browser_console_start(level?)** - Start capturing logs
|
|
298
|
+
28. **browser_console_get(filter?)** - Get captured logs
|
|
299
|
+
29. **browser_console_clear()** - Clear logs and stop
|
|
300
|
+
|
|
301
|
+
### Advanced Interaction
|
|
302
|
+
30. **browser_hover(selector)** - Hover over element
|
|
303
|
+
31. **browser_focus(selector)** - Focus element
|
|
304
|
+
32. **browser_select(selector, values)** - Select dropdown options
|
|
305
|
+
33. **browser_wait_for_selector(selector, timeout?)** - Wait for element
|
|
306
|
+
34. **browser_resize_window(width, height)** - Resize window
|
|
307
|
+
35. **browser_start_video_recording(path?)** - Start session recording
|
|
308
|
+
36. **browser_stop_video_recording()** - Stop and save recording
|
|
309
|
+
37. **browser_health_check()** - Verify browser connection
|
|
310
|
+
|
|
311
|
+
## 🔬 Power User Tools (CDP-Based)
|
|
312
|
+
|
|
313
|
+
Advanced diagnostic tools using Chrome DevTools Protocol for performance analysis, network debugging, security testing, and storage inspection. These 26 additional tools provide deep insights into browser internals.
|
|
314
|
+
|
|
315
|
+
### Performance Profiling (8 tools)
|
|
316
|
+
38. **browser_perf_start_profile(sampleInterval?)** - Start CPU profiling
|
|
317
|
+
39. **browser_perf_stop_profile()** - Get CPU profile data with summary
|
|
318
|
+
40. **browser_perf_take_heap_snapshot(reportProgress?)** - Capture memory snapshot
|
|
319
|
+
41. **browser_perf_get_heap_usage()** - Current JavaScript heap statistics
|
|
320
|
+
42. **browser_perf_get_metrics()** - Runtime metrics (DOM nodes, listeners, etc.)
|
|
321
|
+
43. **browser_perf_get_performance_metrics()** - Web vitals (FCP, LCP, CLS, TTFB)
|
|
322
|
+
44. **browser_perf_start_coverage(resetOnNavigation?)** - Track code coverage
|
|
323
|
+
45. **browser_perf_stop_coverage()** - Get coverage results
|
|
324
|
+
|
|
325
|
+
**Use Cases**: Memory leak detection, CPU profiling, performance optimization, code coverage analysis, web vitals monitoring
|
|
326
|
+
|
|
327
|
+
### Network Analysis (7 tools)
|
|
328
|
+
46. **browser_net_start_monitoring(patterns?)** - Monitor network requests
|
|
329
|
+
47. **browser_net_get_requests(filter?)** - Get captured requests with timing
|
|
330
|
+
48. **browser_net_stop_monitoring()** - Stop monitoring and clear log
|
|
331
|
+
49. **browser_net_export_har(includeContent?)** - Export HTTP Archive log
|
|
332
|
+
50. **browser_net_get_websocket_frames(requestId)** - Inspect WebSocket frames
|
|
333
|
+
51. **browser_net_set_request_blocking(patterns)** - Block URL patterns
|
|
334
|
+
52. **browser_net_emulate_conditions(offline, latency, download, upload)** - Network throttling
|
|
335
|
+
|
|
336
|
+
**Use Cases**: API debugging, HAR export, WebSocket debugging, performance testing, request blocking, network throttling
|
|
337
|
+
|
|
338
|
+
### Security Testing (6 tools)
|
|
339
|
+
53. **browser_sec_get_security_headers()** - Inspect security HTTP headers
|
|
340
|
+
54. **browser_sec_get_certificate_info()** - TLS/SSL certificate details
|
|
341
|
+
55. **browser_sec_detect_mixed_content()** - Find HTTP resources on HTTPS pages
|
|
342
|
+
56. **browser_sec_start_csp_monitoring()** - Monitor CSP violations
|
|
343
|
+
57. **browser_sec_get_csp_violations()** - Get violation log
|
|
344
|
+
58. **browser_sec_stop_csp_monitoring()** - Stop monitoring
|
|
345
|
+
|
|
346
|
+
**Use Cases**: Security audits, CSP debugging, HTTPS migration, certificate validation, mixed content detection
|
|
347
|
+
|
|
348
|
+
### Storage & Service Workers (5 tools)
|
|
349
|
+
59. **browser_storage_get_indexeddb(databaseName?, objectStoreName?)** - Inspect IndexedDB
|
|
350
|
+
60. **browser_storage_get_cache_storage(cacheName?)** - List Cache Storage entries
|
|
351
|
+
61. **browser_storage_delete_cache(cacheName)** - Delete cache
|
|
352
|
+
62. **browser_storage_get_service_workers()** - Service worker state
|
|
353
|
+
63. **browser_storage_unregister_service_worker(scopeURL)** - Unregister worker
|
|
354
|
+
|
|
355
|
+
**Use Cases**: IndexedDB inspection, Cache Storage management, Service Worker debugging, offline functionality testing
|
|
356
|
+
|
|
357
|
+
### Getting Started with CDP Tools
|
|
358
|
+
|
|
359
|
+
```javascript
|
|
360
|
+
// Start CPU profiling
|
|
361
|
+
browser_perf_start_profile({})
|
|
362
|
+
// ... perform actions to profile ...
|
|
363
|
+
browser_perf_stop_profile({}) // Get results
|
|
364
|
+
|
|
365
|
+
// Monitor network activity
|
|
366
|
+
browser_net_start_monitoring({})
|
|
367
|
+
// ... navigate and interact ...
|
|
368
|
+
browser_net_get_requests({ filter: 'api' })
|
|
369
|
+
browser_net_export_har({})
|
|
370
|
+
|
|
371
|
+
// Security audit
|
|
372
|
+
browser_sec_get_security_headers({})
|
|
373
|
+
browser_sec_start_csp_monitoring({})
|
|
374
|
+
// ... trigger violations ...
|
|
375
|
+
browser_sec_get_csp_violations({})
|
|
376
|
+
|
|
377
|
+
// Inspect storage
|
|
378
|
+
browser_storage_get_indexeddb({ databaseName: 'myDB' })
|
|
379
|
+
browser_storage_get_cache_storage({ cacheName: 'my-cache-v1' })
|
|
380
|
+
```
|
|
381
|
+
|
|
382
|
+
**Note**: All CDP tools have comprehensive documentation available via `browser_docs({ toolName: 'browser_perf_start_profile' })`.
|
|
383
|
+
|
|
384
|
+
## On-Demand Documentation
|
|
385
|
+
|
|
386
|
+
The `browser_docs` tool provides comprehensive documentation for all browser tools **without increasing token overhead** in normal operations.
|
|
387
|
+
|
|
388
|
+
### Why This Matters
|
|
389
|
+
|
|
390
|
+
- **Token Efficient**: Tool descriptions stay concise (saving tokens on every request)
|
|
391
|
+
- **Comprehensive**: Detailed docs available when needed (return schemas, examples, caveats)
|
|
392
|
+
- **Self-Documenting**: AI agents can discover tool capabilities on-demand
|
|
393
|
+
|
|
394
|
+
### What You Get
|
|
395
|
+
|
|
396
|
+
When calling `browser_docs(toolName)`, you receive:
|
|
397
|
+
- **Parameter Details**: Types, optionality, defaults, enums
|
|
398
|
+
- **Return Value Schemas**: Exact structure of what the tool returns
|
|
399
|
+
- **Selector Syntax**: How to write Playwright selectors (CSS, text, data attributes)
|
|
400
|
+
- **Important Caveats**: Warnings about CORS, clearing behavior, state management
|
|
401
|
+
- **Practical Examples**: Real-world usage patterns
|
|
402
|
+
|
|
403
|
+
### Usage
|
|
404
|
+
|
|
405
|
+
```javascript
|
|
406
|
+
// Get docs for a specific tool
|
|
407
|
+
browser_docs({ toolName: 'browser_get_audio_analysis' })
|
|
408
|
+
|
|
409
|
+
// List all available tools
|
|
410
|
+
browser_docs({})
|
|
411
|
+
|
|
412
|
+
// Invalid tool name suggests similar tools
|
|
413
|
+
browser_docs({ toolName: 'navigate' })
|
|
414
|
+
// → Did you mean: browser_navigate, browser_go_back, ...
|
|
415
|
+
```
|
|
416
|
+
|
|
417
|
+
### Example Output
|
|
418
|
+
|
|
419
|
+
```
|
|
420
|
+
📖 browser_type(selector, text)
|
|
421
|
+
|
|
422
|
+
Type text into an input field.
|
|
423
|
+
|
|
424
|
+
Parameters:
|
|
425
|
+
• selector (string, required) - Playwright selector for the input
|
|
426
|
+
• text (string, required) - Text to type
|
|
427
|
+
|
|
428
|
+
Returns:
|
|
429
|
+
{ content: [{ type: 'text', text: 'Typed into <selector>' }] }
|
|
430
|
+
|
|
431
|
+
⚠️ Important:
|
|
432
|
+
• Uses page.fill() which CLEARS the field first, then types
|
|
433
|
+
• Does NOT append to existing text
|
|
434
|
+
|
|
435
|
+
Example:
|
|
436
|
+
browser_type({ selector: '#username', text: 'john@example.com' })
|
|
437
|
+
```
|
|
280
438
|
|
|
281
439
|
## Examples
|
|
282
440
|
|
|
@@ -297,14 +455,48 @@ browser_console_get(filter: "error")
|
|
|
297
455
|
// Shows: ❌ [ERROR] Uncaught TypeError: ...
|
|
298
456
|
```
|
|
299
457
|
|
|
300
|
-
###
|
|
458
|
+
### Media Monitoring & Control
|
|
459
|
+
```javascript
|
|
460
|
+
// Agent uses:
|
|
461
|
+
browser_navigate("https://youtube.com/watch?v=...")
|
|
462
|
+
browser_get_media_summary() // See active video state
|
|
463
|
+
browser_control_media(selector: "video", action: "play")
|
|
464
|
+
browser_get_audio_analysis(durationMs: 2000) // "Hear" the volume
|
|
465
|
+
```
|
|
466
|
+
|
|
467
|
+
### Multi-Tab Automation
|
|
468
|
+
```javascript
|
|
469
|
+
// Agent uses:
|
|
470
|
+
browser_navigate("https://wikipedia.org")
|
|
471
|
+
browser_new_page("https://google.com")
|
|
472
|
+
browser_list_pages() // Shows 2 pages
|
|
473
|
+
browser_switch_page(0) // Back to Wikipedia
|
|
474
|
+
```
|
|
475
|
+
|
|
476
|
+
### Pixel-Based Interaction
|
|
301
477
|
```javascript
|
|
302
478
|
// Agent uses:
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
479
|
+
browser_mouse_move(500, 300)
|
|
480
|
+
browser_mouse_click(button: "right")
|
|
481
|
+
browser_press_key("Enter")
|
|
482
|
+
```
|
|
483
|
+
|
|
484
|
+
### Get Tool Documentation
|
|
485
|
+
```javascript
|
|
486
|
+
// Agent uses:
|
|
487
|
+
browser_docs(toolName: "browser_get_audio_analysis")
|
|
488
|
+
// Returns:
|
|
489
|
+
// 📖 browser_get_audio_analysis(durationMs?, selector?)
|
|
490
|
+
//
|
|
491
|
+
// Parameters:
|
|
492
|
+
// • durationMs (number, optional) - Duration to analyze in ms (default: 2000)
|
|
493
|
+
// • selector (string, optional) - Selector for specific media element
|
|
494
|
+
//
|
|
495
|
+
// Returns: { isSilent: boolean, averageVolume: number, ... }
|
|
496
|
+
// ⚠️ Important: Requires CORS headers for cross-origin media
|
|
497
|
+
|
|
498
|
+
// List all tools:
|
|
499
|
+
browser_docs() // Shows all 63 tools
|
|
308
500
|
```
|
|
309
501
|
|
|
310
502
|
## How It Works
|
|
@@ -381,7 +573,7 @@ This MCP server provides powerful browser automation capabilities. Please review
|
|
|
381
573
|
export MCP_BROWSER_PROFILE="$HOME/.mcp-browser-profile"
|
|
382
574
|
|
|
383
575
|
# Then run the server
|
|
384
|
-
node
|
|
576
|
+
node src/index.js
|
|
385
577
|
```
|
|
386
578
|
|
|
387
579
|
### MCP Config with Environment Variables
|
|
@@ -391,7 +583,7 @@ node browser-mcp-server-playwright.js
|
|
|
391
583
|
"mcpServers": {
|
|
392
584
|
"browser-tools": {
|
|
393
585
|
"command": "node",
|
|
394
|
-
"args": ["/path/to/
|
|
586
|
+
"args": ["/path/to/src/index.js"],
|
|
395
587
|
"env": {
|
|
396
588
|
"MCP_BROWSER_PROFILE": "/tmp/my-custom-profile"
|
|
397
589
|
}
|
|
@@ -452,7 +644,14 @@ Use the `browser_health_check` tool to verify:
|
|
|
452
644
|
|
|
453
645
|
```
|
|
454
646
|
browser-mcp-server/
|
|
455
|
-
├──
|
|
647
|
+
├── src/index.js # Main server entry point
|
|
648
|
+
├── src/ # Source code
|
|
649
|
+
│ ├── index.js # Main server class
|
|
650
|
+
│ ├── browser.js # Browser management
|
|
651
|
+
│ ├── tools/ # Tool modules
|
|
652
|
+
│ └── utils.js # Utilities
|
|
653
|
+
├── tests/ # Test suite
|
|
654
|
+
├── plugins/ # Plugin directory
|
|
456
655
|
├── package.json # npm package config
|
|
457
656
|
├── README.md # This file
|
|
458
657
|
└── LICENSE # MIT license
|
|
@@ -465,7 +664,7 @@ browser-mcp-server/
|
|
|
465
664
|
npm test
|
|
466
665
|
|
|
467
666
|
# Manual test
|
|
468
|
-
echo '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"test","version":"1.0.0"}}}' | node
|
|
667
|
+
echo '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"test","version":"1.0.0"}}}' | node src/index.js
|
|
469
668
|
```
|
|
470
669
|
|
|
471
670
|
### Debug Logging
|
|
@@ -520,7 +719,7 @@ Check `/tmp/mcp-browser-server.log` for detailed logs:
|
|
|
520
719
|
## Comparison with Other Tools
|
|
521
720
|
|
|
522
721
|
### vs. Puppeteer MCP Servers
|
|
523
|
-
- ✅ More tools (
|
|
722
|
+
- ✅ More tools (63 vs typical 8-10)
|
|
524
723
|
- ✅ Console capture built-in
|
|
525
724
|
- ✅ Better error messages
|
|
526
725
|
- ✅ Hybrid mode (connect OR launch)
|
|
@@ -563,6 +762,33 @@ MIT License - see LICENSE file
|
|
|
563
762
|
|
|
564
763
|
## Changelog
|
|
565
764
|
|
|
765
|
+
### v1.4.0 (2026-01-01) ⭐ NEW
|
|
766
|
+
- ✅ **Full Power User Suite**: Added 26 CDP-based tools for performance, network, security, and storage analysis (63 tools total)
|
|
767
|
+
- ✅ **Version Unification**: Centralized version management to use `package.json` as the single source of truth
|
|
768
|
+
- ✅ **Performance Profiling**: Added CPU profiling, heap snapshots, and web vitals monitoring
|
|
769
|
+
- ✅ **Network Analysis**: Added request monitoring, HAR export, and WebSocket inspection
|
|
770
|
+
- ✅ **Security Testing**: Added security header inspection, CSP monitoring, and certificate details
|
|
771
|
+
- ✅ **Storage Inspection**: Added IndexedDB, Cache Storage, and Service Worker management
|
|
772
|
+
|
|
773
|
+
### v1.3.0 (2025-12-27)
|
|
774
|
+
- ✅ **On-Demand Documentation**: New `browser_docs` tool provides detailed specs, return schemas, examples, and caveats for all 37 tools
|
|
775
|
+
- ✅ **Modular Architecture**: Complete refactor into `src/` modules for better maintainability
|
|
776
|
+
- ✅ **Plugin System**: New `plugins/` directory for extending functionality
|
|
777
|
+
- ✅ **Improved Testing**: Dedicated `tests/` directory with fixtures
|
|
778
|
+
- ✅ **Core Stability**: Separated browser logic, tools, and protocol handling
|
|
779
|
+
- ✅ **Token Efficient**: Documentation loaded on-demand, keeping tool descriptions concise
|
|
780
|
+
|
|
781
|
+
### v1.2.0 (2025-12-27)
|
|
782
|
+
- ✅ **Media Awareness**: Added audio/video inspection, spectral analysis, and control tools (36 tools total)
|
|
783
|
+
- ✅ **Tool**: `browser_get_media_summary`, `browser_get_audio_analysis`, `browser_control_media`
|
|
784
|
+
|
|
785
|
+
### v1.1.0 (2025-12-27)
|
|
786
|
+
- ✅ **Tool Parity**: Achieved parity with `browser-subagent` (33 tools total)
|
|
787
|
+
- ✅ **Multi-Page**: Added support for multiple browser tabs/pages
|
|
788
|
+
- ✅ **Low-Level Control**: Added keyboard/mouse event tools (pixel-based)
|
|
789
|
+
- ✅ **Utilities**: Added `reload`, `go_back`, `go_forward`, `wait`, `hover`, `focus`, `select`
|
|
790
|
+
- ✅ **Testing**: Updated test suites to include new tools
|
|
791
|
+
|
|
566
792
|
### v1.0.3 (2025-12-26)
|
|
567
793
|
- ✅ **Documentation**: Updated README with v1.0.2 features and clearer installation instructions
|
|
568
794
|
- ✅ **Code Comments**: Updated header to reflect universal compatibility and all features
|
package/package.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ricardodeazambuja/browser-mcp-server",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"description": "Universal browser automation MCP server using Playwright. Works with Antigravity, Claude Desktop, and any MCP client.",
|
|
5
|
-
"main": "
|
|
5
|
+
"main": "src/index.js",
|
|
6
6
|
"bin": {
|
|
7
|
-
"browser-mcp-server": "./
|
|
7
|
+
"browser-mcp-server": "./src/index.js"
|
|
8
8
|
},
|
|
9
9
|
"scripts": {
|
|
10
|
-
"start": "node
|
|
10
|
+
"start": "node src/index.js",
|
|
11
11
|
"install-browsers": "npx playwright install chromium",
|
|
12
|
-
"test": "
|
|
12
|
+
"test": "node tests/run-all.js"
|
|
13
13
|
},
|
|
14
14
|
"keywords": [
|
|
15
15
|
"mcp",
|
|
@@ -40,11 +40,12 @@
|
|
|
40
40
|
"playwright": "^1.57.0"
|
|
41
41
|
},
|
|
42
42
|
"files": [
|
|
43
|
-
"
|
|
43
|
+
"src/",
|
|
44
44
|
"README.md",
|
|
45
45
|
"LICENSE",
|
|
46
|
-
"CHANGELOG-v1.0.
|
|
47
|
-
"
|
|
48
|
-
"
|
|
46
|
+
"CHANGELOG-v1.3.0.md",
|
|
47
|
+
"CHANGELOG-v1.4.0.md",
|
|
48
|
+
"tests/",
|
|
49
|
+
"plugins/"
|
|
49
50
|
]
|
|
50
|
-
}
|
|
51
|
+
}
|
package/plugins/.gitkeep
ADDED
|
File without changes
|
package/src/.gitkeep
ADDED
|
File without changes
|