@zibby/mcp-browser 0.1.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Zibby
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.
package/README.md ADDED
@@ -0,0 +1,108 @@
1
+ # @zibby/mcp-browser
2
+
3
+ Wrapper for `@playwright/mcp` with stable ID support and event recording.
4
+
5
+ ## Features
6
+
7
+ - ✅ Injects stable IDs via `--init-script` for reliable element targeting
8
+ - ✅ Records browser events to `events.json` with stable IDs
9
+ - ✅ Video recording with accurate timestamp synchronization
10
+ - ✅ Passes through all official Playwright MCP functionality
11
+
12
+ ## Installation
13
+
14
+ ```bash
15
+ npm install @zibby/mcp-browser
16
+ ```
17
+
18
+ ## Usage
19
+
20
+ ### As MCP Server
21
+
22
+ Add to your MCP configuration:
23
+
24
+ ```json
25
+ {
26
+ "mcpServers": {
27
+ "playwright": {
28
+ "command": "npx",
29
+ "args": ["@zibby/mcp-browser"]
30
+ }
31
+ }
32
+ }
33
+ ```
34
+
35
+ ### Command Line
36
+
37
+ ```bash
38
+ # Basic usage (same as @playwright/mcp)
39
+ npx @zibby/mcp-browser
40
+
41
+ # With headless mode
42
+ npx @zibby/mcp-browser --headless
43
+
44
+ # With custom output directory
45
+ npx @zibby/mcp-browser --output-dir ./recordings
46
+ ```
47
+
48
+ ## How It Works
49
+
50
+ This package wraps the official `@playwright/mcp` and adds:
51
+
52
+ 1. **Stable ID Injection**: Automatically injects stable element IDs into the page
53
+ 2. **Event Recording**: Records all browser interactions with stable IDs
54
+ 3. **Video Sync**: Synchronizes event timestamps with video recordings
55
+
56
+ ## Event Recording
57
+
58
+ Events are recorded to `events.json` in the session directory:
59
+
60
+ ```json
61
+ [
62
+ {
63
+ "id": 0,
64
+ "type": "navigate",
65
+ "timestamp": "2026-03-05T12:00:00.000Z",
66
+ "videoOffsetMs": 0,
67
+ "videoOffsetFormatted": "00:00:00.000",
68
+ "data": {
69
+ "url": "https://example.com"
70
+ }
71
+ },
72
+ {
73
+ "id": 1,
74
+ "type": "click",
75
+ "timestamp": "2026-03-05T12:00:02.500Z",
76
+ "videoOffsetMs": 2500,
77
+ "videoOffsetFormatted": "00:00:02.500",
78
+ "data": {
79
+ "element": "Login button",
80
+ "stableId": "zibby-login-btn-a1b2c3"
81
+ }
82
+ }
83
+ ]
84
+ ```
85
+
86
+ ## Configuration
87
+
88
+ Set the session path via environment variable:
89
+
90
+ ```bash
91
+ export ZIBBY_SESSION_INFO=/path/to/.session-info.json
92
+ ```
93
+
94
+ ## Compatibility
95
+
96
+ - Node.js >= 18.0.0
97
+ - Compatible with all `@playwright/mcp` features
98
+ - Works with Playwright >= 1.49.0
99
+
100
+ ## License
101
+
102
+ MIT
103
+
104
+ ## Related Packages
105
+
106
+ - [@zibby/cli](https://www.npmjs.com/package/@zibby/cli) - Command-line interface
107
+ - [@zibby/test-automation-core](https://www.npmjs.com/package/@zibby/test-automation-core) - Core automation engine
108
+ - [@zibby/mcp-jira](https://www.npmjs.com/package/@zibby/mcp-jira) - Jira MCP server