@ricardodeazambuja/browser-mcp-server 1.3.0 → 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.4.0.md +8 -0
- package/README.md +87 -6
- package/package.json +3 -2
- package/src/browser.js +2 -0
- package/src/cdp.js +58 -0
- package/src/index.js +2 -2
- package/src/tools/docs.js +798 -0
- package/src/tools/index.js +5 -1
- package/src/tools/network.js +552 -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 +5 -1
- package/src/utils.js +12 -1
- 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/tests/test-mcp.js +3 -2
- 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
|
@@ -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,14 @@
|
|
|
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
13
|
- ✅ **On-Demand Docs**: Built-in documentation tool with return schemas and examples
|
|
14
14
|
- ✅ **Auto-Install**: Playwright installed automatically via npm (no manual setup)
|
|
15
15
|
- ✅ **Safe**: Isolated browser profile (won't touch your personal Chrome)
|
|
@@ -253,7 +253,7 @@ gemini mcp add --timeout 30000 browser node /path/to/src/index.js
|
|
|
253
253
|
gemini mcp add --trust browser node /path/to/src/index.js
|
|
254
254
|
```
|
|
255
255
|
|
|
256
|
-
## Available Tools (
|
|
256
|
+
## Available Tools (63)
|
|
257
257
|
|
|
258
258
|
### Documentation
|
|
259
259
|
1. **browser_docs(toolName?)** - Get detailed docs, return schemas, examples, and caveats for any tool
|
|
@@ -308,6 +308,79 @@ gemini mcp add --trust browser node /path/to/src/index.js
|
|
|
308
308
|
36. **browser_stop_video_recording()** - Stop and save recording
|
|
309
309
|
37. **browser_health_check()** - Verify browser connection
|
|
310
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
|
+
|
|
311
384
|
## On-Demand Documentation
|
|
312
385
|
|
|
313
386
|
The `browser_docs` tool provides comprehensive documentation for all browser tools **without increasing token overhead** in normal operations.
|
|
@@ -423,7 +496,7 @@ browser_docs(toolName: "browser_get_audio_analysis")
|
|
|
423
496
|
// ⚠️ Important: Requires CORS headers for cross-origin media
|
|
424
497
|
|
|
425
498
|
// List all tools:
|
|
426
|
-
browser_docs() // Shows all
|
|
499
|
+
browser_docs() // Shows all 63 tools
|
|
427
500
|
```
|
|
428
501
|
|
|
429
502
|
## How It Works
|
|
@@ -646,7 +719,7 @@ Check `/tmp/mcp-browser-server.log` for detailed logs:
|
|
|
646
719
|
## Comparison with Other Tools
|
|
647
720
|
|
|
648
721
|
### vs. Puppeteer MCP Servers
|
|
649
|
-
- ✅ More tools (
|
|
722
|
+
- ✅ More tools (63 vs typical 8-10)
|
|
650
723
|
- ✅ Console capture built-in
|
|
651
724
|
- ✅ Better error messages
|
|
652
725
|
- ✅ Hybrid mode (connect OR launch)
|
|
@@ -689,7 +762,15 @@ MIT License - see LICENSE file
|
|
|
689
762
|
|
|
690
763
|
## Changelog
|
|
691
764
|
|
|
692
|
-
### v1.
|
|
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)
|
|
693
774
|
- ✅ **On-Demand Documentation**: New `browser_docs` tool provides detailed specs, return schemas, examples, and caveats for all 37 tools
|
|
694
775
|
- ✅ **Modular Architecture**: Complete refactor into `src/` modules for better maintainability
|
|
695
776
|
- ✅ **Plugin System**: New `plugins/` directory for extending functionality
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ricardodeazambuja/browser-mcp-server",
|
|
3
|
-
"version": "1.
|
|
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
5
|
"main": "src/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"scripts": {
|
|
10
10
|
"start": "node src/index.js",
|
|
11
11
|
"install-browsers": "npx playwright install chromium",
|
|
12
|
-
"test": "node tests/
|
|
12
|
+
"test": "node tests/run-all.js"
|
|
13
13
|
},
|
|
14
14
|
"keywords": [
|
|
15
15
|
"mcp",
|
|
@@ -44,6 +44,7 @@
|
|
|
44
44
|
"README.md",
|
|
45
45
|
"LICENSE",
|
|
46
46
|
"CHANGELOG-v1.3.0.md",
|
|
47
|
+
"CHANGELOG-v1.4.0.md",
|
|
47
48
|
"tests/",
|
|
48
49
|
"plugins/"
|
|
49
50
|
]
|
package/src/browser.js
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
const os = require('os');
|
|
6
6
|
const { debugLog, loadPlaywright, findChromeExecutable } = require('./utils');
|
|
7
|
+
const { resetCDPSession } = require('./cdp');
|
|
7
8
|
|
|
8
9
|
// Browser state
|
|
9
10
|
let browser = null;
|
|
@@ -140,6 +141,7 @@ function resetBrowserState() {
|
|
|
140
141
|
context = null;
|
|
141
142
|
page = null;
|
|
142
143
|
activePageIndex = 0;
|
|
144
|
+
resetCDPSession();
|
|
143
145
|
}
|
|
144
146
|
|
|
145
147
|
module.exports = {
|
package/src/cdp.js
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CDP (Chrome DevTools Protocol) Session Manager
|
|
3
|
+
* Manages CDP session lifecycle for advanced browser automation tools
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
const { debugLog } = require('./utils');
|
|
7
|
+
|
|
8
|
+
// CDP session state
|
|
9
|
+
let cdpSession = null;
|
|
10
|
+
let currentPage = null;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Get or create CDP session for current page
|
|
14
|
+
* Sessions are cached per page instance for efficiency
|
|
15
|
+
* @returns {CDPSession} Active CDP session
|
|
16
|
+
*/
|
|
17
|
+
async function getCDPSession() {
|
|
18
|
+
// Lazy-load to avoid circular dependency with browser.js
|
|
19
|
+
const { connectToBrowser } = require('./browser');
|
|
20
|
+
const { page } = await connectToBrowser();
|
|
21
|
+
|
|
22
|
+
// If page changed or session doesn't exist, create new session
|
|
23
|
+
if (!cdpSession || currentPage !== page) {
|
|
24
|
+
// Detach old session if it exists
|
|
25
|
+
if (cdpSession) {
|
|
26
|
+
try {
|
|
27
|
+
await cdpSession.detach();
|
|
28
|
+
debugLog('Detached old CDP session');
|
|
29
|
+
} catch (e) {
|
|
30
|
+
debugLog(`Failed to detach old CDP session: ${e.message}`);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// Create new session for current page
|
|
35
|
+
currentPage = page;
|
|
36
|
+
cdpSession = await page.context().newCDPSession(page);
|
|
37
|
+
debugLog('Created new CDP session');
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
return cdpSession;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Reset CDP session state
|
|
45
|
+
* Called when browser state is reset (connection lost, browser restart, etc.)
|
|
46
|
+
*/
|
|
47
|
+
function resetCDPSession() {
|
|
48
|
+
if (cdpSession) {
|
|
49
|
+
debugLog('Resetting CDP session state');
|
|
50
|
+
}
|
|
51
|
+
cdpSession = null;
|
|
52
|
+
currentPage = null;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
module.exports = {
|
|
56
|
+
getCDPSession,
|
|
57
|
+
resetCDPSession
|
|
58
|
+
};
|
package/src/index.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
const readline = require('readline');
|
|
9
|
-
const { debugLog } = require('./utils');
|
|
9
|
+
const { debugLog, version } = require('./utils');
|
|
10
10
|
const { tools, handlers } = require('./tools');
|
|
11
11
|
const { getBrowserState } = require('./browser');
|
|
12
12
|
|
|
@@ -66,7 +66,7 @@ class BrowserMCPServer {
|
|
|
66
66
|
capabilities: { tools: {} },
|
|
67
67
|
serverInfo: {
|
|
68
68
|
name: 'browser-automation-playwright',
|
|
69
|
-
version:
|
|
69
|
+
version: version
|
|
70
70
|
}
|
|
71
71
|
});
|
|
72
72
|
}
|