|
| 1 | +--- |
| 2 | +name: troubleshooting |
| 3 | +description: Uses Chrome DevTools MCP and documentation to troubleshoot connection and target issues. Trigger this skill when list_pages, new_page, or navigate_page fail, or when the server initialization fails. |
| 4 | +--- |
| 5 | + |
| 6 | +## Troubleshooting Wizard |
| 7 | + |
| 8 | +You are acting as a troubleshooting wizard to help the user configure and fix their Chrome DevTools MCP server setup. When this skill is triggered (e.g., because `list_pages`, `new_page`, or `navigate_page` failed, or the server wouldn't start), follow this step-by-step diagnostic process: |
| 9 | + |
| 10 | +### Step 1: Determine the Exact Error |
| 11 | + |
| 12 | +Identify the exact error message from the failed tool call or the MCP initialization logs. Look for common errors such as: |
| 13 | + |
| 14 | +- `Target closed` |
| 15 | +- `ProtocolError: Network.enable timed out` or `The socket connection was closed unexpectedly` |
| 16 | +- `Error [ERR_MODULE_NOT_FOUND]: Cannot find module` |
| 17 | +- Any sandboxing or host validation errors. |
| 18 | + |
| 19 | +### Step 2: Read Known Issues |
| 20 | + |
| 21 | +Use the `view_file` tool to read the contents of `docs/troubleshooting.md` in the project root to map the error to a known issue. Pay close attention to: |
| 22 | + |
| 23 | +- Sandboxing restrictions (macOS Seatbelt, Linux containers). |
| 24 | +- WSL requirements. |
| 25 | +- `--autoConnect` handshakes, timeouts, and requirements. |
| 26 | +- Conflicts between `--autoConnect`/`--browser-url` and extension debugging. |
| 27 | + |
| 28 | +### Step 3: Formulate a Configuration |
| 29 | + |
| 30 | +Based on the exact error and the user's environment (OS, MCP client), formulate the correct MCP configuration snippet. Check if they need to: |
| 31 | + |
| 32 | +- Pass `--browser-url=http://127.0.0.1:9222` instead of `--autoConnect` (e.g. if they are in a sandboxed environment like Claude Desktop). |
| 33 | +- Remove `--enableCategoryExtensions` if using `--autoConnect`. |
| 34 | +- Enable remote debugging in Chrome (`chrome://inspect/#remote-debugging`) and accept the connection prompt. |
| 35 | + |
| 36 | +_If you are unsure of the user's configuration, ask the user to provide their current MCP server JSON configuration._ |
| 37 | + |
| 38 | +### Step 4: Run Diagnostic Commands |
| 39 | + |
| 40 | +If the issue is still unclear, use the `run_command` tool to run diagnostic commands to test the server directly: |
| 41 | + |
| 42 | +- `npx chrome-devtools-mcp@latest --help` (to verify the installation and Node.js environment) |
| 43 | +- Ask the user to run `DEBUG=* npx chrome-devtools-mcp@latest --log-file=/tmp/cdm-test.log` to capture verbose logs if they are attempting to run it from an IDE or different environment. |
| 44 | + |
| 45 | +### Step 5: Check GitHub for Existing Issues |
| 46 | + |
| 47 | +If `docs/troubleshooting.md` does not cover the specific error, check if the `gh` (GitHub CLI) tool is available in the environment. If so, use the `run_command` tool to search the GitHub repository for similar issues: |
| 48 | +`gh issue list --repo ChromeDevTools/chrome-devtools-mcp --search "<error snippet>" --state all` |
| 49 | + |
| 50 | +Alternatively, you can recommend that the user checks https://github.com/ChromeDevTools/chrome-devtools-mcp/issues and https://github.com/ChromeDevTools/chrome-devtools-mcp/discussions for help. |
0 commit comments