@mytai20100/opencode-browser 0.0.1
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 +21 -0
- package/README.md +161 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1285 -0
- package/dist/index.js.map +1 -0
- package/package.json +58 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 mytai20100
|
|
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,161 @@
|
|
|
1
|
+
# @mytai20100/opencode-browser
|
|
2
|
+
|
|
3
|
+
> OpenCode Browser MCP — Chrome automation plugin for [OpenCode](https://opencode.ai) via WebSocket + Chrome Extension.
|
|
4
|
+
|
|
5
|
+
**50+ tools** covering tabs, CDP debugging, network intercept, visual click, session management, accessibility, and more.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## How it works
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
OpenCode ──MCP (stdio)──► MCP Server (Node.js) ──WebSocket:3002──► Chrome Extension
|
|
13
|
+
│
|
|
14
|
+
chrome.tabs
|
|
15
|
+
chrome.debugger
|
|
16
|
+
chrome.scripting
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
The MCP server communicates with a companion Chrome Extension via WebSocket. The extension executes commands in your real browser — using your existing logins, cookies, and profile.
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## Installation
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
npm install -g @mytai20100/opencode-browser
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Then add to your `opencode.json`:
|
|
30
|
+
|
|
31
|
+
```json
|
|
32
|
+
{
|
|
33
|
+
"$schema": "https://opencode.ai/config.json",
|
|
34
|
+
"mcp": {
|
|
35
|
+
"browser": {
|
|
36
|
+
"type": "local",
|
|
37
|
+
"command": ["opencode-browser"],
|
|
38
|
+
"enabled": true
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Load the companion Chrome Extension (see `/extension` folder), then start chatting with OpenCode.
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## Tools (50+)
|
|
49
|
+
|
|
50
|
+
### Tabs & Windows
|
|
51
|
+
| Tool | Description |
|
|
52
|
+
|------|-------------|
|
|
53
|
+
| `chrome_list_tabs` | List all open tabs |
|
|
54
|
+
| `chrome_switch_tab` | Focus a tab by ID |
|
|
55
|
+
| `chrome_new_tab` | Open a new tab |
|
|
56
|
+
| `chrome_close_tab` | Close a tab |
|
|
57
|
+
| `chrome_navigate` | Navigate to URL |
|
|
58
|
+
| `chrome_reload_tab` | Reload a tab |
|
|
59
|
+
| `chrome_duplicate_tab` | Duplicate a tab |
|
|
60
|
+
| `chrome_pin_tab` | Pin/unpin a tab |
|
|
61
|
+
| `chrome_mute_tab` | Mute/unmute a tab |
|
|
62
|
+
| `chrome_group_tabs` | Group tabs with color/title |
|
|
63
|
+
|
|
64
|
+
### Page Interaction
|
|
65
|
+
| Tool | Description |
|
|
66
|
+
|------|-------------|
|
|
67
|
+
| `chrome_click` | Click by CSS selector |
|
|
68
|
+
| `chrome_type` | Type into an input |
|
|
69
|
+
| `chrome_hover` | Hover over an element |
|
|
70
|
+
| `chrome_select` | Select a dropdown option |
|
|
71
|
+
| `chrome_scroll` | Scroll the page |
|
|
72
|
+
| `chrome_key_press` | Press a key (Enter, Escape…) |
|
|
73
|
+
| `chrome_wait_for_element` | Wait for element to appear |
|
|
74
|
+
| `chrome_visual_click` | Click by X/Y coordinates via CDP |
|
|
75
|
+
| `chrome_upload_file` | Set files on file input |
|
|
76
|
+
|
|
77
|
+
### Page Content
|
|
78
|
+
| Tool | Description |
|
|
79
|
+
|------|-------------|
|
|
80
|
+
| `chrome_get_content` | Get visible text content |
|
|
81
|
+
| `chrome_get_html` | Get outer HTML |
|
|
82
|
+
| `chrome_get_page_info` | Title, URL, links, meta |
|
|
83
|
+
| `chrome_get_element_info` | Tag, class, attributes, bounding box |
|
|
84
|
+
| `chrome_find_elements` | Find all matching elements |
|
|
85
|
+
| `chrome_execute_script` | Run arbitrary JavaScript |
|
|
86
|
+
| `chrome_get_workflow_context` | Forms, inputs, buttons snapshot |
|
|
87
|
+
| `chrome_ocr_page` | All text with bounding boxes |
|
|
88
|
+
| `chrome_find_text_on_screen` | Find text → get click coordinates |
|
|
89
|
+
|
|
90
|
+
### CDP Debugging
|
|
91
|
+
| Tool | Description |
|
|
92
|
+
|------|-------------|
|
|
93
|
+
| `chrome_debug_attach` | Attach CDP debugger |
|
|
94
|
+
| `chrome_debug_get_logs` | Read console logs |
|
|
95
|
+
| `chrome_debug_get_network` | List captured network requests |
|
|
96
|
+
| `chrome_debug_get_response_body` | Read response body |
|
|
97
|
+
| `chrome_debug_eval` | Eval JS via CDP (async-safe) |
|
|
98
|
+
| `chrome_debug_get_performance` | JS heap, DOM nodes, layout |
|
|
99
|
+
| `chrome_debug_get_dom_snapshot` | Full DOM snapshot |
|
|
100
|
+
| `chrome_debug_emulate_device` | Mobile device emulation |
|
|
101
|
+
| `chrome_debug_emulate_network` | Network throttling |
|
|
102
|
+
| `chrome_debug_block_urls` | Block URL patterns |
|
|
103
|
+
| `chrome_debug_get_cookies` | Get ALL cookies incl. HttpOnly |
|
|
104
|
+
| `chrome_debug_send_command` | Send raw CDP command |
|
|
105
|
+
|
|
106
|
+
### Network Intercept
|
|
107
|
+
| Tool | Description |
|
|
108
|
+
|------|-------------|
|
|
109
|
+
| `chrome_intercept_request` | Intercept requests by URL pattern |
|
|
110
|
+
| `chrome_mock_response` | Mock API responses |
|
|
111
|
+
| `chrome_modify_headers` | Auto-modify request headers |
|
|
112
|
+
| `chrome_replay_request` | Re-send HTTP requests |
|
|
113
|
+
| `chrome_export_har` | Export HAR archive |
|
|
114
|
+
|
|
115
|
+
### Storage & Cookies
|
|
116
|
+
| Tool | Description |
|
|
117
|
+
|------|-------------|
|
|
118
|
+
| `chrome_get_cookies` | Get cookies for URL |
|
|
119
|
+
| `chrome_set_cookie` | Set a cookie |
|
|
120
|
+
| `chrome_delete_cookie` | Delete a cookie |
|
|
121
|
+
| `chrome_get_local_storage` | Read localStorage |
|
|
122
|
+
| `chrome_set_local_storage` | Write localStorage |
|
|
123
|
+
| `chrome_clear_local_storage` | Clear localStorage |
|
|
124
|
+
|
|
125
|
+
### Session
|
|
126
|
+
| Tool | Description |
|
|
127
|
+
|------|-------------|
|
|
128
|
+
| `chrome_save_session` | Save cookies + localStorage |
|
|
129
|
+
| `chrome_restore_session` | Restore saved session |
|
|
130
|
+
|
|
131
|
+
### Accessibility
|
|
132
|
+
| Tool | Description |
|
|
133
|
+
|------|-------------|
|
|
134
|
+
| `chrome_get_accessibility_tree` | Full AX tree |
|
|
135
|
+
| `chrome_find_accessible_nodes` | Find by label/role |
|
|
136
|
+
|
|
137
|
+
### Misc
|
|
138
|
+
| Tool | Description |
|
|
139
|
+
|------|-------------|
|
|
140
|
+
| `chrome_screenshot` | Take a screenshot |
|
|
141
|
+
| `chrome_write_clipboard` | Write to clipboard |
|
|
142
|
+
| `chrome_read_clipboard` | Read from clipboard |
|
|
143
|
+
| `chrome_notify` | Show desktop notification |
|
|
144
|
+
| `chrome_set_zoom` | Set zoom level |
|
|
145
|
+
| `chrome_grant_permissions` | Grant origin permissions |
|
|
146
|
+
| `chrome_virtual_authenticator` | WebAuthn testing |
|
|
147
|
+
| `chrome_get_tool_graph` | Get optimal tool execution plan |
|
|
148
|
+
|
|
149
|
+
---
|
|
150
|
+
|
|
151
|
+
## Requirements
|
|
152
|
+
|
|
153
|
+
- Node.js >= 18
|
|
154
|
+
- Chrome / Brave / Edge (Chromium-based)
|
|
155
|
+
- Companion Chrome Extension (included in `/extension`)
|
|
156
|
+
|
|
157
|
+
---
|
|
158
|
+
|
|
159
|
+
## License
|
|
160
|
+
|
|
161
|
+
MIT © 2026 mytai20100
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":""}
|