@roxybrowser/openapi 1.0.4 → 1.0.7

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