Chrome 浏览器排查
- 作者仓库星标 42,728
- 作者仓库 chrome-devtools-mcp
Core Concepts
Browser lifecycle: Browser starts automatically on first tool call using a persistent Chrome profile. Configure via CLI args in the MCP server configuration: npx chrome-devtools-mcp@latest --help.
Addional tooling can be enabled by providing the following flags:
- For extension tooling, use the
--categoryExtensionsflag. - For memory tooling, use the
--memoryDebuggingflag.
Page selection: Tools operate on the currently selected page. Use list_pages to see available pages, then select_page to switch context.
Element interaction: Use take_snapshot to get page structure with element uids. Each element has a unique uid for interaction. If an element isn't found, take a fresh snapshot - the element may have been removed or the page changed.
Workflow Patterns
Before interacting with a page
- Navigate:
navigate_pageornew_page - Wait:
wait_forto ensure content is loaded if you know what you look for. - Snapshot:
take_snapshotto understand page structure - Interact: Use element
uids from snapshot forclick,fill, etc.
Efficient data retrieval
- Use
filePathparameter for large outputs (screenshots, snapshots, traces) - Use pagination (
pageIdx,pageSize) and filtering (types) to minimize data - Set
includeSnapshot: falseon input actions unless you need updated page state
Tool selection
- Automation/interaction:
take_snapshot(text-based, faster, better for automation) - Visual inspection:
take_screenshot(when user needs to see visual state) - Additional details:
evaluate_scriptfor data not in accessibility tree
Parallel execution
You can send multiple tool calls in parallel, but maintain correct order: navigate → wait → snapshot → interact.
Testing an extension
- Install: Use
install_extensionwith the path to the unpacked extension. - Identify: Get the extension ID from the response or by calling
list_extensions. - Trigger Action: Use
trigger_extension_actionto open the popup or side panel if applicable. - Verify Service Worker: Use
evaluate_scriptwithserviceWorkerIdto check extension state or trigger background actions. - Verify Page Behavior: Navigate to a page where the extension operates and use
take_snapshotto check if content scripts injected elements or modified the page correctly.
Troubleshooting
If chrome-devtools-mcp is insufficient, guide users to use Chrome DevTools UI:
If there are errors launching chrome-devtools-mcp or Chrome, refer to https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/docs/troubleshooting.md.
- 流狐分类
- AI 智能
- 作者声明 Agent
- 未找到明确声明;不据此推断已兼容或已测试
- 静态检查
- 88 / 100 · 启发式扫描,不代表运行安全
- 作者 / 版本 / 许可
- @ChromeDevTools · 未声明 license
- 流狐 Token 估算
- 低消耗
- 流狐接入估算
- 需简单配置
- 是否需要外部 API Key
- 未发现要求
- 检测到的系统要求
- macOS · Linux · Windows
- 底层运行要求
- 未声明
- 检测到的文件与系统行为
-
- 只读
- Shell 执行
- 检测到的网络行为
- 仅限本地
- 安装命令数
- 无(仅作为资料)
档案由构建时根据 SKILL.md 与安装命令自动衍生,可能与作者实际意图存在差异。
需要注意: 未限定 allowed-tools,默认拥有全部工具权限。
作者没有在当前 SKILL.md 中定义固定输出样例。 Browser lifecycle: Browser starts automatically on first tool call using a persistent Chrome profile. Configure via CLI args in the MCP server configuration: npx chrome-devtools-mcp@latest --help. Addional tooling can be enabled by providing the following…
Workflow Patterns
Navigate: navigatepage or newpage Wait: waitfor to ensure content is loaded if you know what you look for. Snapshot: takesnapshot to understand page structure
Use filePath parameter for large outputs (screenshots, snapshots, traces) Use pagination (pageIdx, pageSize) and filtering (types) to minimize data Set includeSnapshot: false on input actions unless you need updated page state
Automation/interaction: takesnapshot (text-based, faster, better for automation) Visual inspection: takescreenshot (when user needs to see visual state) Additional details: evaluatescript for data not in accessibility tree
You can send multiple tool calls in parallel, but maintain correct order: navigate → wait → snapshot → interact.
## Core Concepts
**Browser lifecycle**: Browser starts automatically on first tool call using a persistent Chrome profile. Configure via CLI args in the MCP server configuration: `npx chrome-devtools-mcp@latest --help`.
Addional tooling can be enabled by providing the following flags:
- For extension tooling, use the `--categoryExtensions` flag.
- For memory tooling, use the `--memoryDebugging` flag.
**Page selection**: Tools operate on the currently selected page. Use `list_pages` to see available pages, then `select_page` to switch context.
**Element interaction**: Use `take_snapshot` to get page structure with element `uid`s. Each element has a unique `uid` for interaction. If an element isn't found, take a fresh snapshot - the element may have been removed or the page changed.
## Workflow Patterns
### Before interacting with a page
1. Navigate: `navigate_page` or `new_page`
2. Wait: `wait_for` to ensure content is loaded if you know what you look for.
3. Snapshot: `take_snapshot` to understand page structure
4. Interact: Use element `uid`s from snapshot for `click`, `fill`, etc.
### Efficient data retrieval
- Use `filePath` parameter for large outputs (screenshots, snapshots, traces)
- Use pagination (`pageIdx`, `pageSize`) and filtering (`types`) to minimize data
- Set `includeSnapshot: false` on input actions unless you need updated page state
### Tool selection
- **Automation/interaction**: `take_snapshot` (text-based, faster, better for automation)
- **Visual inspection**: `take_screenshot` (when user needs to see visual state)
- **Additional details**: `evaluate_script` for data not in accessibility tree
### Parallel execution
You can send multiple tool calls in parallel, but maintain correct order: navigate → wait → snapshot → interact.
… 作者原文负责流程事实;流狐只索引当前章节、要点、文件与命令。
章节 -> Core Concepts → Workflow Patterns → Before interacting with a page → Efficient data retrieval → Tool selection → Parallel execution
要点 -> Browser lifecycle · Page selection · Element interaction · Automation/interaction · Visual inspection · Additional details · Install · Identify
文件/命令 -> npx chrome-devtools-mcp@latest --help · --categoryExtensions · --memoryDebugging · listpages · selectpage · takesnapshot · uid · navigatepage
内容 SHA-256 -> 4595ad35cb98
方法与流程
适用与边界
原文中的明确线索
npx chrome-devtools-mcp@latest --help、--categoryExtensions、--memoryDebugging、listpages、selectpage、takesnapshot、uid、navigatepage