@dynamicu/chromedebug-mcp 2.4.2 → 2.4.4
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/README.md +40 -3
- package/package.json +3 -2
- package/src/services/chrome-service.js +29 -4
- package/src/standalone-server.js +0 -0
package/README.md
CHANGED
|
@@ -36,19 +36,56 @@ npm install
|
|
|
36
36
|
claude mcp add chromedebug -s user -- chromedebug-mcp
|
|
37
37
|
```
|
|
38
38
|
|
|
39
|
+
The MCP server will automatically start both the stdio MCP server and HTTP server for Chrome extension integration.
|
|
40
|
+
|
|
39
41
|
#### Windows
|
|
40
42
|
|
|
41
|
-
On Windows,
|
|
43
|
+
On Windows, the MCP server and HTTP server should be run separately for best reliability:
|
|
42
44
|
|
|
45
|
+
**Step 1: Add MCP Server for Claude Code**
|
|
43
46
|
```bash
|
|
44
47
|
claude mcp add chromedebug -s user -- cmd /c chromedebug-mcp
|
|
45
48
|
```
|
|
46
49
|
|
|
47
|
-
**
|
|
50
|
+
**Step 2: Start HTTP Server for Chrome Extension (separate terminal)**
|
|
51
|
+
```bash
|
|
52
|
+
chromedebug-mcp-server
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
**Why Separate?** On Windows, the stdio-based MCP server (for Claude Code) works best when running independently from the HTTP server (for Chrome extension). This separation provides better stability and prevents connection issues.
|
|
56
|
+
|
|
57
|
+
**Note for Windows Users:**
|
|
58
|
+
- Process cleanup is currently limited on Windows. The server will start successfully but won't clean up orphaned processes from previous sessions.
|
|
59
|
+
- If you only need Claude Code integration (no Chrome extension), the MCP server alone is sufficient.
|
|
60
|
+
- If you need the Chrome extension, run both servers in separate terminal windows.
|
|
61
|
+
|
|
62
|
+
### Standalone HTTP Server (New in v2.4.3)
|
|
63
|
+
|
|
64
|
+
For Windows users or those who prefer to run services separately, you can start the HTTP server independently:
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
# Start HTTP server only (no MCP)
|
|
68
|
+
chromedebug-mcp-server
|
|
69
|
+
|
|
70
|
+
# With options
|
|
71
|
+
chromedebug-mcp-server --verbose --port 3000
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
**Available Options:**
|
|
75
|
+
- `--port PORT` - Specify HTTP server port (optional, auto-discovers if not set)
|
|
76
|
+
- `--verbose` - Enable verbose logging
|
|
77
|
+
- `--debug` - Enable debug mode
|
|
78
|
+
- `--no-cleanup` - Skip process cleanup on startup
|
|
79
|
+
- `--session-id ID` - Set custom session ID
|
|
80
|
+
|
|
81
|
+
**Use Cases:**
|
|
82
|
+
- Windows users who want Chrome extension support without running full MCP server
|
|
83
|
+
- Development environments where you want HTTP server running persistently
|
|
84
|
+
- Situations where MCP and HTTP servers should run in separate processes
|
|
48
85
|
|
|
49
86
|
### Embedded HTTP Server
|
|
50
87
|
|
|
51
|
-
Chrome Debug automatically
|
|
88
|
+
Chrome Debug can automatically start an embedded HTTP server for Chrome extension communication. The server uses ports configured in `config/chrome-pilot-config.json` (default: 3001, 3000, 3002, 3028). The server provides these REST API endpoints:
|
|
52
89
|
|
|
53
90
|
| Endpoint | Method | Description | Body |
|
|
54
91
|
|----------|--------|-------------|------|
|
package/package.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamicu/chromedebug-mcp",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.4",
|
|
4
4
|
"description": "ChromeDebug MCP - MCP server that provides full control over a Chrome browser instance for debugging and automation with AI assistants like Claude Code",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"bin": {
|
|
8
|
-
"chromedebug-mcp": "./src/cli.js"
|
|
8
|
+
"chromedebug-mcp": "./src/cli.js",
|
|
9
|
+
"chromedebug-mcp-server": "./src/standalone-server.js"
|
|
9
10
|
},
|
|
10
11
|
"publishConfig": {
|
|
11
12
|
"access": "public"
|
|
@@ -26,11 +26,13 @@ export class ChromeService {
|
|
|
26
26
|
|
|
27
27
|
/**
|
|
28
28
|
* Initializes the Chrome service with HTTP server if needed
|
|
29
|
+
* Windows-specific: HTTP server failures are non-fatal to prevent MCP crashes
|
|
29
30
|
* @param {Object} options - Initialization options
|
|
30
31
|
* @returns {Promise<Object>} Initialization result
|
|
31
32
|
*/
|
|
32
33
|
async initialize(options = {}) {
|
|
33
34
|
const { startHttp = true, singleServer = false, sessionManager = null } = options;
|
|
35
|
+
const isWindows = process.platform === 'win32';
|
|
34
36
|
|
|
35
37
|
const result = {
|
|
36
38
|
chromeService: 'initialized',
|
|
@@ -57,7 +59,16 @@ export class ChromeService {
|
|
|
57
59
|
console.error('Falling back to port discovery');
|
|
58
60
|
}
|
|
59
61
|
|
|
60
|
-
|
|
62
|
+
// Platform-specific timeout: Windows needs longer initialization time
|
|
63
|
+
const httpTimeout = isWindows ? 20000 : 10000;
|
|
64
|
+
|
|
65
|
+
// Start HTTP server with timeout protection
|
|
66
|
+
const httpServerPromise = startHttpServer(this.chromeController, targetPort);
|
|
67
|
+
const timeoutPromise = new Promise((_, reject) =>
|
|
68
|
+
setTimeout(() => reject(new Error(`HTTP server startup timeout after ${httpTimeout}ms`)), httpTimeout)
|
|
69
|
+
);
|
|
70
|
+
|
|
71
|
+
const { httpServer, serverPort } = await Promise.race([httpServerPromise, timeoutPromise]);
|
|
61
72
|
|
|
62
73
|
this.httpServer = httpServer;
|
|
63
74
|
this.httpServerPort = serverPort;
|
|
@@ -69,11 +80,25 @@ export class ChromeService {
|
|
|
69
80
|
|
|
70
81
|
console.error(`HTTP server started on port ${serverPort}`);
|
|
71
82
|
} catch (error) {
|
|
72
|
-
|
|
83
|
+
// IMPORTANT: HTTP server failures are non-fatal
|
|
84
|
+
// This prevents MCP server crashes when HTTP server can't start
|
|
85
|
+
const errorMessage = error.message || String(error);
|
|
86
|
+
console.error('⚠️ HTTP Server Initialization Failed (non-fatal):', errorMessage);
|
|
87
|
+
|
|
88
|
+
if (isWindows) {
|
|
89
|
+
console.error('ℹ️ On Windows, you can start the HTTP server separately:');
|
|
90
|
+
console.error(' npm run server');
|
|
91
|
+
console.error(' or: chromedebug-mcp-server');
|
|
92
|
+
}
|
|
93
|
+
|
|
73
94
|
result.httpServer = {
|
|
74
|
-
error:
|
|
75
|
-
status: 'failed'
|
|
95
|
+
error: errorMessage,
|
|
96
|
+
status: 'failed',
|
|
97
|
+
platform: process.platform,
|
|
98
|
+
fatal: false // Explicitly mark as non-fatal
|
|
76
99
|
};
|
|
100
|
+
|
|
101
|
+
// Do NOT throw - allow MCP server to continue without HTTP
|
|
77
102
|
}
|
|
78
103
|
}
|
|
79
104
|
|
package/src/standalone-server.js
CHANGED
|
File without changes
|