chrome-mcp-router 0.3.0 → 0.3.2
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 +70 -0
- package/package.json +1 -1
package/README.md
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# chrome-mcp-router
|
|
2
|
+
|
|
3
|
+
A proxy wrapper for [chrome-devtools-mcp](https://github.com/ChromeDevTools/chrome-devtools-mcp) that adds auto-reconnect and project-based configuration.
|
|
4
|
+
|
|
5
|
+
- **Auto-reconnect**: Detects Chrome crashes and automatically restarts the child process when Chrome comes back up
|
|
6
|
+
- **Project routing**: Resolve Chrome debug URLs by project name instead of specifying port numbers directly
|
|
7
|
+
|
|
8
|
+
## Installation
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
# Run with npx (no installation required)
|
|
12
|
+
npx -y chrome-mcp-router@latest --project myproject
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Usage
|
|
16
|
+
|
|
17
|
+
### .mcp.json configuration
|
|
18
|
+
|
|
19
|
+
```json
|
|
20
|
+
{
|
|
21
|
+
"mcpServers": {
|
|
22
|
+
"chrome-devtools": {
|
|
23
|
+
"command": "npx",
|
|
24
|
+
"args": ["-y", "chrome-mcp-router@latest", "--project", "myproject"]
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### CLI Options
|
|
31
|
+
|
|
32
|
+
```
|
|
33
|
+
chrome-mcp-router --project <name>
|
|
34
|
+
chrome-mcp-router --browserUrl <url>
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
| Option | Description |
|
|
38
|
+
| --- | --- |
|
|
39
|
+
| `--project <name>` | Resolve `browserUrl` by project name from the config file |
|
|
40
|
+
| `--browserUrl <url>` | Specify Chrome debug URL directly (e.g. `http://127.0.0.1:9222`) |
|
|
41
|
+
|
|
42
|
+
Other flags (`--slim`, `--no-usage-statistics`, etc.) are passed through to `chrome-devtools-mcp`.
|
|
43
|
+
|
|
44
|
+
### Config file
|
|
45
|
+
|
|
46
|
+
Specify project name to URL mappings in `~/.config/chrome-mcp-router/config.json`.
|
|
47
|
+
|
|
48
|
+
```json
|
|
49
|
+
{
|
|
50
|
+
"projects": {
|
|
51
|
+
"myproject": {
|
|
52
|
+
"browserUrl": "http://127.0.0.1:9200"
|
|
53
|
+
},
|
|
54
|
+
"anotherproject": {
|
|
55
|
+
"browserUrl": "http://127.0.0.1:9201"
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## How it works
|
|
62
|
+
|
|
63
|
+
1. If `--project` is specified, resolves `browserUrl` by project name from the config file
|
|
64
|
+
2. Starts `chrome-devtools-mcp` as a child process and bidirectionally proxies stdio
|
|
65
|
+
3. Polls Chrome's `/json/version` endpoint every 3 seconds to check liveness
|
|
66
|
+
4. When it detects that Chrome has restarted after a crash, stops the old child process, starts a new one, and transparently restores the session by replaying the MCP handshake
|
|
67
|
+
|
|
68
|
+
## License
|
|
69
|
+
|
|
70
|
+
MIT
|
package/package.json
CHANGED