@roxybrowser/openapi 1.0.5-beta.1 → 1.0.8

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 (48) hide show
  1. package/README.md +222 -228
  2. package/lib/index.js +97 -1674
  3. package/lib/index.js.map +1 -1
  4. package/lib/modules/account.d.ts +491 -0
  5. package/lib/modules/account.d.ts.map +1 -0
  6. package/lib/modules/account.js +442 -0
  7. package/lib/modules/account.js.map +1 -0
  8. package/lib/modules/browser.d.ts +3011 -0
  9. package/lib/modules/browser.d.ts.map +1 -0
  10. package/lib/modules/browser.js +1501 -0
  11. package/lib/modules/browser.js.map +1 -0
  12. package/lib/modules/other.d.ts +102 -0
  13. package/lib/modules/other.d.ts.map +1 -0
  14. package/lib/modules/other.js +194 -0
  15. package/lib/modules/other.js.map +1 -0
  16. package/lib/modules/proxy.d.ts +576 -0
  17. package/lib/modules/proxy.d.ts.map +1 -0
  18. package/lib/modules/proxy.js +724 -0
  19. package/lib/modules/proxy.js.map +1 -0
  20. package/lib/types.d.ts +860 -155
  21. package/lib/types.d.ts.map +1 -1
  22. package/lib/types.js +4 -4
  23. package/lib/types.js.map +1 -1
  24. package/lib/utils/index.d.ts +24 -0
  25. package/lib/utils/index.d.ts.map +1 -0
  26. package/lib/utils/index.js +45 -0
  27. package/lib/utils/index.js.map +1 -0
  28. package/package.json +50 -50
  29. package/lib/browser/browser-creator.d.ts +0 -54
  30. package/lib/browser/browser-creator.d.ts.map +0 -1
  31. package/lib/browser/browser-creator.js +0 -263
  32. package/lib/browser/browser-creator.js.map +0 -1
  33. package/lib/proxy/proxy-manager.d.ts +0 -67
  34. package/lib/proxy/proxy-manager.d.ts.map +0 -1
  35. package/lib/proxy/proxy-manager.js +0 -278
  36. package/lib/proxy/proxy-manager.js.map +0 -1
  37. package/lib/proxy/proxy-validator.d.ts +0 -66
  38. package/lib/proxy/proxy-validator.d.ts.map +0 -1
  39. package/lib/proxy/proxy-validator.js +0 -273
  40. package/lib/proxy/proxy-validator.js.map +0 -1
  41. package/lib/roxy-client.d.ts +0 -117
  42. package/lib/roxy-client.d.ts.map +0 -1
  43. package/lib/roxy-client.js +0 -467
  44. package/lib/roxy-client.js.map +0 -1
  45. package/lib/utils/error-analyzer.d.ts +0 -84
  46. package/lib/utils/error-analyzer.d.ts.map +0 -1
  47. package/lib/utils/error-analyzer.js +0 -387
  48. package/lib/utils/error-analyzer.js.map +0 -1
package/README.md CHANGED
@@ -1,228 +1,222 @@
1
- # RoxyBrowser MCP Server [Beta]
2
-
3
- [English](README.md) | [中文](README_CN.md)
4
-
5
- > **⚠️ BETA VERSION NOTICE**
6
- >
7
- > This project is currently in **beta testing and active development**. While we strive for stability, please exercise caution when using this tool in production environments or with critical assets. We recommend closely monitoring software and browser operations when using it with MCP clients to avoid unnecessary losses.
8
- >
9
- >For more details, please refer to: [RoxyBrowser Now Supports MCP — AI Can Finally Do the Work for You](https://roxybrowser.com/blog/roxybrowser-mcp-integration)
10
-
11
- A Model Context Protocol (MCP) server for [RoxyBrowser](https://www.roxybrowser.com/) that provides AI assistants with the ability to manage browser instances and obtain Chrome DevTools Protocol (CDP) WebSocket endpoints for automation.
12
-
13
- ## Features
14
-
15
- - 🚀 **Browser Management**: Open and close RoxyBrowser instances programmatically
16
- - 🔗 **CDP Integration**: Get WebSocket endpoints for Chrome DevTools Protocol automation
17
- - 🤖 **AI-Friendly**: Seamlessly integrates with AI assistants through MCP
18
- - 🎯 **Playwright Ready**: Works perfectly with [PlayRoxy MCP](https://github.com/roxybrowserlabs/playroxy-mcp) (RoxyBrowser's customized Playwright MCP)
19
- - 📊 **Workspace Support**: Manage browsers across different workspaces and projects
20
- - 🛠️ **Browser Creation**: Create browsers with layered complexity (Simple, Standard, Advanced)
21
- - 🌐 **Proxy Management**: Built-in proxy validation, testing, and configuration tools
22
- - 🔧 **Advanced Configuration**: Full control over fingerprints, proxies, and browser settings
23
-
24
- ## Quick Start
25
-
26
- ### Prerequisites
27
-
28
- 1. **RoxyBrowser** installed and running
29
- 2. **RoxyBrowser API** enabled in settings:
30
- - Open RoxyBrowser API
31
- - Set "API Status" to "Enable"
32
- - Copy your API Key
33
- - Note the API port (default: 50000)
34
-
35
- ### MCP Client Configuration
36
-
37
- Add both RoxyBrowser OpenAPI and PlayRoxy MCP to your MCP client configuration:
38
-
39
- **Claude Desktop / VS Code / Cursor:**
40
- ```json
41
- {
42
- "mcpServers": {
43
- "roxybrowser-openapi": {
44
- "command": "npx",
45
- "args": ["@roxybrowser/openapi@beta"],
46
- "env": {
47
- "ROXY_API_KEY": "YOUR API KEY",
48
- "ROXY_API_HOST": "http://127.0.0.1:50000"
49
- }
50
- },
51
- "roxybrowser-playwright-mcp": {
52
- "command": "npx",
53
- "args": ["@roxybrowser/playwright-mcp@latest"]
54
- }
55
- }
56
- }
57
- ```
58
-
59
- **Note:** Replace `YOUR API KEY` and `YOUR API HOST` with your actual RoxyBrowser credentials.
60
-
61
- ## Available Tools
62
-
63
- ### Workspace & Project Management
64
- - `roxy_list_workspaces` - List all available workspaces and their projects
65
- - `roxy_list_accounts` - Get platform accounts and credentials in a workspace
66
- - `roxy_list_labels` - Get browser labels/tags for organization
67
-
68
- ### Browser Management
69
- - `roxy_list_browsers` - List browsers in a workspace/project with filtering
70
- - `roxy_get_browser_detail` - Get detailed browser information and configuration
71
- - `roxy_open_browsers` - Open browsers and get CDP WebSocket endpoints for automation
72
- - `roxy_close_browsers` - Close running browsers (does NOT free quota)
73
- - `roxy_delete_browsers` - Delete browser profiles permanently (frees quota)
74
- - `roxy_get_connection_info` - Get CDP endpoints and PIDs for opened browsers
75
-
76
- ### Browser Creation
77
- - `roxy_create_browser_simple` - Create browser with basic configuration
78
- - `roxy_create_browser_standard` - Create browser with common settings (OS, proxy, window size, etc.)
79
- - `roxy_create_browser_advanced` - Create browser with full control (fingerprint, platform accounts, etc.)
80
-
81
- ### Browser Maintenance
82
- - `roxy_update_browser` - Update existing browser configuration
83
- - `roxy_random_fingerprint` - Randomize browser fingerprint
84
- - `roxy_clear_local_cache` - Clear local browser cache
85
- - `roxy_clear_server_cache` - Clear server-side browser cache
86
-
87
- ### Utilities
88
- - `roxy_validate_proxy_config` - Validate proxy configuration
89
- - `roxy_system_diagnostics` - System health check and diagnostics
90
-
91
- ## Complete Workflow Examples
92
-
93
- ### Example 1: Quick Browser Automation Setup
94
-
95
- ```
96
- 1. AI: "Create a simple browser in workspace 1 with name 'Test Browser'"
97
- Uses roxy_create_browser_simple
98
- → Returns browser ID ready for use
99
-
100
- 2. AI: "Open the browser I just created"
101
- → Uses roxy_open_browsers with the returned ID
102
- Returns CDP WebSocket URL like: ws://127.0.0.1:52314/devtools/browser/xxx
103
-
104
- 3. AI: "Navigate to gmail.com, login, and send emails"
105
- → Uses PlayRoxy MCP tools automatically (browser_navigate, browser_type, browser_click, etc.)
106
- → PlayRoxy MCP connects to the opened browser via CDP endpoint
107
-
108
- 4. AI: "Close the browser when done"
109
- Uses roxy_close_browsers
110
- ```
111
-
112
- ### Example 2: Advanced Browser with Proxy Setup
113
-
114
- ```
115
- 1. AI: "Validate my proxy configuration before creating browsers"
116
- → Uses roxy_validate_proxy_config
117
- Confirms proxy settings are correct
118
-
119
- 2. AI: "Create a standard browser with SOCKS5 proxy and 1920x1080 resolution in workspace 2"
120
- → Uses roxy_create_browser_standard with proxy configuration
121
- → Returns configured browser ID
122
-
123
- 3. AI: "Open the browser and start automation"
124
- → Uses roxy_open_browsers → gets CDP endpoint
125
- → PlayRoxy MCP automatically connects and begins automation tasks
126
- ```
127
-
128
- ## Integration with Playwright MCP
129
-
130
- RoxyBrowser MCP is designed to work seamlessly with [PlayRoxy MCP](https://github.com/roxybrowserlabs/playroxy-mcp), our customized Playwright MCP server built specifically for RoxyBrowser compatibility.
131
-
132
- **PlayRoxy MCP** is based on [Microsoft's Playwright MCP](https://github.com/microsoft/playwright-mcp) with enhancements for RoxyBrowser's fingerprint browser features.
133
-
134
- ### Workflow
135
-
136
- 1. Use RoxyBrowser OpenAPI MCP to create and open browsers
137
- 2. Get CDP WebSocket endpoints from opened browsers
138
- 3. Use PlayRoxy MCP to automate browser tasks with full Playwright capabilities
139
-
140
- Both servers work together seamlessly when configured in your MCP client (see configuration above).
141
-
142
- ## Development
143
-
144
- ```bash
145
- # Development mode with auto-rebuild
146
- npm run dev
147
-
148
- # Build for production
149
- npm run build
150
- ```
151
-
152
- ## API Reference
153
-
154
- ### Environment Variables
155
-
156
- | Variable | Required | Default | Description |
157
- |----------|----------|---------|-------------|
158
- | `ROXY_API_KEY` | ✅ Yes | - | API key from RoxyBrowser settings |
159
- | `ROXY_API_HOST` | ✅ Yes | `http://127.0.0.1:50000` | RoxyBrowser API endpoint |
160
- | `ROXY_TIMEOUT` | No | `30000` | Request timeout in milliseconds |
161
-
162
- ### Error Codes
163
-
164
- | Code | Name | Description |
165
- |------|------|-------------|
166
- | **0** | SUCCESS | Operation completed successfully |
167
- | **101** | INSUFFICIENT_QUOTA | Insufficient profiles quota |
168
- | **400** | INVALID_PARAMS | Invalid parameters provided |
169
- | **401** | UNAUTHORIZED | Authentication failed - invalid API key |
170
- | **403** | FORBIDDEN | Access denied - insufficient permissions |
171
- | **404** | NOT_FOUND | Resource not found |
172
- | **408** | TIMEOUT | Request timeout |
173
- | **409** | CONFLICT | Resource conflict or insufficient quota |
174
- | **500** | SERVER_ERROR | Internal server error |
175
- | **502** | BAD_GATEWAY | Bad gateway - proxy or network issue |
176
- | **503** | SERVICE_UNAVAILABLE | Service temporarily unavailable |
177
- | **504** | GATEWAY_TIMEOUT | Gateway timeout |
178
-
179
- ## Troubleshooting
180
-
181
- ### Connection Issues
182
-
183
- **Error: "Failed to connect to RoxyBrowser API"**
184
-
185
- Check:
186
- 1. RoxyBrowser is running
187
- 2. API is enabled: RoxyBrowser → API → API Status = Enable
188
- 3. Correct API key: Copy from RoxyBrowser → API API Key
189
- 4. Correct port: Check RoxyBrowser → API → Port Settings (default: 50000)
190
- 5. No firewall blocking http://127.0.0.1:50000
191
-
192
- ### Authentication Issues
193
-
194
- **Error: "Configuration Error: API key is required"**
195
-
196
- Set the environment variable:
197
- ```bash
198
- export ROXY_API_KEY="your_actual_api_key_from_roxybrowser"
199
- ```
200
-
201
- ### Browser Opening Issues
202
-
203
- **Error: "Insufficient profiles quota" (Code 101 or 409)**
204
-
205
- Solutions:
206
- - Purchase more profiles in RoxyBrowser Billing Center
207
- - **Delete** unused browser profiles using `roxy_delete_browsers` (closing alone does NOT free quota)
208
- - Upgrade your subscription plan
209
- - Check current quota usage in workspace settings
210
-
211
- **Some browsers fail to open:**
212
-
213
- - Check that the browser profiles exist and are not corrupted
214
- - Ensure sufficient system resources (RAM, CPU)
215
- - Verify the dirIds are valid (use `roxy_list_browsers` first)
216
- - Run `roxy_system_diagnostics` for comprehensive health check
217
-
218
- ## License
219
-
220
- MIT License - see LICENSE file for details.
221
-
222
- ## Contributing
223
-
224
- 1. Fork the repository
225
- 2. Create a feature branch
226
- 3. Make your changes
227
- 4. Add tests if applicable
228
- 5. Submit a pull request
1
+ # RoxyBrowser MCP Server [Beta]
2
+
3
+ [English](README.md) | [中文](README_CN.md)
4
+
5
+ > **⚠️ BETA VERSION NOTICE**
6
+ >
7
+ > This project is currently in **beta testing and active development**. While we strive for stability, please exercise caution when using this tool in production environments or with critical assets. We recommend closely monitoring software and browser operations when using it with MCP clients to avoid unnecessary losses.
8
+ >
9
+ >For more details, please refer to: [RoxyBrowser Now Supports MCP — AI Can Finally Do the Work for You](https://roxybrowser.com/blog/roxybrowser-mcp-integration)
10
+
11
+ A Model Context Protocol (MCP) server for [RoxyBrowser](https://www.roxybrowser.com/) that provides AI assistants with the ability to manage browser instances and obtain Chrome DevTools Protocol (CDP) WebSocket endpoints for automation.
12
+
13
+ ## Features
14
+
15
+ - 🚀 **Browser Management**: Open and close RoxyBrowser instances programmatically
16
+ - 🔗 **CDP Integration**: Get WebSocket endpoints for Chrome DevTools Protocol automation
17
+ - 🤖 **AI-Friendly**: Seamlessly integrates with AI assistants through MCP
18
+ - 🎯 **Playwright Ready**: Works with [PlayRoxy MCP](https://github.com/roxybrowserlabs/playroxy-mcp) (RoxyBrowser's customized Playwright MCP)
19
+ - 📊 **Workspace Support**: Manage browsers across different workspaces and projects
20
+ - 🛠️ **Browser Creation**: Create browsers (single or batch) with full configuration
21
+ - 🌐 **Proxy Management**: List, create, detect, and manage proxy configurations
22
+ - 👤 **Account Management**: Manage platform accounts and credentials in workspaces
23
+ - 🔧 **Advanced Configuration**: Fingerprints, cache clear, random fingerprint, and more
24
+ - 🏥 **Health Check**: Server and workspace connectivity diagnostics
25
+
26
+ ## Quick Start
27
+
28
+ ### Prerequisites
29
+
30
+ 1. **RoxyBrowser** installed and running
31
+ 2. **RoxyBrowser API** enabled in settings:
32
+ - Open RoxyBrowser API
33
+ - Set "API Status" to "Enable"
34
+ - Copy your API Key
35
+ - Note the API port (default: 50000)
36
+
37
+ ### MCP Client Configuration
38
+
39
+ Add both RoxyBrowser OpenAPI and PlayRoxy MCP to your MCP client configuration:
40
+
41
+ **Claude Desktop / VS Code / Cursor:**
42
+ ```json
43
+ {
44
+ "mcpServers": {
45
+ "roxybrowser-openapi": {
46
+ "command": "npx",
47
+ "args": ["@roxybrowser/openapi@latest"],
48
+ "env": {
49
+ "ROXY_API_KEY": "YOUR API KEY",
50
+ "ROXY_API_HOST": "http://127.0.0.1:50000"
51
+ }
52
+ },
53
+ "roxybrowser-playwright-mcp": {
54
+ "command": "npx",
55
+ "args": ["@roxybrowser/playwright-mcp@latest"]
56
+ }
57
+ }
58
+ }
59
+ ```
60
+
61
+ **Note:** Replace `YOUR API KEY` and `YOUR API HOST` with your actual RoxyBrowser credentials.
62
+
63
+ ## Available Tools
64
+
65
+ ### Workspace
66
+ - `roxy_list_workspaces` - List all available workspaces and their projects
67
+
68
+ ### Browser
69
+ - `roxy_list_browsers` - List browsers in a workspace/project with filtering
70
+ - `roxy_create_browser` - Create a browser with full configuration
71
+ - `roxy_batch_create_browsers` - Create multiple browsers in batch
72
+ - `roxy_open_browsers` - Open browsers and get CDP WebSocket endpoints for automation
73
+ - `roxy_update_browser` - Update existing browser configuration
74
+ - `roxy_close_browsers` - Close running browsers (does NOT free quota)
75
+ - `roxy_delete_browsers` - Delete browser profiles permanently (frees quota)
76
+ - `roxy_get_browser_detail` - Get detailed browser information and configuration
77
+ - `roxy_get_connection_info` - Get CDP endpoints and PIDs for opened browsers
78
+ - `roxy_clear_local_cache` - Clear local browser cache
79
+ - `roxy_clear_server_cache` - Clear server-side browser cache
80
+ - `roxy_random_fingerprint` - Randomize browser fingerprint
81
+ - `roxy_list_labels` - Get browser labels/tags for organization
82
+
83
+ ### Proxy
84
+ - `roxy_list_proxies` - List proxy configurations in a workspace
85
+ - `roxy_store_proxies` - Get list of proxies you've purchased (store)
86
+ - `roxy_create_proxy` - Create a proxy configuration
87
+ - `roxy_batch_create_proxies` - Create multiple proxies in batch
88
+ - `roxy_detect_proxy` - Detect/test proxy availability
89
+ - `roxy_modify_proxy` - Modify existing proxy configuration
90
+ - `roxy_delete_proxies` - Delete proxy configurations
91
+
92
+ ### Account
93
+ - `roxy_list_accounts` - List platform accounts and credentials in a workspace
94
+ - `roxy_create_account` - Create a platform account
95
+ - `roxy_batch_create_accounts` - Create multiple accounts in batch
96
+ - `roxy_modify_account` - Modify existing account
97
+ - `roxy_delete_accounts` - Delete accounts
98
+
99
+ ### Utilities
100
+ - `roxy_health_check` - Server health check and workspace/browser connectivity diagnostics
101
+
102
+ ## Complete Workflow Examples
103
+
104
+ ### Example 1: Quick Browser Automation Setup
105
+
106
+ ```
107
+ 1. AI: "Create a browser in workspace 1 with name 'Test Browser'"
108
+ Uses roxy_create_browser
109
+ Returns browser ID ready for use
110
+
111
+ 2. AI: "Open the browser I just created"
112
+ Uses roxy_open_browsers with the returned ID
113
+ → Returns CDP WebSocket URL like: ws://127.0.0.1:52314/devtools/browser/xxx
114
+
115
+ 3. AI: "Navigate to gmail.com, login, and send emails"
116
+ → Uses PlayRoxy MCP tools (browser_navigate, browser_type, browser_click, etc.)
117
+ PlayRoxy MCP connects to the opened browser via CDP endpoint
118
+
119
+ 4. AI: "Close the browser when done"
120
+ → Uses roxy_close_browsers
121
+ ```
122
+
123
+ ### Example 2: Browser with Proxy
124
+
125
+ ```
126
+ 1. AI: "Detect my proxy before creating browsers"
127
+ → Uses roxy_detect_proxy
128
+ Confirms proxy is available
129
+
130
+ 2. AI: "Create a browser with SOCKS5 proxy and 1920x1080 in workspace 2"
131
+ → Uses roxy_create_browser with proxy configuration
132
+ Returns configured browser ID
133
+
134
+ 3. AI: "Open the browser and start automation"
135
+ → Uses roxy_open_browsers → gets CDP endpoint
136
+ PlayRoxy MCP connects and begins automation
137
+ ```
138
+
139
+ ## Integration with Playwright MCP
140
+
141
+ RoxyBrowser MCP is designed to work seamlessly with [PlayRoxy MCP](https://github.com/roxybrowserlabs/playroxy-mcp), our customized Playwright MCP server built specifically for RoxyBrowser compatibility.
142
+
143
+ **PlayRoxy MCP** is based on [Microsoft's Playwright MCP](https://github.com/microsoft/playwright-mcp) with enhancements for RoxyBrowser's fingerprint browser features.
144
+
145
+ ### Workflow
146
+
147
+ 1. Use RoxyBrowser OpenAPI MCP to create and open browsers
148
+ 2. Get CDP WebSocket endpoints from opened browsers
149
+ 3. Use PlayRoxy MCP to automate browser tasks with full Playwright capabilities
150
+
151
+ Both servers work together seamlessly when configured in your MCP client (see configuration above).
152
+
153
+ ## Development
154
+
155
+ ```bash
156
+ # Development mode with auto-rebuild
157
+ npm run dev
158
+
159
+ # Build for production
160
+ npm run build
161
+ ```
162
+
163
+ ## API Reference
164
+
165
+ ### Environment Variables
166
+
167
+ | Variable | Required | Default | Description |
168
+ |----------|----------|---------|-------------|
169
+ | `ROXY_API_KEY` | Yes | - | API key from RoxyBrowser settings |
170
+ | `ROXY_API_HOST` | Yes | `http://127.0.0.1:50000` | RoxyBrowser API endpoint |
171
+ | `ROXY_TIMEOUT` | No | `30000` | Request timeout in milliseconds |
172
+
173
+ ## Troubleshooting
174
+
175
+ ### Connection Issues
176
+
177
+ **Error: "Failed to connect to RoxyBrowser API"**
178
+
179
+ Check:
180
+ 1. RoxyBrowser is running
181
+ 2. API is enabled: RoxyBrowser → API → API Status = Enable
182
+ 3. Correct API key: Copy from RoxyBrowser → API → API Key
183
+ 4. Correct port: Check RoxyBrowser API Port Settings (default: 50000)
184
+ 5. No firewall blocking http://127.0.0.1:50000
185
+
186
+ ### Authentication Issues
187
+
188
+ **Error: "Configuration Error: API key is required"**
189
+
190
+ Set the environment variable:
191
+ ```bash
192
+ export ROXY_API_KEY="your_actual_api_key_from_roxybrowser"
193
+ ```
194
+
195
+ ### Browser Opening Issues
196
+
197
+ **Error: "Insufficient profiles quota" (Code 101 or 409)**
198
+
199
+ Solutions:
200
+ - Purchase more profiles in RoxyBrowser Billing Center
201
+ - **Delete** unused browser profiles using `roxy_delete_browsers` (closing alone does NOT free quota)
202
+ - Upgrade your subscription plan
203
+ - Check current quota usage in workspace settings
204
+
205
+ **Some browsers fail to open:**
206
+
207
+ - Check that the browser profiles exist and are not corrupted
208
+ - Ensure sufficient system resources (RAM, CPU)
209
+ - Verify the dirIds are valid (use `roxy_list_browsers` first)
210
+ - Run `roxy_health_check` for connectivity and health diagnostics
211
+
212
+ ## License
213
+
214
+ MIT License - see LICENSE file for details.
215
+
216
+ ## Contributing
217
+
218
+ 1. Fork the repository
219
+ 2. Create a feature branch
220
+ 3. Make your changes
221
+ 4. Add tests if applicable
222
+ 5. Submit a pull request