{
  "canonical_name": "ChromeDevTools/chrome-devtools-mcp",
  "compilation_id": "pack_54cf22a86a7c4b19a2afea14c521b8db",
  "created_at": "2026-05-15T14:11:40.074582+00:00",
  "created_by": "project-pack-compiler",
  "feedback": {
    "carrier_selection_notes": [
      "viable_asset_types=mcp_config, recipe, host_instruction, eval, preflight",
      "recommended_asset_types=mcp_config, recipe, host_instruction, eval, preflight"
    ],
    "evidence_delta": {
      "confirmed_claims": [
        "identity_anchor_present",
        "capability_and_host_targets_present",
        "install_path_declared_or_better"
      ],
      "missing_required_fields": [],
      "must_verify_forwarded": [
        "Run or inspect `npx chrome-devtools-mcp@latest` in an isolated environment.",
        "Confirm the project exposes the claimed capability to at least one target host."
      ],
      "quickstart_execution_scope": "allowlisted_sandbox_smoke",
      "sandbox_command": "npx chrome-devtools-mcp@latest",
      "sandbox_container_image": "node:22-slim",
      "sandbox_execution_backend": "docker",
      "sandbox_planner_decision": "deterministic_isolated_install",
      "sandbox_validation_id": "sbx_35dd409a2ec54525b59d71f315a7d986"
    },
    "feedback_event_type": "project_pack_compilation_feedback",
    "learning_candidate_reasons": [],
    "template_gaps": []
  },
  "identity": {
    "canonical_id": "project_ea204f7aae720e4458e992ed6fe167de",
    "canonical_name": "ChromeDevTools/chrome-devtools-mcp",
    "homepage_url": null,
    "license": "unknown",
    "repo_url": "https://github.com/ChromeDevTools/chrome-devtools-mcp",
    "slug": "chrome-devtools-mcp",
    "source_packet_id": "phit_aa292603359a4e64b06d07d564682164",
    "source_validation_id": "dval_4bf0f41c618044f5bad63623dbb605c1"
  },
  "merchandising": {
    "best_for": "需要工具连接与集成能力，并使用 mcp_host的用户",
    "github_forks": 2503,
    "github_stars": 39420,
    "one_liner_en": "Chrome DevTools for coding agents",
    "one_liner_zh": "Chrome DevTools for coding agents",
    "primary_category": {
      "category_id": "tool-integrations",
      "confidence": "high",
      "name_en": "Tool Integrations",
      "name_zh": "工具连接与集成",
      "reason": "curated popular coverage category matched project identity"
    },
    "target_user": "使用 mcp_host 等宿主 AI 的用户",
    "title_en": "chrome-devtools-mcp",
    "title_zh": "chrome-devtools-mcp 能力包",
    "visible_tags": [
      {
        "label_en": "Browser Agents",
        "label_zh": "浏览器 Agent",
        "source": "repo_evidence_project_characteristics",
        "tag_id": "product_domain-browser-agents",
        "type": "product_domain"
      },
      {
        "label_en": "Web Task Automation",
        "label_zh": "网页任务自动化",
        "source": "repo_evidence_project_characteristics",
        "tag_id": "user_job-web-task-automation",
        "type": "user_job"
      },
      {
        "label_en": "Structured Data Extraction",
        "label_zh": "结构化数据提取",
        "source": "repo_evidence_project_characteristics",
        "tag_id": "core_capability-structured-data-extraction",
        "type": "core_capability"
      },
      {
        "label_en": "Page Observation and Action Planning",
        "label_zh": "页面观察与动作规划",
        "source": "repo_evidence_project_characteristics",
        "tag_id": "workflow_pattern-page-observation-and-action-planning",
        "type": "workflow_pattern"
      },
      {
        "label_en": "Open Source Tool",
        "label_zh": "开源工具",
        "source": "repo_evidence_project_characteristics",
        "tag_id": "selection_signal-open-source-tool",
        "type": "selection_signal"
      }
    ]
  },
  "packet_id": "phit_aa292603359a4e64b06d07d564682164",
  "page_model": {
    "artifacts": {
      "artifact_slug": "chrome-devtools-mcp",
      "files": [
        "PROJECT_PACK.json",
        "QUICK_START.md",
        "PROMPT_PREVIEW.md",
        "HUMAN_MANUAL.md",
        "AI_CONTEXT_PACK.md",
        "BOUNDARY_RISK_CARD.md",
        "PITFALL_LOG.md",
        "REPO_INSPECTION.json",
        "REPO_INSPECTION.md",
        "CAPABILITY_CONTRACT.json",
        "EVIDENCE_INDEX.json",
        "CLAIM_GRAPH.json"
      ],
      "required_files": [
        "PROJECT_PACK.json",
        "QUICK_START.md",
        "PROMPT_PREVIEW.md",
        "HUMAN_MANUAL.md",
        "AI_CONTEXT_PACK.md",
        "BOUNDARY_RISK_CARD.md",
        "PITFALL_LOG.md",
        "REPO_INSPECTION.json"
      ]
    },
    "detail": {
      "capability_source": "Project Hit Packet + DownstreamValidationResult",
      "commands": [
        {
          "command": "npx chrome-devtools-mcp@latest",
          "label": "Node.js / npx · 官方安装入口",
          "source": "https://github.com/ChromeDevTools/chrome-devtools-mcp#readme",
          "verified": true
        }
      ],
      "display_tags": [
        "浏览器 Agent",
        "网页任务自动化",
        "结构化数据提取",
        "页面观察与动作规划",
        "开源工具"
      ],
      "eyebrow": "工具连接与集成",
      "glance": [
        {
          "body": "判断自己是不是目标用户。",
          "label": "最适合谁",
          "value": "需要工具连接与集成能力，并使用 mcp_host的用户"
        },
        {
          "body": "先理解能力边界，再决定是否继续。",
          "label": "核心价值",
          "value": "Chrome DevTools for coding agents"
        },
        {
          "body": "未完成验证前保持审慎。",
          "label": "继续前",
          "value": "publish to Doramagic.ai project surfaces"
        }
      ],
      "guardrail_source": "Boundary & Risk Card",
      "guardrails": [
        {
          "body": "Prompt Preview 只展示流程，不证明项目已安装或运行。",
          "label": "Check 1",
          "value": "不要把试用当真实运行"
        },
        {
          "body": "mcp_host",
          "label": "Check 2",
          "value": "确认宿主兼容"
        },
        {
          "body": "publish to Doramagic.ai project surfaces",
          "label": "Check 3",
          "value": "先隔离验证"
        }
      ],
      "mode": "mcp_config, recipe, host_instruction, eval, preflight",
      "pitfall_log": {
        "items": [
          {
            "body": "GitHub 社区证据显示该项目存在一个配置相关的待验证问题：performance_start_trace records 'CPU throttling: none / Network throttling: none' despite emulate setting throttling — measurements come back partially or full…",
            "category": "配置坑",
            "evidence": [
              "community_evidence:github | cevd_644cef1d4144424abe63f24528f5d082 | https://github.com/ChromeDevTools/chrome-devtools-mcp/issues/1955 | 来源讨论提到 macos 相关条件，需在安装/试用前复核。"
            ],
            "severity": "high",
            "suggested_check": "来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。",
            "title": "来源证据：performance_start_trace records 'CPU throttling: none / Network throttling: none' despite emulate setting throttling —…",
            "user_impact": "可能增加新用户试用和生产接入成本。"
          },
          {
            "body": "GitHub 社区证据显示该项目存在一个安装相关的待验证问题：Auto-connect doesn't work on WSL with mirrored networking (Chrome on Windows host)",
            "category": "安装坑",
            "evidence": [
              "community_evidence:github | cevd_3275fc356e284918a94cf8c2c037caee | https://github.com/ChromeDevTools/chrome-devtools-mcp/issues/2004 | 来源讨论提到 windows 相关条件，需在安装/试用前复核。"
            ],
            "severity": "medium",
            "suggested_check": "来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。",
            "title": "来源证据：Auto-connect doesn't work on WSL with mirrored networking (Chrome on Windows host)",
            "user_impact": "可能增加新用户试用和生产接入成本。"
          },
          {
            "body": "GitHub 社区证据显示该项目存在一个安装相关的待验证问题：Update check hardcodes registry.npmjs.org, ignoring user's npm registry configuration",
            "category": "安装坑",
            "evidence": [
              "community_evidence:github | cevd_1946d257bfb04c23a67250da4d584631 | https://github.com/ChromeDevTools/chrome-devtools-mcp/issues/1943 | 来源讨论提到 node 相关条件，需在安装/试用前复核。"
            ],
            "severity": "medium",
            "suggested_check": "来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。",
            "title": "来源证据：Update check hardcodes registry.npmjs.org, ignoring user's npm registry configuration",
            "user_impact": "可能阻塞安装或首次运行。"
          },
          {
            "body": "GitHub 社区证据显示该项目存在一个安装相关的待验证问题：chrome-devtools-mcp: v0.20.1",
            "category": "安装坑",
            "evidence": [
              "community_evidence:github | cevd_11700367e17048138ab79571d751cec4 | https://github.com/ChromeDevTools/chrome-devtools-mcp/releases/tag/chrome-devtools-mcp-v0.20.1 | 来源类型 github_release 暴露的待验证使用条件。"
            ],
            "severity": "medium",
            "suggested_check": "来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。",
            "title": "来源证据：chrome-devtools-mcp: v0.20.1",
            "user_impact": "可能增加新用户试用和生产接入成本。"
          },
          {
            "body": "GitHub 社区证据显示该项目存在一个安装相关的待验证问题：chrome-devtools-mcp: v0.22.0",
            "category": "安装坑",
            "evidence": [
              "community_evidence:github | cevd_6ff69eabdc334130b7b093706390c6c1 | https://github.com/ChromeDevTools/chrome-devtools-mcp/releases/tag/chrome-devtools-mcp-v0.22.0 | 来源类型 github_release 暴露的待验证使用条件。"
            ],
            "severity": "medium",
            "suggested_check": "来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。",
            "title": "来源证据：chrome-devtools-mcp: v0.22.0",
            "user_impact": "可能增加新用户试用和生产接入成本。"
          },
          {
            "body": "GitHub 社区证据显示该项目存在一个配置相关的待验证问题：chrome-devtools-mcp: v0.21.0",
            "category": "配置坑",
            "evidence": [
              "community_evidence:github | cevd_41b2681dc7ae4bbabdb071511fdc0191 | https://github.com/ChromeDevTools/chrome-devtools-mcp/releases/tag/chrome-devtools-mcp-v0.21.0 | 来源类型 github_release 暴露的待验证使用条件。"
            ],
            "severity": "medium",
            "suggested_check": "来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。",
            "title": "来源证据：chrome-devtools-mcp: v0.21.0",
            "user_impact": "可能增加新用户试用和生产接入成本。"
          },
          {
            "body": "README/documentation is current enough for a first validation pass.",
            "category": "能力坑",
            "evidence": [
              "capability.assumptions | github_repo:1054793726 | https://github.com/ChromeDevTools/chrome-devtools-mcp | README/documentation is current enough for a first validation pass."
            ],
            "severity": "medium",
            "suggested_check": "将假设转成下游验证清单。",
            "title": "能力判断依赖假设",
            "user_impact": "假设不成立时，用户拿不到承诺的能力。"
          },
          {
            "body": "GitHub 社区证据显示该项目存在一个运行相关的待验证问题：chrome-devtools-mcp: v0.20.0",
            "category": "运行坑",
            "evidence": [
              "community_evidence:github | cevd_8bef6b0b7a80406ab00a0576f82b35a7 | https://github.com/ChromeDevTools/chrome-devtools-mcp/releases/tag/chrome-devtools-mcp-v0.20.0 | 来源类型 github_release 暴露的待验证使用条件。"
            ],
            "severity": "medium",
            "suggested_check": "来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。",
            "title": "来源证据：chrome-devtools-mcp: v0.20.0",
            "user_impact": "可能增加新用户试用和生产接入成本。"
          },
          {
            "body": "GitHub 社区证据显示该项目存在一个运行相关的待验证问题：chrome-devtools-mcp: v0.24.0",
            "category": "运行坑",
            "evidence": [
              "community_evidence:github | cevd_e42176fdf7da4015ac82844a46f37c08 | https://github.com/ChromeDevTools/chrome-devtools-mcp/releases/tag/chrome-devtools-mcp-v0.24.0 | 来源类型 github_release 暴露的待验证使用条件。"
            ],
            "severity": "medium",
            "suggested_check": "来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。",
            "title": "来源证据：chrome-devtools-mcp: v0.24.0",
            "user_impact": "可能增加新用户试用和生产接入成本。"
          },
          {
            "body": "GitHub 社区证据显示该项目存在一个运行相关的待验证问题：chrome-devtools-mcp: v0.26.0",
            "category": "运行坑",
            "evidence": [
              "community_evidence:github | cevd_a6cf1fa6206f48e6a9e88a5d9d00fd64 | https://github.com/ChromeDevTools/chrome-devtools-mcp/releases/tag/chrome-devtools-mcp-v0.26.0 | 来源类型 github_release 暴露的待验证使用条件。"
            ],
            "severity": "medium",
            "suggested_check": "来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。",
            "title": "来源证据：chrome-devtools-mcp: v0.26.0",
            "user_impact": "可能增加新用户试用和生产接入成本。"
          },
          {
            "body": "未记录 last_activity_observed。",
            "category": "维护坑",
            "evidence": [
              "evidence.maintainer_signals | github_repo:1054793726 | https://github.com/ChromeDevTools/chrome-devtools-mcp | last_activity_observed missing"
            ],
            "severity": "medium",
            "suggested_check": "补 GitHub 最近 commit、release、issue/PR 响应信号。",
            "title": "维护活跃度未知",
            "user_impact": "新项目、停更项目和活跃项目会被混在一起，推荐信任度下降。"
          },
          {
            "body": "no_demo",
            "category": "安全/权限坑",
            "evidence": [
              "downstream_validation.risk_items | github_repo:1054793726 | https://github.com/ChromeDevTools/chrome-devtools-mcp | no_demo; severity=medium"
            ],
            "severity": "medium",
            "suggested_check": "进入安全/权限治理复核队列。",
            "title": "下游验证发现风险项",
            "user_impact": "下游已经要求复核，不能在页面中弱化。"
          },
          {
            "body": "No sandbox install has been executed yet; downstream must verify before user use.",
            "category": "安全/权限坑",
            "evidence": [
              "risks.safety_notes | github_repo:1054793726 | https://github.com/ChromeDevTools/chrome-devtools-mcp | No sandbox install has been executed yet; downstream must verify before user use."
            ],
            "severity": "medium",
            "suggested_check": "转成明确权限清单和安全审查提示。",
            "title": "存在安全注意事项",
            "user_impact": "用户安装前需要知道权限边界和敏感操作。"
          },
          {
            "body": "no_demo",
            "category": "安全/权限坑",
            "evidence": [
              "risks.scoring_risks | github_repo:1054793726 | https://github.com/ChromeDevTools/chrome-devtools-mcp | no_demo; severity=medium"
            ],
            "severity": "medium",
            "suggested_check": "把风险写入边界卡，并确认是否需要人工复核。",
            "title": "存在评分风险",
            "user_impact": "风险会影响是否适合普通用户安装。"
          },
          {
            "body": "GitHub 社区证据显示该项目存在一个安全/权限相关的待验证问题：Close empty-object tool schemas for stricter MCP client validation",
            "category": "安全/权限坑",
            "evidence": [
              "community_evidence:github | cevd_2af67f120a9d4486998a92da71a92cb9 | https://github.com/ChromeDevTools/chrome-devtools-mcp/issues/2049 | 来源类型 github_issue 暴露的待验证使用条件。"
            ],
            "severity": "medium",
            "suggested_check": "来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。",
            "title": "来源证据：Close empty-object tool schemas for stricter MCP client validation",
            "user_impact": "可能增加新用户试用和生产接入成本。"
          },
          {
            "body": "GitHub 社区证据显示该项目存在一个安全/权限相关的待验证问题：chrome-devtools-mcp: v0.25.0",
            "category": "安全/权限坑",
            "evidence": [
              "community_evidence:github | cevd_51ee93809f08423dbc7b6c0d3eeddc77 | https://github.com/ChromeDevTools/chrome-devtools-mcp/releases/tag/chrome-devtools-mcp-v0.25.0 | 来源类型 github_release 暴露的待验证使用条件。"
            ],
            "severity": "medium",
            "suggested_check": "来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。",
            "title": "来源证据：chrome-devtools-mcp: v0.25.0",
            "user_impact": "可能影响授权、密钥配置或安全边界。"
          }
        ],
        "source": "ProjectPitfallLog + ProjectHitPacket + validation + community signals",
        "summary": "发现 18 个潜在踩坑项，其中 1 个为 high/blocking；最高优先级：配置坑 - 来源证据：performance_start_trace records 'CPU throttling: none / Network throttling: none' despite emulate setting throttling —…。",
        "title": "踩坑日志"
      },
      "snapshot": {
        "contributors": 85,
        "forks": 2503,
        "license": "unknown",
        "note": "站点快照，非实时质量证明；用于开工前背景判断。",
        "stars": 39420
      },
      "source_url": "https://github.com/ChromeDevTools/chrome-devtools-mcp",
      "steps": [
        {
          "body": "不安装项目，先体验能力节奏。",
          "code": "preview",
          "title": "先试 Prompt"
        },
        {
          "body": "理解输入、输出、失败模式和边界。",
          "code": "manual",
          "title": "读说明书"
        },
        {
          "body": "把上下文交给宿主 AI 继续工作。",
          "code": "context",
          "title": "带给 AI"
        },
        {
          "body": "进入主力环境前先完成安装入口与风险边界验证。",
          "code": "verify",
          "title": "沙箱验证"
        }
      ],
      "subtitle": "Chrome DevTools for coding agents",
      "title": "chrome-devtools-mcp 能力包",
      "trial_prompt": "# chrome-devtools-mcp - Prompt Preview\n\n> Copy the prompt below into your AI host before installing anything.\n> Its purpose is to let you safely feel the project's workflow, not to claim the project has already run.\n\n## Copy this prompt\n\n```text\nYou are using an independent Doramagic capability pack for ChromeDevTools/chrome-devtools-mcp.\n\nProject:\n- Name: chrome-devtools-mcp\n- Repository: https://github.com/ChromeDevTools/chrome-devtools-mcp\n- Summary: Chrome DevTools for coding agents\n- Host target: mcp_host\n\nGoal:\nHelp me evaluate this project for the following task without installing it yet: Chrome DevTools for coding agents\n\nBefore taking action:\n1. Restate my task, success standard, and boundary.\n2. Identify whether the next step requires tools, browser access, network access, filesystem access, credentials, package installation, or host configuration.\n3. Use only the Doramagic Project Pack, the upstream repository, and the source-linked evidence listed below.\n4. If a real command, install step, API call, file write, or host integration is required, mark it as \"requires post-install verification\" and ask for approval first.\n5. If evidence is missing, say \"evidence is missing\" instead of filling the gap.\n\nPreviewable capabilities:\n- Capability 1: Use the source-backed project context to guide one small, checkable workflow step.\n\nCapabilities that require post-install verification:\n- Capability 1: Use the source-backed project context to guide one small, checkable workflow step.\n- Capability 2: Use the source-backed project context to guide one small, checkable workflow step.\n\nCore service flow:\n1. overview: Project Overview. Produce one small intermediate artifact and wait for confirmation.\n2. configuration: Configuration Reference. Produce one small intermediate artifact and wait for confirmation.\n3. system-architecture: System Architecture. Produce one small intermediate artifact and wait for confirmation.\n4. mcp-protocol: MCP Protocol Integration. Produce one small intermediate artifact and wait for confirmation.\n5. automation-tools: Input and Navigation Automation Tools. Produce one small intermediate artifact and wait for confirmation.\n\nSource-backed evidence to keep in mind:\n- https://github.com/ChromeDevTools/chrome-devtools-mcp\n- https://github.com/ChromeDevTools/chrome-devtools-mcp#readme\n- skills/a11y-debugging/SKILL.md\n- skills/chrome-devtools/SKILL.md\n- skills/chrome-devtools-cli/SKILL.md\n- skills/debug-optimize-lcp/SKILL.md\n- skills/memory-leak-debugging/SKILL.md\n- skills/troubleshooting/SKILL.md\n- README.md\n- package.json\n\nFirst response rules:\n1. Start Step 1 only.\n2. Explain the one service action you will perform first.\n3. Ask exactly three questions about my target workflow, success standard, and sandbox boundary.\n4. Stop and wait for my answers.\n\nStep 1 follow-up protocol:\n- After I answer the first three questions, stay in Step 1.\n- Produce six parts only: clarified task, success standard, boundary conditions, two or three options, tradeoffs for each option, and one recommendation.\n- End by asking whether I confirm the recommendation.\n- Do not move to Step 2 until I explicitly confirm.\n\nConversation rules:\n- Advance one step at a time and wait for confirmation after each small artifact.\n- Write outputs as recommendations or planned checks, not as completed execution.\n- Do not claim tests passed, files changed, commands ran, APIs were called, or the project was installed.\n- If the user asks for execution, first provide the sandbox setup, expected output, rollback, and approval checkpoint.\n```\n",
      "voices": [
        {
          "body": "来源平台：github。github/github_issue: Auto-connect doesn't work on WSL with mirrored networking (Chrome on Win（https://github.com/ChromeDevTools/chrome-devtools-mcp/issues/2004）；github/github_issue: Close empty-object tool schemas for stricter MCP client validation（https://github.com/ChromeDevTools/chrome-devtools-mcp/issues/2049）；github/github_issue: performance_start_trace records 'CPU throttling: none / Network throttli（https://github.com/ChromeDevTools/chrome-devtools-mcp/issues/1955）；github/github_issue: Update check hardcodes registry.npmjs.org, ignoring user's npm registry （https://github.com/ChromeDevTools/chrome-devtools-mcp/issues/1943）；github/github_release: chrome-devtools-mcp: v0.26.0（https://github.com/ChromeDevTools/chrome-devtools-mcp/releases/tag/chrome-devtools-mcp-v0.26.0）；github/github_release: chrome-devtools-mcp: v0.25.0（https://github.com/ChromeDevTools/chrome-devtools-mcp/releases/tag/chrome-devtools-mcp-v0.25.0）；github/github_release: chrome-devtools-mcp: v0.24.0（https://github.com/ChromeDevTools/chrome-devtools-mcp/releases/tag/chrome-devtools-mcp-v0.24.0）；github/github_release: chrome-devtools-mcp: v0.22.0（https://github.com/ChromeDevTools/chrome-devtools-mcp/releases/tag/chrome-devtools-mcp-v0.22.0）；github/github_release: chrome-devtools-mcp: v0.21.0（https://github.com/ChromeDevTools/chrome-devtools-mcp/releases/tag/chrome-devtools-mcp-v0.21.0）；github/github_release: chrome-devtools-mcp: v0.20.3（https://github.com/ChromeDevTools/chrome-devtools-mcp/releases/tag/chrome-devtools-mcp-v0.20.3）；github/github_release: chrome-devtools-mcp: v0.20.1（https://github.com/ChromeDevTools/chrome-devtools-mcp/releases/tag/chrome-devtools-mcp-v0.20.1）；github/github_release: chrome-devtools-mcp: v0.20.0（https://github.com/ChromeDevTools/chrome-devtools-mcp/releases/tag/chrome-devtools-mcp-v0.20.0）。这些是项目级外部声音，不作为单独质量证明。",
          "items": [
            {
              "kind": "github_issue",
              "source": "github",
              "title": "Auto-connect doesn't work on WSL with mirrored networking (Chrome on Win",
              "url": "https://github.com/ChromeDevTools/chrome-devtools-mcp/issues/2004"
            },
            {
              "kind": "github_issue",
              "source": "github",
              "title": "Close empty-object tool schemas for stricter MCP client validation",
              "url": "https://github.com/ChromeDevTools/chrome-devtools-mcp/issues/2049"
            },
            {
              "kind": "github_issue",
              "source": "github",
              "title": "performance_start_trace records 'CPU throttling: none / Network throttli",
              "url": "https://github.com/ChromeDevTools/chrome-devtools-mcp/issues/1955"
            },
            {
              "kind": "github_issue",
              "source": "github",
              "title": "Update check hardcodes registry.npmjs.org, ignoring user's npm registry ",
              "url": "https://github.com/ChromeDevTools/chrome-devtools-mcp/issues/1943"
            },
            {
              "kind": "github_release",
              "source": "github",
              "title": "chrome-devtools-mcp: v0.26.0",
              "url": "https://github.com/ChromeDevTools/chrome-devtools-mcp/releases/tag/chrome-devtools-mcp-v0.26.0"
            },
            {
              "kind": "github_release",
              "source": "github",
              "title": "chrome-devtools-mcp: v0.25.0",
              "url": "https://github.com/ChromeDevTools/chrome-devtools-mcp/releases/tag/chrome-devtools-mcp-v0.25.0"
            },
            {
              "kind": "github_release",
              "source": "github",
              "title": "chrome-devtools-mcp: v0.24.0",
              "url": "https://github.com/ChromeDevTools/chrome-devtools-mcp/releases/tag/chrome-devtools-mcp-v0.24.0"
            },
            {
              "kind": "github_release",
              "source": "github",
              "title": "chrome-devtools-mcp: v0.22.0",
              "url": "https://github.com/ChromeDevTools/chrome-devtools-mcp/releases/tag/chrome-devtools-mcp-v0.22.0"
            },
            {
              "kind": "github_release",
              "source": "github",
              "title": "chrome-devtools-mcp: v0.21.0",
              "url": "https://github.com/ChromeDevTools/chrome-devtools-mcp/releases/tag/chrome-devtools-mcp-v0.21.0"
            },
            {
              "kind": "github_release",
              "source": "github",
              "title": "chrome-devtools-mcp: v0.20.3",
              "url": "https://github.com/ChromeDevTools/chrome-devtools-mcp/releases/tag/chrome-devtools-mcp-v0.20.3"
            },
            {
              "kind": "github_release",
              "source": "github",
              "title": "chrome-devtools-mcp: v0.20.1",
              "url": "https://github.com/ChromeDevTools/chrome-devtools-mcp/releases/tag/chrome-devtools-mcp-v0.20.1"
            },
            {
              "kind": "github_release",
              "source": "github",
              "title": "chrome-devtools-mcp: v0.20.0",
              "url": "https://github.com/ChromeDevTools/chrome-devtools-mcp/releases/tag/chrome-devtools-mcp-v0.20.0"
            }
          ],
          "status": "已收录 12 条来源",
          "title": "社区讨论"
        }
      ]
    },
    "homepage_card": {
      "category": "工具连接与集成",
      "desc": "Chrome DevTools for coding agents",
      "effort": "安装已验证",
      "forks": 2503,
      "icon": "link",
      "name": "chrome-devtools-mcp 能力包",
      "risk": "可发布",
      "slug": "chrome-devtools-mcp",
      "stars": 39420,
      "tags": [
        "浏览器 Agent",
        "网页任务自动化",
        "结构化数据提取",
        "页面观察与动作规划",
        "开源工具"
      ],
      "thumb": "gray",
      "type": "MCP 配置"
    },
    "manual": {
      "markdown": "# https://github.com/ChromeDevTools/chrome-devtools-mcp 项目说明书\n\n生成时间：2026-05-15 14:02:19 UTC\n\n## 目录\n\n- [Project Overview](#overview)\n- [Installation and Setup](#installation)\n- [Configuration Reference](#configuration)\n- [System Architecture](#system-architecture)\n- [MCP Protocol Integration](#mcp-protocol)\n- [Input and Navigation Automation Tools](#automation-tools)\n- [Debugging and Inspection Tools](#debugging-tools)\n- [Performance Analysis Tools](#performance-tools)\n- [CLI Reference](#cli-reference)\n- [Telemetry and Monitoring](#telemetry)\n\n<a id='overview'></a>\n\n## Project Overview\n\n### 相关页面\n\n相关主题：[Installation and Setup](#installation), [System Architecture](#system-architecture), [Configuration Reference](#configuration)\n\n<details>\n<summary>相关源码文件</summary>\n\n以下源码文件用于生成本页说明：\n\n- [AGENTS.md](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/AGENTS.md)\n- [skills/chrome-devtools-cli/SKILL.md](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/skills/chrome-devtools-cli/SKILL.md)\n- [skills/debug-optimize-lcp/SKILL.md](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/skills/debug-optimize-lcp/SKILL.md)\n- [skills/a11y-debugging/SKILL.md](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/skills/a11y-debugging/SKILL.md)\n- [skills/debug-optimize-lcp/references/optimization-strategies.md](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/skills/debug-optimize-lcp/references/optimization-strategies.md)\n- [scripts/eval_scenarios/snapshot_test.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/scripts/eval_scenarios/snapshot_test.ts)\n- [scripts/eval_scenarios/performance_test.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/scripts/eval_scenarios/performance_test.ts)\n- [src/tools/ToolDefinition.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/tools/ToolDefinition.ts)\n- [src/McpResponse.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/McpResponse.ts)\n- [src/tools/webmcp.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/tools/webmcp.ts)\n- [src/PageCollector.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/PageCollector.ts)\n</details>\n\n# Project Overview\n\n## Introduction\n\nThe **chrome-devtools-mcp** project is a Model Context Protocol (MCP) server and command-line interface (CLI) for Chrome DevTools. It provides a comprehensive bridge that enables AI assistants, automated testing systems, and developer tools to programmatically control and interact with Chrome browser instances through Chrome DevTools Protocol (CDP).\n\n资料来源：[AGENTS.md](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/AGENTS.md)\n\n## Core Purpose and Scope\n\nThe project serves as an abstraction layer that exposes Chrome DevTools capabilities as MCP tools, making browser automation accessible through a standardized protocol. This enables use cases including:\n\n- **AI-Powered Browser Automation**: Allowing language models to control browsers for research, testing, and data extraction\n- **Performance Analysis**: Capturing traces, analyzing Largest Contentful Paint (LCP), and measuring page load metrics\n- **Accessibility Auditing**: Running automated accessibility checks and inspecting the accessibility tree\n- **End-to-End Testing**: Automating user interactions including navigation, form filling, and element inspection\n- **WebMCP Tool Execution**: Running custom tools exposed by web pages through the WebMCP protocol\n\n资料来源：[skills/chrome-devtools-cli/SKILL.md](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/skills/chrome-devtools-cli/SKILL.md)\n\n## Architecture Overview\n\nThe system follows a layered architecture with distinct components:\n\n```mermaid\ngraph TD\n    A[CLI / AI Agent] --> B[MCP Server]\n    B --> C[Tool Registry]\n    C --> D[CDP Client]\n    D --> E[Chrome Browser]\n    F[WebMCP Tools] -.-> B\n    G[PageCollector] --> H[Event Listeners]\n    H --> E\n```\n\n### Component Layers\n\n| Layer | Purpose | Key Files |\n|-------|---------|-----------|\n| **MCP Protocol** | Standardized communication interface | `src/McpResponse.ts` |\n| **Tool System** | Tool definitions and schema validation | `src/tools/ToolDefinition.ts` |\n| **CDP Bridge** | Chrome DevTools Protocol communication | `src/PageCollector.ts` |\n| **Skills Layer** | Domain-specific tool groupings | `skills/*/SKILL.md` |\n\n资料来源：[src/McpResponse.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/McpResponse.ts) and [src/PageCollector.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/PageCollector.ts)\n\n## Tool Categories\n\nThe project organizes tools into the following categories:\n\n| Category | Description | Example Tools |\n|----------|-------------|---------------|\n| **Navigation** | Page navigation and management | `navigate_page`, `new_page`, `close_page`, `select_page` |\n| **Inspection** | Page content and state inspection | `take_snapshot`, `take_screenshot`, `evaluate_script` |\n| **Interaction** | User simulation | `type_text`, `press_key`, `fill_form`, `upload_file` |\n| **Performance** | Performance measurement and tracing | `performance_start_trace`, `performance_stop_trace`, `take_memory_snapshot` |\n| **Emulation** | Browser environment simulation | `emulate`, `resize_page` |\n| **Network** | Network request inspection | (Network-related tools) |\n| **Accessibility** | A11y auditing | Lighthouse-based accessibility audits |\n| **WEBMCP** | Dynamic page-exposed tools | `list_webmcp_tools`, `execute_webmcp_tool` |\n\n资料来源：[skills/chrome-devtools-cli/SKILL.md](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/skills/chrome-devtools-cli/SKILL.md)\n\n## Page Management System\n\nThe `PageCollector` class manages multiple browser pages using Chrome's target lifecycle:\n\n```mermaid\ngraph LR\n    A[Browser Instance] -->|targetcreated| B[PageCollector]\n    A -->|targetdestroyed| B\n    B --> C[WeakMap Storage]\n    C --> D[Navigation History]\n    D --> E[Resource Tracking]\n```\n\nKey characteristics:\n- **Multiple Page Support**: Manages several open pages simultaneously\n- **Navigation History**: Stores up to 3 recent navigations per page (`maxNavigationSaved = 3`)\n- **Resource Tracking**: Collects resources per navigation sub-list\n- **Event-Driven**: Listens to Chrome target lifecycle events\n\n资料来源：[src/PageCollector.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/PageCollector.ts)\n\n## Tool Definition System\n\nThe tool system uses TypeScript and Zod for schema validation. Two primary tool types exist:\n\n### Global Tools\n\nTools that operate independently of page context:\n\n```typescript\nexport function defineTool<Schema extends zod.ZodRawShape>(\n  definition: ToolDefinition<Schema>,\n): DefinedTool<Schema>;\n```\n\n### Page-Scoped Tools\n\nTools that require a selected page context:\n\n```typescript\nexport function definePageTool<Schema extends zod.ZodRawShape>(\n  definition: PageToolDefinition<Schema>,\n): DefinedPageTool<Schema>;\n```\n\n#### Page Scope Schema\n\n```typescript\nexport const pageIdSchema = {\n  pageId: zod.number().optional().describe('Targets a specific page by ID.'),\n};\n```\n\n#### Timeout Schema\n\n```typescript\nexport const timeoutSchema = {\n  timeout: zod\n    .number()\n    .int()\n    .optional()\n    .describe(\n      `Maximum wait time in milliseconds. If set to 0, the default timeout will be used.`,\n    ),\n};\n```\n\n资料来源：[src/tools/ToolDefinition.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/tools/ToolDefinition.ts)\n\n## WebMCP Integration\n\nWebMCP enables web pages to expose custom tools that can be discovered and executed by this MCP server. The system provides two tools:\n\n| Tool | Purpose |\n|------|---------|\n| `list_webmcp_tools` | Lists all WebMCP tools the current page exposes |\n| `execute_webmcp_tool` | Executes a named WebMCP tool with optional JSON parameters |\n\n```typescript\nexport const listWebMcpTools = definePageTool({\n  name: 'list_webmcp_tools',\n  description: `Lists all WebMCP tools the page exposes.`,\n  annotations: {\n    category: ToolCategory.WEBMCP,\n    readOnlyHint: true,\n  },\n  schema: {},\n  blockedByDialog: false,\n});\n```\n\n资料来源：[src/tools/webmcp.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/tools/webmcp.ts)\n\n## Navigation Tools\n\nThe project provides comprehensive navigation capabilities:\n\n### Basic Navigation\n\n| Command | Description |\n|---------|-------------|\n| `new_page` | Creates a new page, optionally at a specified URL |\n| `navigate_page` | Navigates the selected page to a URL or performs back/reload |\n| `select_page` | Selects a page as the context for future tool calls |\n| `close_page` | Closes a page by index |\n\n### Navigation Options\n\n```typescript\ninterface NavigationOptions {\n  url?: string;                    // Target URL\n  type?: 'navigate' | 'back' | 'reload';\n  timeout?: number;                // Navigation timeout in ms\n  ignoreCache?: boolean;          // Ignore cache on reload\n  bringToFront?: boolean;         // Bring page to front after selection\n  background?: boolean;            // Create page in background\n  isolatedContext?: string;       // Isolated world context name\n  handleBeforeUnload?: 'accept' | 'dismiss';\n  initScript?: string;             // JavaScript to run after navigation\n}\n```\n\n资料来源：[skills/chrome-devtools-cli/SKILL.md](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/skills/chrome-devtools-cli/SKILL.md)\n\n## Performance Analysis Tools\n\n### Tracing Workflow\n\n```mermaid\ngraph LR\n    A[performance_start_trace] --> B[User Interactions]\n    B --> C[performance_stop_trace]\n    C --> D[Trace Analysis]\n    D --> E[insight_analyze_insight]\n```\n\n### Available Performance Tools\n\n| Tool | Purpose |\n|------|---------|\n| `performance_start_trace` | Starts performance trace recording |\n| `performance_stop_trace` | Stops the active trace |\n| `performance_analyze_insight` | Gets details on specific Performance Insights |\n| `take_memory_snapshot` | Captures memory heapsnapshot |\n\n### LCP Optimization Debugging\n\nThe project includes specialized tools for debugging Largest Contentful Paint issues:\n\n1. **Identify LCP Element**: Extract element tag, id, className, URL, and timing data\n2. **Audit Common Issues**: Check for lazy-loaded images in viewport, missing fetchpriority\n3. **Optimization Strategies**: Preload, fetchpriority, modern formats, critical CSS inlining\n\n资料来源：[skills/debug-optimize-lcp/SKILL.md](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/skills/debug-optimize-lcp/SKILL.md) and [skills/debug-optimize-lcp/references/optimization-strategies.md](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/skills/debug-optimize-lcp/references/optimization-strategies.md)\n\n## Accessibility Debugging Tools\n\n### Core A11y Workflow\n\n```mermaid\ngraph TD\n    A[Lighthouse Audit] --> B{Analyze Score}\n    B -->|Score < 1| C[Review Failed Audits]\n    B -->|Pass| D[Snapshot Tree]\n    C --> D\n    D --> E[Check Semantics]\n    E --> F[Verify Labels]\n    F --> G[Test Keyboard Nav]\n```\n\n### Key Capabilities\n\n- **Automated Audits**: Run Lighthouse accessibility audits with JSON report output\n- **Accessibility Tree Inspection**: Use `take_snapshot` to capture the semantic structure\n- **Semantic Analysis**: Verify heading hierarchy, ARIA landmarks\n- **Label Verification**: Ensure all form inputs have associated labels\n- **Keyboard Navigation**: Test focus management using `press_key` with Tab navigation\n\n资料来源：[skills/a11y-debugging/SKILL.md](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/skills/a11y-debugging/SKILL.md)\n\n## Evaluation Framework\n\nThe project includes a test framework for verifying tool usage correctness:\n\n```typescript\nexport interface TestScenario {\n  prompt: string;           // The prompt to send to the model\n  maxTurns: number;        // Maximum conversation turns\n  htmlRoute?: {            // Optional custom HTML for testing\n    path: string;\n    htmlContent: string;\n  };\n  expectations: (calls: ToolCall[]) => void;  // Validation function\n}\n```\n\n### Example Test Scenarios\n\n| Scenario | Purpose |\n|----------|---------|\n| `snapshot_test.ts` | Verifies navigation followed by snapshot capture |\n| `performance_test.ts` | Verifies navigation followed by trace start |\n| `fill_select_and_checkboxes_test.ts` | Verifies form interaction patterns |\n\n资料来源：[scripts/eval_scenarios/snapshot_test.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/scripts/eval_scenarios/snapshot_test.ts) and [scripts/eval_scenarios/performance_test.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/scripts/eval_scenarios/performance_test.ts)\n\n## Response Format\n\nThe MCP response system supports structured output with multiple content sections:\n\n| Section | Content |\n|---------|---------|\n| `toolDefinitions` | List of available tools with schemas |\n| `webmcpTools` | Page-exposed WebMCP tools |\n| `networkRequests` | Captured network requests (when enabled) |\n| `pagination` | Pagination metadata for large result sets |\n\n```typescript\nstructuredContent.webmcpTools = data.webmcpTools.map(\n  ({name, description, inputSchema, annotations}) => ({\n    name,\n    description,\n    inputSchema,\n    annotations,\n  }),\n);\n```\n\n资料来源：[src/McpResponse.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/McpResponse.ts)\n\n## Build and Development\n\n### Available npm Scripts\n\n| Script | Purpose |\n|--------|---------|\n| `npm run build` | Compile TypeScript and verify build |\n| `npm run test` | Build and run all tests |\n| `npm run test <path>` | Build and run a single test file |\n| `npm run format` | Fix formatting and show linting errors |\n| `npm run gen` | Generate tool reference documentation |\n\n### TypeScript Guidelines\n\nThe project enforces strict TypeScript practices:\n\n- **No `any` type**: Use proper generics and unknown types\n- **No `as` keyword**: Use type guards and type predicates\n- **No `!` operator**: Use explicit null checks\n- **No `// @ts-ignore`**: Fix actual type issues\n- **Prefer `for..of`**: Over `forEach` for better type inference\n\n资料来源：[AGENTS.md](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/AGENTS.md)\n\n## Installation\n\nThe CLI can be installed globally via npm:\n\n```bash\nnpm i chrome-devtools-mcp@latest -g\nchrome-devtools status  # Verify installation\n```\n\nTroubleshooting tips include ensuring the global npm `bin` directory is in PATH and avoiding `sudo` by using node version managers.\n\n资料来源：[skills/chrome-devtools-cli/references/installation.md](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/skills/chrome-devtools-cli/references/installation.md)\n\n## Summary\n\nThe chrome-devtools-mcp project provides a powerful bridge between AI assistants and Chrome DevTools, enabling programmatic browser control through a well-structured MCP interface. Its comprehensive tool system covers navigation, inspection, interaction, performance analysis, and accessibility auditing, while the WebMCP integration allows dynamic tool exposure from web pages. The TypeScript-based architecture with Zod schema validation ensures type safety and developer productivity, making it suitable for both automated testing and AI-driven browser interactions.\n\n---\n\n<a id='installation'></a>\n\n## Installation and Setup\n\n### 相关页面\n\n相关主题：[Project Overview](#overview), [Configuration Reference](#configuration)\n\n<details>\n<summary>相关源码文件</summary>\n\n以下源码文件用于生成本页说明：\n\n- [AGENTS.md](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/AGENTS.md)\n- [CONTRIBUTING.md](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/CONTRIBUTING.md)\n- [skills/chrome-devtools-cli/references/installation.md](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/skills/chrome-devtools-cli/references/installation.md)\n- [skills/chrome-devtools-cli/SKILL.md](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/skills/chrome-devtools-cli/SKILL.md)\n- [package.json](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/package.json)\n</details>\n\n# Installation and Setup\n\nThis page covers all methods for installing and configuring the **chrome-devtools-mcp** project, including global CLI usage, local development setup, and MCP server integration.\n\n## Overview\n\nThe chrome-devtools-mcp project provides two primary interfaces:\n\n1. **CLI Tool** (`chrome-devtools`) - A command-line interface for terminal-based browser automation\n2. **MCP Server** - A Model Context Protocol server for integrating Chrome DevTools into AI assistants\n\nThe installation approach depends on your use case:\n\n| Use Case | Recommended Method | Installation Command |\n|----------|-------------------|---------------------|\n| Terminal automation | Global CLI | `npm i chrome-devtools-mcp@latest -g` |\n| AI assistant integration | MCP Server | Clone and build from source |\n| Development contribution | Local development | Clone, install dependencies, build |\n\n资料来源：[skills/chrome-devtools-cli/references/installation.md:1-5]()\n\n## Prerequisites\n\n### Node.js Version Requirement\n\nThe project requires a specific Node.js version defined in `.nvmrc`. Before installation, ensure you have the correct version:\n\n```bash\n# Check the required Node.js version\ncat .nvmrc\n```\n\nUsing a Node version manager (such as nvm) is strongly recommended to avoid permission errors and manage multiple Node versions.\n\n资料来源：[CONTRIBUTING.md:31-35]()\n\n### System Requirements\n\n- **Operating System**: macOS, Linux, or Windows with WSL\n- **Chrome/Chromium**: Chrome browser must be installed on the system\n- **npm**: Node Package Manager (included with Node.js)\n- **Optional**: ffmpeg (required only for experimental screencast feature)\n\n## Method 1: Global CLI Installation\n\n### Installation\n\nInstall the package globally to make the `chrome-devtools` command available system-wide:\n\n```bash\nnpm i chrome-devtools-mcp@latest -g\n```\n\n资料来源：[skills/chrome-devtools-cli/references/installation.md:5]()\n\n### Verification\n\nAfter installation, verify the setup:\n\n```bash\nchrome-devtools status\n```\n\nA successful output indicates the CLI is properly installed and accessible.\n\n资料来源：[skills/chrome-devtools-cli/references/installation.md:7]()\n\n## Method 2: Local Development Setup\n\nFor contributing to the project or running the latest development version:\n\n### Workflow Diagram\n\n```mermaid\ngraph TD\n    A[Clone Repository] --> B[Check Node.js Version]\n    B --> C{nvm installed?}\n    C -->|No| D[Install nvm]\n    C -->|Yes| E[Run nvm use]\n    D --> E\n    E --> F[Run npm ci]\n    F --> G[Run npm run build]\n    G --> H[Verify with npm run test]\n    H --> I[Setup Complete]\n```\n\n### Step-by-Step Instructions\n\n#### 1. Clone the Repository\n\n```bash\ngit clone https://github.com/ChromeDevTools/chrome-devtools-mcp.git\ncd chrome-devtools-mcp\n```\n\n资料来源：[CONTRIBUTING.md:33-36]()\n\n#### 2. Set Node.js Version\n\n```bash\nnvm use\n```\n\nThis reads the version from `.nvmrc` and switches to the correct Node.js version.\n\n#### 3. Install Dependencies\n\n```bash\nnpm ci\n```\n\nThe `npm ci` command performs a clean install using the exact versions from `package-lock.json`, ensuring consistency across environments.\n\n资料来源：[CONTRIBUTING.md:36]()\n\n#### 4. Build the Project\n\n```bash\nnpm run build\n```\n\nThis command runs TypeScript compilation (`tsc`) and verifies the build succeeds. The build output is placed in the `build/` directory.\n\n资料来源：[AGENTS.md:5]()\n\n### Available npm Scripts\n\n| Script | Purpose |\n|--------|---------|\n| `npm run build` | Compile TypeScript and test build |\n| `npm run test` | Build and run all tests |\n| `npm run test <path>` | Build and run a single test file |\n| `npm run format` | Fix formatting and show linting errors |\n\n资料来源：[AGENTS.md:5-10]()\n\n## Method 3: MCP Server Configuration\n\nFor integrating with AI assistants that support the Model Context Protocol.\n\n### Configuration Schema\n\n```json\n{\n  \"mcpServers\": {\n    \"chrome-devtools\": {\n      \"command\": \"node\",\n      \"args\": [\"/path-to/build/src/bin/chrome-devtools-mcp.js\"]\n    }\n  }\n}\n```\n\n资料来源：[CONTRIBUTING.md:45-51]()\n\n### MCP Server Binary Location\n\nAfter building, the MCP server executable is located at:\n\n```\nbuild/src/bin/chrome-devtools-mcp.js\n```\n\n### Using with Inspector\n\nTest the MCP server using the official inspector:\n\n```bash\nnpx @modelcontextprotocol/inspector node /build/src/bin/chrome-devtools-mcp.js\n```\n\n资料来源：[CONTRIBUTING.md:40-43]()\n\n### VS Code SSH Configuration\n\nWhen running the inspector with VS Code SSH, two ports are spawned:\n\n| Port | Purpose |\n|------|---------|\n| 6274 | Primary service (auto-forwarded by VS Code) |\n| 6277 | Secondary service (requires manual forwarding) |\n\nManual port forwarding may be required for port 6277.\n\n资料来源：[CONTRIBUTING.md:54-58]()\n\n## Service Management\n\nThe CLI includes service management commands:\n\n```bash\nchrome-devtools start   # Start or restart chrome-devtools-mcp\nchrome-devtools status  # Check if chrome-devtools-mcp is running\nchrome-devtools stop    # Stop chrome-devtools-mcp if running\n```\n\n资料来源：[skills/chrome-devtools-cli/SKILL.md:67-70]()\n\nFor AI workflows, the background server starts implicitly on first tool call—do not manually run `start`/`status`/`stop` before each use.\n\n## CLI Arguments and Configuration\n\nConfigure the MCP server behavior using CLI arguments in your MCP configuration:\n\n```bash\nnpx chrome-devtools-mcp@latest --help\n```\n\n### Common Configuration Flags\n\n| Flag | Description | Example |\n|------|-------------|---------|\n| `--categoryExtensions` | Enable Chrome extension support | `--categoryExtensions` |\n| `--experimentalVision` | Enable experimental vision tools | `--experimentalVision=true` |\n| `--experimentalScreencast` | Enable screencast (requires ffmpeg) | `--experimentalScreencast=true` |\n| `--categoryExperimentalWebmcp` | Enable experimental WebMCP tools | `--categoryExperimentalWebmcp=true` |\n\n资料来源：[skills/chrome-devtools-cli/SKILL.md:1-3]()\n\n## TypeScript Development Guidelines\n\nWhen developing or contributing to this project, adhere to strict TypeScript rules:\n\n| Rule | Description |\n|------|-------------|\n| No `any` type | Use explicit types |\n| No `as` keyword | Use type guards or proper casting |\n| No `!` operator | Avoid non-null assertions |\n| No `@ts-ignore` | Fix actual type errors |\n| Prefer `for..of` | Over `forEach` |\n\n资料来源：[AGENTS.md:13-20]()\n\n## Troubleshooting\n\n### Command Not Found\n\nIf `chrome-devtools` is not recognized after installation:\n\n1. Ensure your global npm `bin` directory is in your system's `PATH`\n2. Restart your terminal or source your shell configuration file (e.g., `.bashrc`, `.zshrc`)\n\n资料来源：[skills/chrome-devtools-cli/references/installation.md:11-13]()\n\n### Permission Errors\n\nIf you encounter `EACCES` or permission errors during installation:\n\n- **Do not** use `sudo`\n- Use a node version manager like `nvm`\n- Or configure npm to use a different global directory\n\n资料来源：[skills/chrome-devtools-cli/references/installation.md:16-19]()\n\n### Old Version Running\n\nIf an outdated version is running:\n\n```bash\nchrome-devtools stop && npm uninstall -g chrome-devtools-mcp\nnpm i chrome-devtools-mcp@latest -g\n```\n\n资料来源：[skills/chrome-devtools-cli/references/installation.md:22-25]()\n\n### Debug Logging\n\nTo write debug logs to `log.txt` in the working directory, see the debugging section in CONTRIBUTING.md.\n\n资料来源：[CONTRIBUTING.md:62-63]()\n\n## Lighthouse Dependency Updates\n\nThe project bundles Lighthouse for performance auditing. To update the Lighthouse dependency:\n\n1. Update the Lighthouse version in `package.json`\n2. Run `npm install`\n3. Check out the corresponding Lighthouse repository revision to a sibling directory (`../lighthouse`)\n4. Run `npm run update-lighthouse` (requires yarn)\n5. Commit the bundle\n\n资料来源：[CONTRIBUTING.md:24-29]()\n\n## Quick Reference\n\n```bash\n# Global CLI installation\nnpm i chrome-devtools-mcp@latest -g\n\n# Verify installation\nchrome-devtools status\n\n# Development setup\ngit clone https://github.com/ChromeDevTools/chrome-devtools-mcp.git\ncd chrome-devtools-mcp\nnvm use\nnpm ci\nnpm run build\nnpm run test\n\n# MCP server configuration\n{\n  \"mcpServers\": {\n    \"chrome-devtools\": {\n      \"command\": \"node\",\n      \"args\": [\"/path-to/build/src/bin/chrome-devtools-mcp.js\"]\n    }\n  }\n}\n\n---\n\n<a id='configuration'></a>\n\n## Configuration Reference\n\n### 相关页面\n\n相关主题：[Installation and Setup](#installation), [CLI Reference](#cli-reference), [MCP Protocol Integration](#mcp-protocol)\n\n<details>\n<summary>相关源码文件</summary>\n\n以下源码文件用于生成本页说明：\n\n- [src/bin/chrome-devtools-mcp-cli-options.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/bin/chrome-devtools-mcp-cli-options.ts)\n- [src/bin/chrome-devtools-mcp-main.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/bin/chrome-devtools-mcp-main.ts)\n- [puppeteer.config.cjs](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/puppeteer.config.cjs)\n- [.mcp.json](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/.mcp.json)\n</details>\n\n# Configuration Reference\n\nThis page documents all configuration options available for the `chrome-devtools-mcp` project, covering CLI arguments, MCP server initialization, Puppeteer browser settings, and MCP client configuration files.\n\n## Overview\n\nThe `chrome-devtools-mcp` project supports multiple layers of configuration:\n\n1. **CLI Arguments** - Command-line flags passed when starting the MCP server or CLI\n2. **Puppeteer Configuration** - Browser launch and connection settings\n3. **MCP Client Configuration** - JSON configuration for connecting MCP clients\n\nConfiguration flows through the application as follows:\n\n```mermaid\ngraph TD\n    A[CLI Arguments] --> B[chrome-devtools-mcp-cli-options.ts]\n    B --> C[ParsedArguments Type]\n    C --> D[chrome-devtools-mcp-main.ts]\n    D --> E[Puppeteer Launch]\n    F[.mcp.json] --> G[MCP Client]\n    G --> H[MCP Server Connection]\n```\n\n## CLI Configuration\n\nThe MCP server accepts numerous command-line arguments for customization. These are defined in `src/bin/chrome-devtools-mcp-cli-options.ts` and typed via the `ParsedArguments` interface.\n\n### General Options\n\n| Option | Type | Default | Description |\n|--------|------|---------|-------------|\n| `--port` | `number` | `6274` | Port for the MCP server to listen on |\n| `--host` | `string` | `\"127.0.0.1\"` | Host address to bind |\n| `--log-file` | `string` | `undefined` | Path to write debug logs |\n| `--help` | `boolean` | `false` | Show help message |\n\n资料来源：[src/bin/chrome-devtools-mcp-cli-options.ts](src/bin/chrome-devtools-mcp-cli-options.ts)\n\n### Browser Connection Options\n\n| Option | Type | Default | Description |\n|--------|------|---------|-------------|\n| `--browserUrl` | `string` | `undefined` | Connect to an existing Chrome instance at this URL |\n| `--autoConnect` | `boolean` | `true` | Automatically connect to existing Chrome |\n| `--browserPath` | `string` | `undefined` | Custom path to Chrome executable |\n| `--userDataDir` | `string` | `undefined` | Chrome profile directory path |\n\n资料来源：[src/bin/chrome-devtools-mcp-cli-options.ts](src/bin/chrome-devtools-mcp-cli-options.ts)\n\n### Browser Launch Options\n\n| Option | Type | Default | Description |\n|--------|------|---------|-------------|\n| `--headless` | `boolean` | `true` | Run Chrome in headless mode |\n| `--sandbox` | `boolean` | `true` | Enable Chrome sandbox mode |\n| `--noFirstRun` | `boolean` | `true` | Skip first-run dialogs |\n| `--windowSize` | `string` | `\"1920x1080\"` | Default window dimensions |\n\n资料来源：[src/bin/chrome-devtools-mcp-cli-options.ts](src/bin/chrome-devtools-mcp-cli-options.ts)\n\n### MCP Server Categories\n\nThe MCP server organizes tools into categories. Categories can be enabled or disabled using `--category*` flags:\n\n| Option | Type | Default | Description |\n|--------|------|---------|-------------|\n| `--categoryNavigation` | `boolean` | `true` | Navigation tools (navigate_page, new_page) |\n| `--categoryInteraction` | `boolean` | `true` | Interaction tools (click, fill, type) |\n| `--categoryInspection` | `boolean` | `true` | Inspection tools (take_snapshot, take_screenshot) |\n| `--categoryPerformance` | `boolean` | `true` | Performance tools (traces, profiles) |\n| `--categoryNetwork` | `boolean` | `true` | Network tools (network_interceptor) |\n| `--categoryExtensions` | `boolean` | `false` | Chrome extension management |\n| `--categoryExperimental` | `boolean` | `false` | Experimental tools |\n| `--categoryExperimentalWebmcp` | `boolean` | `false` | WebMCP integration tools |\n| `--categoryDebugging` | `boolean` | `false` | Debugging utilities |\n\n```bash\n# Enable extension support\nchrome-devtools-mcp --categoryExtensions=true\n\n# Enable experimental features\nchrome-devtools-mcp --categoryExperimental=true --experimentalVision=true\n```\n\n资料来源：[src/tools/categories.ts](src/tools/categories.ts) 资料来源：[skills/chrome-devtools/SKILL.md](skills/chrome-devtools/SKILL.md)\n\n### Experimental Features\n\nExperimental features require explicit enabling via CLI flags:\n\n| Option | Type | Default | Description |\n|--------|------|---------|-------------|\n| `--experimentalVision` | `boolean` | `false` | Enable coordinate-based clicking (click_at) |\n| `--experimentalScreencast` | `boolean` | `false` | Enable screencast recording |\n\n```bash\n# Start with experimental vision mode\nchrome-devtools-mcp --experimentalVision=true\n```\n\n资料来源：[skills/chrome-devtools-cli/SKILL.md](skills/chrome-devtools-cli/SKILL.md)\n\n### Debugging Options\n\n| Option | Type | Default | Description |\n|--------|------|---------|-------------|\n| `--verbose` | `boolean` | `false` | Enable verbose logging |\n| `DEBUG` | `env` | `undefined` | Debug categories filter |\n\n```sh\n# Run with debug logging to log.txt\nnpx @modelcontextprotocol/inspector node /build/src/bin/chrome-devtools-mcp.js --log-file=/path/to/log.txt\n```\n\n资料来源：[CONTRIBUTING.md](CONTRIBUTING.md)\n\n## Puppeteer Configuration\n\nThe project uses Puppeteer for browser automation. Configuration is defined in `puppeteer.config.cjs` and can be overridden via CLI arguments.\n\n### Configuration File Structure\n\n```javascript\n// puppeteer.config.cjs\nmodule.exports = {\n  puppeteer: {\n    // Browser launch arguments\n    args: [\n      '--no-sandbox',\n      '--disable-setuid-sandbox',\n      '--disable-dev-shm-usage',\n    ],\n    // Default launch settings\n    headless: true,\n  }\n};\n```\n\n### Default Browser Arguments\n\nThe following Chromium arguments are passed by default:\n\n| Argument | Purpose |\n|----------|---------|\n| `--no-sandbox` | Disable sandbox (may be overridden by `--sandbox`) |\n| `--disable-setuid-sandbox` | Prevent setuid complications |\n| `--disable-dev-shm-usage` | Avoid shared memory issues in containers |\n| `--disable-web-security` | Disable web security for testing |\n| `--ash-no-nudges` | Disable Ash nudges |\n\n### Connection Modes\n\nThe MCP server supports two browser connection modes:\n\n```mermaid\ngraph TD\n    A[Start chrome-devtools-mcp] --> B{--browserUrl provided?}\n    B -->|Yes| C[Remote Connection Mode]\n    B -->|No| D[Launch Mode]\n    D --> E{--userDataDir provided?}\n    E -->|Yes| F[Use existing profile]\n    E -->|No| G[Create temporary profile]\n    C --> H[Connect via CDP WebSocket]\n    F --> I[Puppeteer.launch]\n    G --> I\n```\n\n1. **Launch Mode** (default): Puppeteer launches a new Chrome instance\n2. **Remote Connection Mode**: Connect to an existing Chrome via `--browserUrl`\n\n资料来源：[src/bin/chrome-devtools-mcp-main.ts](src/bin/chrome-devtools-mcp-main.ts)\n\n## MCP Client Configuration\n\nThe `.mcp.json` file provides configuration for MCP clients connecting to the server.\n\n### Example Configuration\n\n```json\n{\n  \"mcpServers\": {\n    \"chrome-devtools\": {\n      \"command\": \"npx\",\n      \"args\": [\"chrome-devtools-mcp@latest\"],\n      \"env\": {}\n    }\n  }\n}\n```\n\n### Extended Configuration Example\n\n```json\n{\n  \"mcpServers\": {\n    \"chrome-devtools\": {\n      \"command\": \"node\",\n      \"args\": [\n        \"/path/to/chrome-devtools-mcp/build/src/bin/chrome-devtools-mcp.js\",\n        \"--port\", \"6274\",\n        \"--headless\", \"false\",\n        \"--categoryExtensions\", \"true\"\n      ],\n      \"env\": {}\n    }\n  }\n}\n```\n\n### Configuration for Remote Connection\n\nTo connect to a specific Chrome instance:\n\n```json\n{\n  \"mcpServers\": {\n    \"chrome-devtools\": {\n      \"command\": \"npx\",\n      \"args\": [\n        \"chrome-devtools-mcp@latest\",\n        \"--browserUrl\", \"http://localhost:9222\",\n        \"--autoConnect\", \"true\"\n      ]\n    }\n  }\n}\n```\n\n资料来源：[.mcp.json](.mcp.json)\n\n## Tool Categories and Annotations\n\nTools are annotated with metadata that affects their availability based on configuration:\n\n### Category Reference\n\n| Category | Flag | Description |\n|----------|------|-------------|\n| `NAVIGATION` | `--categoryNavigation` | Page navigation and management |\n| `INTERACTION` | `--categoryInteraction` | User interaction (clicks, fills) |\n| `INSPECTION` | `--categoryInspection` | Page inspection (snapshots, screenshots) |\n| `PERFORMANCE` | `--categoryPerformance` | Performance profiling |\n| `NETWORK` | `--categoryNetwork` | Network request handling |\n| `EXTENSIONS` | `--categoryExtensions` | Chrome extension management |\n| `EXPERIMENTAL` | `--categoryExperimental` | Experimental tools |\n| `EXPERIMENTAL_WEBMCP` | `--categoryExperimentalWebmcp` | WebMCP integration |\n| `DEBUGGING` | `--categoryDebugging` | Debug utilities |\n\n### Tool Annotation Schema\n\n```typescript\ninterface ToolAnnotation {\n  title?: string;\n  category?: ToolCategory;\n  conditions?: string[];  // Required flags for tool availability\n  readOnlyHint?: boolean; // Indicates if tool modifies browser state\n}\n```\n\nTools marked with `readOnlyHint: false` may be blocked in read-only MCP modes.\n\n```mermaid\ngraph LR\n    A[Tool Annotation] --> B[readOnlyHint]\n    A --> C[category]\n    A --> D[conditions]\n    B --> E{Client Mode}\n    C --> F[Category Filter]\n    D --> G[Flag Check]\n    E -->|Plan/ReadOnly| H[Only readOnlyHint=true]\n    E -->|Normal| I[All tools]\n```\n\n资料来源：[src/tools/ToolDefinition.ts](src/tools/ToolDefinition.ts) 资料来源：[skills/troubleshooting/SKILL.md](skills/troubleshooting/SKILL.md)\n\n## Environment Variables\n\n| Variable | Description |\n|----------|-------------|\n| `DEBUG` | Controls debug logging categories (e.g., `DEBUG=*`) |\n| `PUPPETEER_SKIP_DOWNLOAD` | Skip Puppeteer browser download |\n| `PUPPETEER_EXECUTABLE_PATH` | Custom Chrome executable path |\n\n## Configuration Precedence\n\nConfiguration values are resolved in the following order (highest to lowest):\n\n1. **CLI Arguments** - Explicit flags passed at runtime\n2. **Environment Variables** - Set in shell or `.env` files\n3. **Configuration Files** - `.mcp.json`, `puppeteer.config.cjs`\n4. **Default Values** - Built-in defaults in source code\n\n```mermaid\ngraph TD\n    A[Configuration Resolution] --> B[CLI Arguments]\n    A --> C[Environment Variables]\n    A --> D[Config Files]\n    A --> E[Defaults]\n    B --> F[Final Config]\n    C --> F\n    D --> F\n    E --> F\n    style B fill:#ff9999\n    style F fill:#99ff99\n```\n\n## Quick Reference\n\n### Minimal Configuration\n\n```bash\n# Default settings (headless, localhost:6274)\nnpx chrome-devtools-mcp@latest\n```\n\n### Common Configurations\n\n```bash\n# Visible browser with extensions\nchrome-devtools-mcp --headless=false --categoryExtensions=true\n\n# Remote Chrome connection\nchrome-devtools-mcp --browserUrl=http://localhost:9222\n\n# Custom port\nchrome-devtools-mcp --port=9000\n```\n\n## Troubleshooting Configuration Issues\n\n| Symptom | Likely Cause | Solution |\n|---------|--------------|----------|\n| Only 9 tools available | Read-only mode enforced by MCP client | Disable read-only/Plan mode in client |\n| Extension tools missing | `--categoryExtensions` not enabled | Add `--categoryExtensions=true` |\n| New profile created instead of connecting | Incorrect `--browserUrl` or typo in flags | Verify URL and check for flag typos like `--autoBronnect` |\n| `chrome-devtools` command not found | PATH not configured | Ensure npm global bin is in PATH |\n\n资料来源：[skills/troubleshooting/SKILL.md](skills/troubleshooting/SKILL.md)\n\n---\n\n<a id='system-architecture'></a>\n\n## System Architecture\n\n### 相关页面\n\n相关主题：[Project Overview](#overview), [MCP Protocol Integration](#mcp-protocol), [Telemetry and Monitoring](#telemetry)\n\n<details>\n<summary>Relevant Source Files</summary>\n\n以下源码文件用于生成本页说明：\n\n- [src/tools/ToolDefinition.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/tools/ToolDefinition.ts)\n- [src/PageCollector.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/PageCollector.ts)\n- [src/tools/webmcp.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/tools/webmcp.ts)\n- [src/tools/categories.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/tools/categories.ts)\n- [src/browser.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/browser.ts)\n- [AGENTS.md](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/AGENTS.md)\n</details>\n\n# System Architecture\n\n## Overview\n\nThe `chrome-devtools-mcp` project implements a Model Context Protocol (MCP) server that provides programmatic control over Chrome DevTools through a well-defined architecture of interconnected components. The system enables AI assistants and CLI tools to interact with a headless Chrome browser instance by exposing browser operations as typed tools with schema validation.\n\nThe architecture follows a layered design pattern with clear separation between the protocol layer (MCP), the tool definition system, browser management, and page-level interactions. This modular approach allows for extensibility while maintaining type safety and consistent behavior across all exposed functionality.\n\n资料来源：[AGENTS.md]()\n\n## High-Level Architecture\n\n```mermaid\ngraph TD\n    subgraph \"Client Layer\"\n        CLI[CLI Tool<br>chrome-devtools]\n        AI[AI Assistant<br>MCP Client]\n    end\n\n    subgraph \"MCP Protocol Layer\"\n        MCP[MCP Server<br>Protocol Handler]\n        TDEF[Tool Definitions<br>Registry]\n    end\n\n    subgraph \"Tool System\"\n        PAGES[Page Tools<br>Context-Aware]\n        GLOB[Global Tools<br>Browser-Level]\n    end\n\n    subgraph \"Browser Layer\"\n        CHROME[Chrome Browser<br>Puppeteer/CDP]\n        PAGES_BROWSER[Pages<br>Target Management]\n    end\n\n    CLI --> MCP\n    AI --> MCP\n    MCP --> TDEF\n    TDEF --> PAGES\n    TDEF --> GLOB\n    MCP --> CHROME\n    CHROME --> PAGES_BROWSER\n```\n\n## Core Components\n\n### 1. Tool Definition System\n\nThe tool definition system is the foundation of the MCP server's extensibility. It provides factory functions for creating both page-scoped and global tools with automatic schema validation.\n\n| Component | File | Purpose |\n|-----------|------|---------|\n| `defineTool` | `src/tools/ToolDefinition.ts:11-30` | Factory for global tools |\n| `definePageTool` | `src/tools/ToolDefinition.ts:52-90` | Factory for page-scoped tools |\n| `ToolCategory` | `src/tools/categories.ts` | Tool categorization enum |\n\nThe `defineTool` function supports two invocation patterns:\n\n```typescript\n// Direct tool definition\ndefineTool({\n  name: 'tool_name',\n  schema: { /* zod schema */ },\n  handler: async (request, response, context) => { /* ... */ }\n});\n\n// Factory pattern with arguments\ndefineTool((args?: Args) => ({\n  name: 'tool_name',\n  schema: { /* zod schema using args */ },\n  handler: async (request, response, context) => { /* ... */ }\n}));\n```\n\n资料来源：[src/tools/ToolDefinition.ts:11-30]()\n\n### 2. Page Scoped Tools\n\nPage-scoped tools are tools that operate within the context of a specific browser page. They receive an additional `page` property in the request object and have access to the page's DOM, JavaScript context, and rendering state.\n\n```typescript\nexport function definePageTool<\n  Schema extends zod.ZodRawShape,\n  Args extends ParsedArguments = ParsedArguments,\n>(\n  definition:\n    | PageToolDefinition<Schema>\n    | ((args?: Args) => PageToolDefinition<Schema>),\n): DefinedPageTool<Schema> | ((args?: Args) => DefinedPageTool<Schema>)\n```\n\nThe returned tool automatically receives the `pageScoped: true` marker, which the MCP server uses to route requests appropriately. Each page-scoped tool handler receives:\n\n- `request`: Contains both the parsed schema arguments and `{ page: ContextPage }`\n- `response`: Response object for sending results back to the client\n- `context`: Full context object with browser and session information\n\n资料来源：[src/tools/ToolDefinition.ts:52-90]()\n\n### 3. Page Collector Pattern\n\nThe `PageCollector` class manages the lifecycle of browser pages and collects events/data from them. It implements the observer pattern for tracking page creation and destruction.\n\n```mermaid\ngraph TD\n    subgraph \"PageCollector Lifecycle\"\n        INIT[init(pages: Page[])]\n        ADD[addPage(page)]\n        LISTEN[Start Event Listeners]\n    end\n\n    subgraph \"Event Handling\"\n        CREATED[targetcreated<br>Event]\n        DESTROYED[targetdestroyed<br>Event]\n    end\n\n    subgraph \"Storage\"\n        STORAGE[(WeakMap&lt;Page,<br>Array&lt;Array&lt;WithSymbolId&lt;T&gt;&gt;&gt;&gt;)]\n    end\n\n    INIT --> ADD\n    ADD --> LISTEN\n    CREATED --> ADD\n    LISTEN --> STORAGE\n```\n\nKey characteristics of the `PageCollector`:\n\n| Property | Description |\n|----------|-------------|\n| `#browser` | Reference to the Puppeteer Browser instance |\n| `#listenersInitializer` | Factory function for creating event listeners |\n| `#listeners` | WeakMap tracking active listeners per page |\n| `maxNavigationSaved` | Maximum navigations to retain (default: 3) |\n| `storage` | WeakMap storing collected data per page |\n\n资料来源：[src/PageCollector.ts]()\n\n### 4. Browser Management\n\nThe browser module (`src/browser.ts`) handles the initialization and lifecycle of the Puppeteer-based Chrome browser instance. It provides the foundation for all page operations and CDP (Chrome DevTools Protocol) interactions.\n\nThe browser layer is responsible for:\n\n- Launching headless Chrome with appropriate flags\n- Managing browser context and isolated worlds\n- Coordinating page creation and destruction\n- Providing access to CDP sessions for advanced operations\n\n资料来源：[src/browser.ts]()\n\n### 5. WebMCP Tool System\n\nThe WebMCP system allows pages to expose their own tools to the MCP server, enabling dynamic tool discovery and execution from web applications.\n\n```mermaid\ngraph LR\n    WEB[Web Application<br>Exposes Tools]\n    MCP[MCP Server]\n    EXEC[execute_webmcp_tool]\n    LIST[list_webmcp_tools]\n\n    WEB --> LIST\n    LIST --> WEB\n    WEB --> EXEC\n    EXEC --> WEB\n```\n\nTwo primary tools manage WebMCP functionality:\n\n| Tool | Purpose |\n|------|---------|\n| `list_webmcp_tools` | Enumerates all WebMCP tools exposed by the current page |\n| `execute_webmcp_tool` | Invokes a named WebMCP tool with optional parameters |\n\n```typescript\nexport const listWebMcpTools = definePageTool({\n  name: 'list_webmcp_tools',\n  description: `Lists all WebMCP tools the page exposes.`,\n  annotations: {\n    category: ToolCategory.WEBMCP,\n    readOnlyHint: true,\n  },\n  schema: {},\n  blockedByDialog: false,\n  handler: async (_request, response, _context) => {\n    response.setListWebMcpTools();\n  },\n});\n```\n\n资料来源：[src/tools/webmcp.ts]()\n\n## Tool Categories\n\nTools are organized into categories for logical grouping and documentation purposes. The category system enables documentation generation and tool discovery.\n\n| Category | Description |\n|----------|-------------|\n| `WEBMCP` | Tools exposed by web pages themselves |\n| Navigation | Page navigation and history operations |\n| Input | Form filling, clicking, keyboard input |\n| Capture | Screenshots, snapshots, memory profiling |\n| Network | Network request inspection and manipulation |\n| Performance | Tracing, profiling, performance insights |\n\n资料来源：[src/tools/categories.ts]()\n\n## Request/Response Flow\n\n```mermaid\nsequenceDiagram\n    participant Client\n    participant MCP as MCP Server\n    participant TDEF as Tool Definitions\n    participant HANDLER as Tool Handler\n    participant BROWSER as Browser/Page\n\n    Client->>MCP: Tool Request (with args)\n    MCP->>TDEF: Lookup Tool Definition\n    TDEF-->>MCP: Schema + Handler Reference\n    MCP->>MCP: Validate Arguments (Zod)\n    MCP->>HANDLER: Invoke Handler(request, response, context)\n    HANDLER->>BROWSER: CDP Commands / Puppeteer API\n    BROWSER-->>HANDLER: Result\n    HANDLER-->>MCP: Update Response\n    MCP-->>Client: JSON-RPC Response\n```\n\n## Tool Schema System\n\nAll tool parameters are validated using Zod schemas, ensuring type safety and providing automatic OpenAPI-style documentation.\n\n```typescript\n// Schema definition example\nschema: {\n  toolName: zod.string().describe('The name of the WebMCP tool to execute'),\n  input: zod\n    .string()\n    .optional()\n    .describe('The JSON-stringified parameters to pass to the WebMCP tool'),\n}\n```\n\nThe schema system supports:\n\n- **Required/Optional detection**: Automatically determines if fields are required based on Zod type\n- **Type transformations**: Applied via `.transform()` for input normalization\n- **Descriptions**: Extracted for documentation generation\n- **Enumerations**: Validated against allowed values\n\nCommon schema utilities include:\n\n| Schema | File | Purpose |\n|--------|------|---------|\n| `pageIdSchema` | `ToolDefinition.ts:95-97` | Optional page targeting |\n| `timeoutSchema` | `ToolDefinition.ts:99-107` | Timeout with zero-to-undefined transform |\n| `viewportTransform` | `ToolDefinition.ts` | Viewport dimension parsing |\n\n资料来源：[src/tools/ToolDefinition.ts:95-107]()\n\n## Error Handling Patterns\n\nThe architecture defines specific error constants for expected failure conditions:\n\n```typescript\nexport const CLOSE_PAGE_ERROR =\n  'The last open page cannot be closed. It is fine to keep it open.';\n```\n\nThis error message indicates that the MCP server intentionally allows users to keep the final browser page open rather than forcing closure, which is a deliberate UX decision for browser automation workflows.\n\n## Type Safety Guarantees\n\nThe codebase enforces strict TypeScript practices to maintain type safety:\n\n| Rule | Rationale |\n|------|-----------|\n| No `any` type | Prevents untyped data flow |\n| No `as` casting | Avoids bypass of type checking |\n| No `!` assertions | Prevents unsafe assumptions |\n| No `// @ts-ignore` | Maintains full type coverage |\n| Prefer `for..of` over `forEach` | Better async/await compatibility |\n\n资料来源：[AGENTS.md]()\n\n## Build and Test Infrastructure\n\n```mermaid\ngraph LR\n    subgraph \"Build Commands\"\n        BUILD[npm run build<br>tsc compilation]\n        TEST[npm run test<br>Build + Run Tests]\n        FORMAT[npm run format<br>Fix linting]\n        GEN[npm run gen<br>Generate Docs]\n    end\n\n    subgraph \"Output Artifacts\"\n        JS[JavaScript<br>/build/src]\n        TYPES[Type Declarations<br>/build/src]\n        DOCS[Markdown Docs<br>/skills/*]\n    end\n\n    BUILD --> JS\n    BUILD --> TYPES\n    TEST --> JS\n    GEN --> DOCS\n```\n\nThe project uses a standardized build pipeline that ensures type correctness at compile time and provides consistent tooling for development tasks.\n\n## Summary\n\nThe chrome-devtools-mcp system architecture provides:\n\n1. **Extensible Tool System**: Factory functions for creating typed, validated tools\n2. **Page Context Awareness**: Automatic injection of page context into tool handlers\n3. **Event-Driven Page Management**: Observer pattern for tracking browser page lifecycle\n4. **Schema Validation**: Zod-based runtime validation with compile-time type inference\n5. **WebMCP Integration**: Bidirectional tool exposure between server and web pages\n6. **Strict Type Safety**: No escape hatches for type checking, ensuring reliability\n\nThis architecture enables reliable browser automation while maintaining the flexibility needed for diverse use cases ranging from simple navigation to complex performance profiling and accessibility debugging.\n\n---\n\n<a id='mcp-protocol'></a>\n\n## MCP Protocol Integration\n\n### 相关页面\n\n相关主题：[System Architecture](#system-architecture), [Input and Navigation Automation Tools](#automation-tools), [Debugging and Inspection Tools](#debugging-tools)\n\n<details>\n<summary>Relevant Source Files</summary>\n\n以下源码文件用于生成本页说明：\n\n- [src/index.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/index.ts)\n- [src/McpResponse.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/McpResponse.ts)\n- [src/tools/ToolDefinition.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/tools/ToolDefinition.ts)\n- [src/tools/webmcp.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/tools/webmcp.ts)\n- [src/tools/categories.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/tools/categories.ts)\n- [scripts/generate-docs.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/scripts/generate-docs.ts)\n</details>\n\n# MCP Protocol Integration\n\n## Overview\n\nThe `chrome-devtools-mcp` project implements a Model Context Protocol (MCP) server that enables AI assistants and MCP clients to interact with Chrome DevTools programmatically. This integration provides a standardized interface for browser automation, debugging, and performance analysis through a collection of well-defined tools.\n\nThe MCP protocol serves as the communication layer between AI assistants and the Chrome browser, allowing tools to be discovered, invoked, and executed remotely. The server handles tool registration, request routing, response formatting, and maintains state across multiple browser pages.\n\n资料来源：[src/index.ts:1-50](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/index.ts)\n\n## Architecture\n\n### High-Level System Design\n\n```mermaid\ngraph TD\n    MCP_CLIENT[\"MCP Client / AI Assistant\"]\n    MCP_SERVER[\"MCP Server<br/>(chrome-devtools-mcp)\"]\n    TOOL_REGISTRY[\"Tool Registry\"]\n    BROWSER[\"Chrome Browser\"]\n    CDP[\"Chrome DevTools Protocol\"]\n    \n    MCP_CLIENT -->|\"Call Tool Request\"| MCP_SERVER\n    MCP_SERVER -->|\"Tool Definitions\"| MCP_CLIENT\n    MCP_SERVER --> TOOL_REGISTRY\n    TOOL_REGISTRY -->|\"Handler Execution\"| MCP_SERVER\n    MCP_SERVER -->|\"CDP Commands\"| BROWSER\n    BROWSER --> CDP\n```\n\n### Tool Registration Flow\n\n```mermaid\ngraph TD\n    START[\"Server Initialization\"] --> CREATE_TOOLS[\"createTools()\"]\n    CREATE_TOOLS --> REGISTER[\"registerTool()\"]\n    REGISTER --> DEFINE[\"definePageTool()\"]\n    DEFINE --> SCHEMA[\"Schema Validation\"]\n    SCHEMA --> HANDLER[\"Handler Mapping\"]\n    HANDLER --> READY[\"Tool Available\"]\n    \n    STYLE REGISTER fill:#90EE90\n    STYLE READY fill:#98FB98\n```\n\nThe MCP server initializes by invoking `createTools()` which returns an array of tool definitions. Each tool is then registered with the MCP server using the protocol's `setRequestHandler()` method. Tools are defined using `definePageTool()` which establishes the tool name, description, input schema, annotations, and handler function.\n\n资料来源：[src/index.ts:40-65](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/index.ts)\n\n## Tool Definition System\n\n### ToolDefinition.ts Pattern\n\nTools are defined using the `definePageTool()` function which creates a structured tool definition with type-safe schemas. The definition includes metadata, validation rules, and the execution handler.\n\n```typescript\nexport const listWebMcpTools = definePageTool({\n  name: 'list_webmcp_tools',\n  description: `Lists all WebMCP tools the page exposes.`,\n  annotations: {\n    category: ToolCategory.WEBMCP,\n    readOnlyHint: true,\n  },\n  schema: {},\n  blockedByDialog: false,\n  handler: async (_request, response, _context) => {\n    response.setListWebMcpTools();\n  },\n});\n```\n\n资料来源：[src/tools/webmcp.ts:15-27](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/tools/webmcp.ts)\n\n### Tool Definition Structure\n\n| Property | Type | Description |\n|----------|------|-------------|\n| `name` | `string` | Unique identifier for the tool |\n| `description` | `string` | Human-readable description for the MCP client |\n| `annotations` | `ToolAnnotations` | Metadata about the tool's behavior |\n| `schema` | `ZodSchema` | Input validation schema |\n| `blockedByDialog` | `boolean` | Whether the tool waits for dialog dismissal |\n| `handler` | `AsyncHandler` | Function that executes the tool |\n\n### Tool Annotations\n\nThe annotation system provides additional metadata about tools that MCP clients can use for tool selection, permission handling, and UI display.\n\n```typescript\ninterface ToolAnnotations {\n  category?: ToolCategory;\n  readOnlyHint?: boolean;\n  conditions?: string[];\n  // Additional annotation properties...\n}\n```\n\n| Annotation | Type | Purpose |\n|------------|------|---------|\n| `category` | `ToolCategory` | Groups tools into logical categories |\n| `readOnlyHint` | `boolean` | Indicates if tool doesn't modify browser state |\n| `conditions` | `string[]` | Flags required for this tool to execute |\n\n资料来源：[src/tools/ToolDefinition.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/tools/ToolDefinition.ts)\n\n## Tool Categories\n\nTools are organized into categories that help MCP clients understand their purpose and scope.\n\n```mermaid\ngraph TD\n    TOOLS[\"All Tools\"]\n    NAV[\"Navigation<br/>(navigate, new_page, close)\"]\n    INPUT[\"Input Automation<br/>(click, fill, type_text)\"]\n    EMULATE[\"Emulation<br/>(viewport, userAgent)\"]\n    PERFORMANCE[\"Performance<br/>(trace, analyze)\"]\n    NETWORK[\"Network<br/>(requests, cookies)\"]\n    WEBMCP[\"WebMCP<br/>(page-exposed tools)\"]\n    \n    TOOLS --> NAV\n    TOOLS --> INPUT\n    TOOLS --> EMULATE\n    TOOLS --> PERFORMANCE\n    TOOLS --> NETWORK\n    TOOLS --> WEBMCP\n```\n\n### Available Categories\n\n| Category | Enum Value | Description |\n|----------|-------------|-------------|\n| Navigation | `ToolCategory.NAVIGATION` | Page navigation and management |\n| Input Automation | `ToolCategory.INPUT` | Element interaction and form input |\n| Emulation | `ToolCategory.EMULATION` | Browser environment simulation |\n| Performance | `ToolCategory.PERFORMANCE` | Tracing and performance analysis |\n| Network | `ToolCategory.NETWORK` | Network request inspection |\n| WebMCP | `ToolCategory.WEBMCP` | Tools exposed by the web page |\n| Accessibility | `ToolCategory.A11Y` | Accessibility auditing |\n| Debug | `ToolCategory.DEBUG` | JavaScript debugging tools |\n\n资料来源：[src/tools/categories.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/tools/categories.ts)\n\n## Response System\n\n### McpResponse Architecture\n\nThe response system formats tool execution results into structured MCP responses that include both human-readable markdown and machine-parseable structured content.\n\n```mermaid\ngraph LR\n    REQUEST[\"Tool Request\"] --> HANDLER[\"Tool Handler\"]\n    HANDLER --> RESPONSE[\"McpResponse\"]\n    RESPONSE -->|Text Content| MARKDOWN[\"Markdown Output\"]\n    RESPONSE -->|Structured Data| JSON[\"JSON / Structured\"]\n    \n    subgraph Response Components\n        TOOL_DEFS[\"Tool Definitions\"]\n        NETWORK[\"Network Requests\"]\n        PAGINATION[\"Pagination Info\"]\n        WEBMCP_TOOLS[\"WebMCP Tools\"]\n    end\n    \n    RESPONSE --> TOOL_DEFS\n    RESPONSE --> NETWORK\n    RESPONSE --> PAGINATION\n    RESPONSE --> WEBMCP_TOOLS\n```\n\n### Response Formatting Features\n\n| Feature | Description |\n|---------|-------------|\n| **Tool Definitions** | Lists all available tools with their schemas |\n| **Network Requests** | Includes network waterfall data when requested |\n| **Pagination** | Handles large result sets with pagination info |\n| **WebMCP Tools** | Lists tools exposed by the current web page |\n| **Structured Content** | Provides machine-readable data alongside text |\n\n资料来源：[src/McpResponse.ts:50-120](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/McpResponse.ts)\n\n### Structured Content Model\n\nThe `structuredContent` object provides programmatic access to response data:\n\n```typescript\ninterface StructuredContent {\n  webmcpTools?: WebMcpToolInfo[];\n  networkRequests?: NetworkRequest[];\n  pagination?: PaginationInfo;\n  [key: string]: unknown;\n}\n```\n\n### Pagination Support\n\nWhen handling large datasets (e.g., network requests), the response includes pagination metadata:\n\n```typescript\nconst paginationData = this.#dataWithPagination(\n  requests,\n  this.#networkRequestsOptions.pagination,\n);\nstructuredContent.pagination = paginationData.pagination;\n```\n\n资料来源：[src/McpResponse.ts:150-180](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/McpResponse.ts)\n\n## WebMCP Integration\n\nWebMCP enables web pages to expose custom tools that MCP clients can discover and invoke. This creates a two-way communication channel where the browser can extend its capabilities based on the loaded page.\n\n```mermaid\ngraph TD\n    MCP_CLIENT[\"MCP Client\"]\n    SERVER[\"MCP Server\"]\n    CHROME[\"Chrome Browser\"]\n    WEB_PAGE[\"Web Page\"]\n    \n    subgraph Discovery Flow\n        CLIENT_LIST[\"list_webmcp_tools\"]\n        SERVER -->|\"Query\"| CHROME\n        CHROME --> WEB_PAGE\n        WEB_PAGE -->|\"Exposes tools\"| CHROME\n        CHROME -->|\"Tool list\"| SERVER\n        SERVER -->|\"Tool names\"| CLIENT_LIST\n    end\n    \n    subgraph Execution Flow\n        EXEC[\"execute_webmcp_tool\"]\n        CLIENT -->|\"toolName + input\"| SERVER\n        SERVER -->|\"Forward\"| CHROME\n        CHROME --> WEB_PAGE\n        WEB_PAGE -->|\"Execute\"| RESULT[\"Result\"]\n    end\n```\n\n### WebMCP Tools\n\n| Tool | Description | Parameters |\n|------|-------------|------------|\n| `list_webmcp_tools` | Lists all tools exposed by the current page | None |\n| `execute_webmcp_tool` | Invokes a WebMCP tool exposed by the page | `toolName`, `input` (JSON string) |\n\nThe `execute_webmcp_tool` accepts input as a JSON string which is parsed and passed to the page-exposed tool:\n\n```typescript\nlet input: Record<string, unknown> = {};\nif (request.params.input) {\n  try {\n    const parsed = JSON.parse(request.params.input);\n    if (typeof parsed === 'object' && parsed !== null) {\n      input = parsed;\n    }\n  } catch (error) {\n    // Handle parse error\n  }\n}\n```\n\n资料来源：[src/tools/webmcp.ts:29-60](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/tools/webmcp.ts)\n\n## Tool Documentation Generation\n\nThe repository includes a documentation generation system that parses tool definitions and produces formatted markdown:\n\n```mermaid\ngraph TD\n    SOURCE[\"Tool Source Files\"]\n    PARSER[\"Documentation Parser\"]\n    ANNOTATIONS[\"Parse Annotations\"]\n    SCHEMA[\"Parse Input Schema\"]\n    CROSSLINKS[\"Add Cross-References\"]\n    OUTPUT[\"Markdown Documentation\"]\n    \n    SOURCE --> PARSER\n    PARSER --> ANNOTATIONS\n    PARSER --> SCHEMA\n    ANNOTATIONS --> CROSSLINKS\n    SCHEMA --> CROSSLINKS\n    CROSSLINKS --> OUTPUT\n```\n\n### Schema Documentation\n\nProperties are sorted by required status first, then alphabetically:\n\n```typescript\nconst propertyNames = Object.keys(properties).sort((a, b) => {\n  const aRequired = required.includes(a);\n  const bRequired = required.includes(b);\n  if (aRequired && !bRequired) return -1;\n  if (!aRequired && bRequired) return 1;\n  return a.localeCompare(b);\n});\n```\n\nRequired properties are marked with `**(required)**` and optional properties with `_(optional)_`.\n\n资料来源：[scripts/generate-docs.ts:100-140](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/scripts/generate-docs.ts)\n\n## Server Initialization\n\n### Startup Sequence\n\n```mermaid\nsequenceDiagram\n    participant CLI as CLI / MCP Client\n    participant Server as MCP Server\n    participant Tools as Tool Registry\n    participant Browser as Chrome Browser\n    \n    CLI->>Server: Initialize with args\n    Server->>Server: parseArguments()\n    Server->>Tools: createTools()\n    Tools->>Server: Tool definitions\n    loop For each tool\n        Server->>Server: registerTool()\n    end\n    Server->>Server: loadIssueDescriptions()\n    Server->>CLI: Server ready\n```\n\n### Tool Registration Implementation\n\n```typescript\nconst tools = createTools(serverArgs);\nfor (const tool of tools) {\n  server.setRequestHandler(\n    {name: tool.name, description: tool.description, ...},\n    async (params) => {\n      return await toolHandler.handle(params);\n    },\n  );\n}\n```\n\n资料来源：[src/index.ts:45-60](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/index.ts)\n\n## Configuration and Flags\n\nThe MCP server accepts various configuration options that affect tool behavior:\n\n| Flag | Description | Default |\n|------|-------------|---------|\n| `--slim` | Disables non-essential features | `false` |\n| `--performanceCrux` | Enable CrUX API for performance data | `true` |\n| `--usageStatistics` | Enable anonymous usage collection | `true` |\n| `--browser-url` | Direct browser connection URL | - |\n| `--autoConnect` | Auto-handshake with running Chrome | `false` |\n| `--logFile` | Debug log file path | - |\n\n### Disclaimer System\n\nThe server logs disclaimers on startup to inform users about data exposure:\n\n```typescript\nexport const logDisclaimers = (args) => {\n  console.error(`chrome-devtools-mcp exposes content of the browser instance...`);\n  \n  if (!args.slim && args.performanceCrux) {\n    console.error(`Performance tools may send trace URLs to Google CrUX API...`);\n  }\n};\n```\n\n资料来源：[src/index.ts:70-90](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/index.ts)\n\n## Type Safety\n\nThe codebase enforces strict TypeScript practices:\n\n| Rule | Enforcement |\n|------|-------------|\n| No `any` type | All types must be explicitly defined |\n| No `as` casts | Use type guards and transforms |\n| No `!` assertions | Use conditional checks |\n| No `@ts-ignore` | Code must compile cleanly |\n| No `@ts-nocheck` | Full type checking required |\n\nTools use Zod schemas for runtime validation, ensuring that the runtime behavior matches the TypeScript types:\n\n```typescript\nschema: {\n  toolName: zod.string().describe('The name of the WebMCP tool to execute'),\n  input: zod.string().optional().describe('The JSON-stringified parameters...'),\n},\n```\n\n资料来源：[src/tools/webmcp.ts:30-40](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/tools/webmcp.ts)\n\n---\n\n<a id='automation-tools'></a>\n\n## Input and Navigation Automation Tools\n\n### 相关页面\n\n相关主题：[Debugging and Inspection Tools](#debugging-tools), [Performance Analysis Tools](#performance-tools), [Configuration Reference](#configuration)\n\n<details>\n<summary>相关源码文件</summary>\n\n以下源码文件用于生成本页说明：\n\n- [src/tools/input.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/tools/input.ts)\n- [src/tools/pages.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/tools/pages.ts)\n- [src/tools/emulation.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/tools/emulation.ts)\n- [src/WaitForHelper.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/WaitForHelper.ts)\n- [src/utils/keyboard.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/utils/keyboard.ts)\n- [docs/tool-reference.md](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/docs/tool-reference.md)\n- [skills/chrome-devtools-cli/SKILL.md](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/skills/chrome-devtools-cli/SKILL.md)\n- [skills/chrome-devtools/SKILL.md](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/skills/chrome-devtools/SKILL.md)\n</details>\n\n# Input and Navigation Automation Tools\n\n## Overview\n\nThe Input and Navigation Automation Tools constitute the core interaction layer of the `chrome-devtools-mcp` project, enabling programmatic control over browser pages through the Chrome DevTools Protocol (CDP). These tools allow AI agents and automated scripts to simulate real user interactions including keyboard input, mouse actions, page navigation, and environment emulation.\n\n**资料来源:** [skills/chrome-devtools/SKILL.md](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/skills/chrome-devtools/SKILL.md)\n\n## Architecture\n\nThe automation system is organized into three primary tool categories that work in concert to provide comprehensive browser control:\n\n```mermaid\ngraph TD\n    A[chrome-devtools-mcp Tools] --> B[Input Tools]\n    A --> C[Navigation Tools]\n    A --> D[Emulation Tools]\n    \n    B --> B1[click]\n    B --> B2[fill]\n    B --> B3[type_text]\n    B --> B4[press_key]\n    B --> B5[hover]\n    B --> B6[drag]\n    B --> B7[upload_file]\n    \n    C --> C1[navigate_page]\n    C --> C2[new_page]\n    C --> C3[select_page]\n    C --> C4[close_page]\n    C --> C5[list_pages]\n    \n    D --> D1[emulate]\n    D --> D2[resize_page]\n    \n    E[WaitForHelper] --> B\n    E --> C\n```\n\n**资料来源:** [src/tools/ToolDefinition.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/tools/ToolDefinition.ts)\n\n## Input Tools\n\nInput tools provide the capability to simulate user interactions with page elements. All input operations require a valid element `uid` obtained from a previous `take_snapshot` call.\n\n**资料来源:** [skills/chrome-devtools-cli/SKILL.md](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/skills/chrome-devtools-cli/SKILL.md)\n\n### Core Input Operations\n\n| Tool | Purpose | Key Parameters |\n|------|---------|----------------|\n| `click` | Click on an element | `uid` (required), `dblClick`, `includeSnapshot` |\n| `fill` | Fill text into input/select | `uid` (required), `value` (required), `includeSnapshot` |\n| `type_text` | Type text character by character | `text` (required), `submitKey`, `includeSnapshot` |\n| `press_key` | Press a key or combination | `key` (required), `includeSnapshot` |\n| `hover` | Hover over an element | `uid` (required), `includeSnapshot` |\n| `drag` | Drag element to destination | `src` (required), `dst` (required), `includeSnapshot` |\n| `upload_file` | Upload file via input element | `uid` (required), `filePath` (required), `includeSnapshot` |\n\n**资料来源:** [src/tools/input.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/tools/input.ts)\n\n### Keyboard Handling\n\nThe keyboard system supports complex key combinations through a modifier parsing mechanism defined in `src/utils/keyboard.ts`:\n\n```typescript\n// Key format: \"Control+A\", \"Control+Shift+R\", \"Alt+F4\"\nconst tokens = parseKey(request.params.key);\nconst [key, ...modifiers] = tokens;\n```\n\n**资料来源:** [src/utils/keyboard.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/utils/keyboard.ts)\n\nSupported modifiers:\n- `Control`\n- `Shift`\n- `Alt`\n- `Meta`\n\n### Interaction Workflow\n\n```mermaid\nsequenceDiagram\n    participant Agent as AI Agent\n    participant Snapshot as take_snapshot\n    participant Input as Input Tool\n    participant Page as Chrome Page\n    \n    Agent->>Page: navigate_page / new_page\n    Agent->>Snapshot: take_snapshot\n    Snapshot-->>Agent: Element UIDs\n    Agent->>Input: click uid=\"1_5\"\n    Input->>Page: CDP Input.dispatchMouseEvent\n    Page-->>Input: Mouse click confirmed\n    Input-->>Agent: Result response\n```\n\n**资料来源:** [skills/chrome-devtools/SKILL.md](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/skills/chrome-devtools/SKILL.md)\n\n### Common Input Patterns\n\n**Typing with Submit:**\n```bash\nchrome-devtools type_text \"hello\" --submitKey \"Enter\"\n```\n\n**Click with Snapshot:**\n```bash\nchrome-devtools click \"uid\" --includeSnapshot true\n```\n\n**Pressing Key Combinations:**\n```bash\nchrome-devtools press_key \"Control+A\" --includeSnapshot true\n```\n\n**资料来源:** [skills/chrome-devtools-cli/SKILL.md](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/skills/chrome-devtools-cli/SKILL.md)\n\n## Navigation Tools\n\nNavigation tools manage page lifecycle and context within the browser instance.\n\n**资料来源:** [src/tools/pages.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/tools/pages.ts)\n\n### Page Management Operations\n\n| Tool | Purpose | Key Parameters |\n|------|---------|----------------|\n| `navigate_page` | Navigate current page to URL | `url` (required), `type`, `ignoreCache`, `timeout`, `handleBeforeUnload`, `initScript` |\n| `new_page` | Create new page/tab | `url`, `background`, `timeout`, `isolatedContext` |\n| `select_page` | Set active page context | `pageId` (required), `bringToFront` |\n| `close_page` | Close page by index | `pageId` (optional) |\n| `list_pages` | List all open pages | - |\n\n**资料来源:** [src/tools/pages.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/tools/pages.ts)\n\n### Navigation Types\n\nThe `navigate_page` tool supports multiple navigation types:\n\n```typescript\ntype: \"navigate\" | \"reload\" | \"back\" | \"forward\"\n```\n\n| Type | Behavior |\n|------|----------|\n| `navigate` | Default navigation to specified URL |\n| `reload` | Reload current page (supports `ignoreCache`) |\n| `back` | Navigate to previous page in history |\n| `forward` | Navigate to next page in history |\n\n**资料来源:** [src/tools/pages.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/tools/pages.ts)\n\n### Before Unload Handling\n\nWhen navigating away from a page with pending changes, the browser may display a \"before unload\" dialog:\n\n```bash\nchrome-devtools navigate_page --url \"https://example.com\" --handleBeforeUnload \"accept\"\n```\n\n| Option | Behavior |\n|--------|----------|\n| `accept` | Proceed with navigation, dismiss dialog |\n| `dismiss` | Cancel navigation |\n\n**资料来源:** [skills/chrome-devtools-cli/SKILL.md](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/skills/chrome-devtools-cli/SKILL.md)\n\n### Multi-Page Context Management\n\nPages are managed with a zero-based index system. The `select_page` tool changes the active page context for subsequent tool calls:\n\n```bash\n# List pages to see available pages\nchrome-devtools list_pages\n\n# Select page by index\nchrome-devtools select_page 1 --bringToFront true\n```\n\n**资料来源:** [skills/chrome-devtools/SKILL.md](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/skills/chrome-devtools/SKILL.md)\n\n### Isolated Contexts\n\nNew pages can be created with isolated JavaScript contexts, useful for testing extensions or isolated scripts:\n\n```bash\nchrome-devtools new_page \"https://example.com\" --isolatedContext \"ctx\"\n```\n\n**资料来源:** [src/tools/pages.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/tools/pages.ts)\n\n### Page Lifecycle\n\n```mermaid\nstateDiagram-v2\n    [*] --> created: new_page\n    created --> active: select_page\n    active --> background: select_page (other)\n    background --> active: select_page (bringToFront)\n    active --> closed: close_page\n    closed --> [*]\n    \n    active --> navigating: navigate_page\n    navigating --> active: Load complete\n```\n\n**资料来源:** [src/PageCollector.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/PageCollector.ts)\n\n## Emulation Tools\n\nEmulation tools control browser environment settings including network conditions, CPU throttling, geolocation, viewport, and user agent.\n\n**资料来源:** [src/tools/emulation.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/tools/emulation.ts)\n\n### Emulation Capabilities\n\n| Capability | Parameters | Description |\n|------------|------------|-------------|\n| Network Conditions | `networkConditions` | Preset: \"Offline\", \"Slow 3G\", \"Fast 3G\", etc. |\n| CPU Throttling | `cpuThrottlingRate` | Multiplier (e.g., 4 = 4x slowdown) |\n| Geolocation | `geolocation` | Coordinates in format \"lat,lng\" |\n| Color Scheme | `colorScheme` | \"light\" or \"dark\" |\n| Viewport | `viewport` | Format: \"WIDTHxHEIGHT\" (e.g., \"1920x1080\") |\n| User Agent | `userAgent` | Custom UA string |\n\n**资料来源:** [src/tools/emulation.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/tools/emulation.ts)\n\n### Emulation Commands\n\n**Network Emulation:**\n```bash\nchrome-devtools emulate --networkConditions \"Offline\"\n```\n\n**Multiple Emulations:**\n```bash\nchrome-devtools emulate --cpuThrottlingRate 4 --geolocation \"0x0\"\n```\n\n**Visual Emulation:**\n```bash\nchrome-devtools emulate --colorScheme \"dark\" --viewport \"1920x1080\"\n```\n\n**User Agent Spoofing:**\n```bash\nchrome-devtools emulate --userAgent \"Mozilla/5.0...\"\n```\n\n**资料来源:** [skills/chrome-devtools-cli/SKILL.md](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/skills/chrome-devtools-cli/SKILL.md)\n\n### Page Resize\n\nThe `resize_page` tool resizes the selected page's window:\n\n```bash\nchrome-devtools resize_page 1920 1080\n```\n\n**资料来源:** [src/tools/emulation.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/tools/emulation.ts)\n\n## WaitForHelper\n\nThe `WaitForHelper` module provides synchronization mechanisms to ensure page elements are ready before interactions occur.\n\n**资料来源:** [src/WaitForHelper.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/WaitForHelper.ts)\n\n### Wait Strategies\n\n| Strategy | Description |\n|----------|-------------|\n| `wait_for` | Generic wait for specified duration or condition |\n| Event-based | Wait for navigation, network idle, or element state |\n| Timeout handling | Configurable timeout with default fallback |\n\n**资料来源:** [skills/chrome-devtools/SKILL.md](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/skills/chrome-devtools/SKILL.md)\n\n### Recommended Workflow\n\nThe official workflow ensures reliable automation:\n\n1. **Navigate**: Use `navigate_page` or `new_page`\n2. **Wait**: Use `wait_for` if you know what to look for\n3. **Snapshot**: Use `take_snapshot` to understand page structure\n4. **Interact**: Use element `uid`s from snapshot for `click`, `fill`, etc.\n\n**资料来源:** [skills/chrome-devtools/SKILL.md](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/skills/chrome-devtools/SKILL.md)\n\n## Tool Configuration Schema\n\nAll tools follow a consistent schema pattern defined in `src/tools/ToolDefinition.ts`:\n\n```typescript\nexport const timeoutSchema = {\n  timeout: zod\n    .number()\n    .int()\n    .optional()\n    .describe(\n      `Maximum wait time in milliseconds. If set to 0, the default timeout will be used.`,\n    )\n    .transform(value => {\n      return value && value <= 0 ? undefined : value;\n    }),\n};\n\nexport const pageIdSchema = {\n  pageId: zod.number().optional().describe('Targets a specific page by ID.'),\n};\n```\n\n**资料来源:** [src/tools/ToolDefinition.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/tools/ToolDefinition.ts)\n\n### IncludeSnapshot Pattern\n\nMany input tools support the `includeSnapshot` flag to return an updated page snapshot after the action:\n\n```bash\nchrome-devtools click \"id\" --includeSnapshot true\n```\n\nWhen `true`, the response includes the full accessibility tree, allowing chaining without an explicit `take_snapshot` call.\n\n**资料来源:** [skills/chrome-devtools-cli/SKILL.md](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/skills/chrome-devtools-cli/SKILL.md)\n\n## Error Handling\n\n### Dialog Blocking\n\nSome input tools are blocked when a dialog is present:\n\n```typescript\nblockedByDialog: true,\n```\n\nIn such cases, use `handle_dialog` first:\n\n```bash\nchrome-devtools handle_dialog accept\nchrome-devtools handle_dialog dismiss --promptText \"hi\"\n```\n\n**资料来源:** [src/tools/input.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/tools/input.ts)\n\n### Page Closure Restrictions\n\nThe last open page cannot be closed:\n\n```typescript\nexport const CLOSE_PAGE_ERROR =\n  'The last open page cannot be closed. It is fine to keep it open.';\n```\n\n**资料来源:** [src/tools/ToolDefinition.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/tools/ToolDefinition.ts)\n\n## CLI Usage\n\nAll tools are accessible via the `chrome-devtools` CLI:\n\n```bash\nchrome-devtools <tool> [arguments] [flags]\n```\n\n### Help System\n\n```bash\nchrome-devtools take_snapshot --help\n```\n\n### Output Formats\n\nBy default, output is in Markdown. Use `--output-format=json` for JSON output:\n\n```bash\nchrome-devtools list_pages --output-format=json\n```\n\n**资料来源:** [skills/chrome-devtools-cli/SKILL.md](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/skills/chrome-devtools-cli/SKILL.md)\n\n## Tool Categories\n\nTools are organized into categories for documentation and navigation:\n\n| Category | Description |\n|----------|-------------|\n| `INPUT` | Keyboard, mouse, and element interactions |\n| `NAVIGATION` | Page lifecycle and context management |\n| `EMULATION` | Browser environment control |\n| `INSPECTION` | Page inspection and snapshots |\n| `PERFORMANCE` | Performance tracing and analysis |\n| `NETWORK` | Network request inspection |\n\n**资料来源:** [docs/tool-reference.md](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/docs/tool-reference.md)\n\n## Testing and Validation\n\nThe repository includes test scenarios that validate tool behavior:\n\n```typescript\nexpectations: calls => {\n  assert.ok(\n    calls[0].name === 'navigate_page' || calls[0].name === 'new_page',\n  );\n  assert.strictEqual(calls[1].name, 'take_snapshot');\n  assert.strictEqual(calls[2].name, 'fill_form');\n}\n```\n\n**资料来源:** [scripts/eval_scenarios/fill_select_and_checkboxes_test.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/scripts/eval_scenarios/fill_select_and_checkboxes_test.ts)\n\n## Summary\n\nThe Input and Navigation Automation Tools provide a comprehensive API for browser automation through:\n\n- **Input Tools**: Simulate user interactions with precise element targeting\n- **Navigation Tools**: Full page lifecycle management including multi-page contexts\n- **Emulation Tools**: Control browser environment for testing various conditions\n- **WaitForHelper**: Synchronization primitives for reliable automation\n\nThese tools work together to enable reliable browser automation workflows suitable for testing, scraping, and AI agent interactions.\n\n---\n\n<a id='debugging-tools'></a>\n\n## Debugging and Inspection Tools\n\n### 相关页面\n\n相关主题：[Input and Navigation Automation Tools](#automation-tools), [Performance Analysis Tools](#performance-tools)\n\n<details>\n<summary>相关源码文件</summary>\n\n以下源码文件用于生成本页说明：\n\n- [src/tools/snapshot.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/tools/snapshot.ts)\n- [src/tools/screenshot.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/tools/screenshot.ts)\n- [src/tools/network.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/tools/network.ts)\n- [src/tools/console.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/tools/console.ts)\n- [src/tools/memory.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/tools/memory.ts)\n- [src/formatters/ConsoleFormatter.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/formatters/ConsoleFormatter.ts)\n- [src/formatters/NetworkFormatter.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/formatters/NetworkFormatter.ts)\n- [src/formatters/SnapshotFormatter.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/formatters/SnapshotFormatter.ts)\n</details>\n\n# Debugging and Inspection Tools\n\n## Overview\n\nThe Debugging and Inspection Tools in chrome-devtools-mcp provide comprehensive capabilities for examining browser page state, accessibility trees, console output, network activity, and memory usage. These tools serve as the primary interface for automated debugging, accessibility auditing, and performance analysis workflows.\n\nThe inspection layer is built on Chrome DevTools Protocol (CDP) and exposes both programmatic and visual inspection capabilities through a unified MCP (Model Context Protocol) interface. All tools operate on the currently selected page context, enabling sequential inspection workflows.\n\n## Architecture\n\n```mermaid\ngraph TD\n    subgraph \"Inspection Layer\"\n        SNAP[Snapshot Tools]\n        SCR[Screen Tools]\n        NET[Network Tools]\n        CON[Console Tools]\n        MEM[Memory Tools]\n    end\n    \n    subgraph \"Formatting Layer\"\n        SF[SnapshotFormatter]\n        NF[NetworkFormatter]\n        CF[ConsoleFormatter]\n    end\n    \n    subgraph \"CDP Integration\"\n        CDP[Chrome DevTools Protocol]\n        PUP[CDP Puppeteer Bridge]\n    end\n    \n    SNAP --> SF\n    SCR --> CDP\n    NET --> NF\n    CON --> CF\n    MEM --> CDP\n    \n    SF --> PUP\n    NF --> PUP\n    CF --> PUP\n    PUP --> CDP\n    \n    style SNAP fill:#e1f5fe\n    style SCR fill:#e1f5fe\n    style NET fill:#e1f5fe\n    style CON fill:#e1f5fe\n    style MEM fill:#e1f5fe\n```\n\n## Page Snapshot Tools\n\n### take_snapshot\n\nThe primary inspection tool that captures the accessibility tree of the currently selected page. The snapshot provides a text-based representation of page structure with unique element identifiers (UIDs) used for subsequent interaction.\n\n**Parameters:**\n\n| Parameter | Type | Required | Description |\n|-----------|------|----------|-------------|\n| `verbose` | boolean | No | Include all available information from the full a11y tree. Default: `false` |\n| `filePath` | string | No | Absolute or relative path to save snapshot output instead of attaching to response |\n\n**Key Features:**\n\n- Returns element hierarchy with unique `uid` identifiers\n- Indicates which element is selected in DevTools Elements panel\n- Supports output to file for large snapshots\n- Based on accessibility tree, not raw DOM (reflects what assistive technologies perceive)\n- Marked as `blockedByDialog: true` to handle browser dialogs gracefully\n\n**Source:** [src/tools/snapshot.ts:17-43]()\n\n### wait_for\n\nSuspends execution until a specified condition is met on the page, enabling synchronization with dynamic content loading.\n\n**Source:** [src/tools/snapshot.ts:45+]()\n\n## Console Tools\n\n### list_console_messages\n\nRetrieves console output and browser-issued accessibility audits from the current page. This tool captures both developer-initiated logs and automatic Chrome accessibility checks.\n\n**Use Cases:**\n\n- Capturing `console.log`, `console.error`, and other console methods\n- Detecting browser-issued accessibility issues\n- Preserving messages from page load that occurred before inspection\n- Filtering by message types (`log`, `warn`, `error`, `info`, `debug`, `issue`)\n\n**Source:** [src/tools/console.ts]()\n\n### Console Output Types\n\n| Type | Description | Typical Use |\n|------|-------------|-------------|\n| `log` | General information | Debug output |\n| `warn` | Warning messages | Non-critical issues |\n| `error` | Error messages | Failures and exceptions |\n| `info` | Informational messages | Status updates |\n| `debug` | Debug-level details | Verbose debugging |\n| `issue` | Browser a11y audits | Accessibility violations |\n\nThe console formatter (`ConsoleFormatter.ts`) processes raw CDP messages into structured, human-readable output with proper formatting of objects and arrays.\n\n**Source:** [src/formatters/ConsoleFormatter.ts]()\n\n## Network Inspection Tools\n\n### Network Monitoring\n\nThe network inspection subsystem captures HTTP traffic, WebSocket communications, and resource loading timing. Network tools are essential for debugging API calls, identifying slow resources, and analyzing request/response patterns.\n\n**Source:** [src/tools/network.ts]()\n\n**Network Formatter:** [src/formatters/NetworkFormatter.ts]()\n\n### Network Parameters\n\n| Parameter | Type | Description |\n|-----------|------|-------------|\n| `pageIdx` | number | Page index for pagination |\n| `pageSize` | number | Number of items per page |\n| `types` | string[] | Filter by resource types (document, stylesheet, image, script, xhr, etc.) |\n| `includePreservedMessages` | boolean | Include messages from before tool invocation |\n\n## Memory Inspection Tools\n\n### take_memory_snapshot\n\nCaptures V8 heap memory snapshots for debugging memory leaks and analyzing memory consumption patterns. Heap snapshots are saved in Chrome's standard `.heapsnapshot` format.\n\n**Parameters:**\n\n| Parameter | Type | Required | Description |\n|-----------|------|----------|-------------|\n| `filePath` | string | Yes | Target path for the snapshot file |\n\n**Use Cases:**\n\n- Identifying memory leaks\n- Analyzing object retention paths\n- Comparing heap states before/after operations\n- Finding detached DOM trees\n\n**Source:** [src/tools/memory.ts]()\n\n## Screenshot Tools\n\n### take_screenshot\n\nCaptures visual representation of the current page state. Unlike snapshots, screenshots provide pixel-level fidelity for visual inspection when accessibility tree information is insufficient.\n\n**Use Cases:**\n\n- Visual debugging when structure is unclear\n- Capturing rendered UI state\n- Documenting bug reproductions\n- Inspecting CSS-dependent layouts\n\n**Source:** [src/tools/screenshot.ts]()\n\n## Snapshot Formatting\n\nThe SnapshotFormatter (`SnapshotFormatter.ts`) transforms raw accessibility tree data into human-readable hierarchical text format.\n\n**Output Structure:**\n\n```\nuid=1_0 RootWebArea \"Example Domain\" url=\"https://example.com/\"\n  uid=1_1 heading \"Example Domain\" level=\"1\"\n  uid=1_2 paragraph \"Some content text\"\n```\n\n**Key Formatting Features:**\n\n- Hierarchical indentation reflecting DOM tree structure\n- UID assignment following CDP node IDs\n- Role-based element classification (heading, paragraph, button, etc.)\n- Attribute inclusion for semantic details\n- ARIA property preservation\n\n**Source:** [src/formatters/SnapshotFormatter.ts]()\n\n## Workflow Patterns\n\n### Standard Inspection Workflow\n\n```mermaid\ngraph LR\n    A[Navigate to Page] --> B[wait_for Condition]\n    B --> C[take_snapshot]\n    C --> D{Issue Found?}\n    D -->|Yes| E[Take Screenshot]\n    E --> F[Check Console Logs]\n    F --> G[Document Findings]\n    D -->|No| H[Continue Testing]\n    \n    style A fill:#c8e6c9\n    style C fill:#bbdefb\n    style F fill:#fff9c4\n```\n\n### Accessibility Audit Workflow\n\n1. **Lighthouse Audit**: Run comprehensive accessibility audit via MCP tools\n2. **Console Inspection**: Check for browser-issued `issue` type messages\n3. **Snapshot Analysis**: Verify heading hierarchy, ARIA labels, semantic landmarks\n4. **Form Input Verification**: Ensure all inputs have associated labels\n5. **Focus Navigation**: Test keyboard navigation with `press_key` tool\n\n**Source:** [skills/a11y-debugging/SKILL.md]()\n\n## Tool Categories\n\nAll inspection tools are categorized under `ToolCategory.DEBUGGING` for organizational purposes and MCP tool discovery.\n\n**Source:** [src/tools/snapshot.ts:10]()\n\n### Category Matrix\n\n| Tool | Category | Read-Only | Blocked by Dialog |\n|------|----------|-----------|-------------------|\n| `take_snapshot` | DEBUGGING | false* | true |\n| `wait_for` | DEBUGGING | true | true |\n| `list_console_messages` | DEBUGGING | true | false |\n| `take_memory_snapshot` | DEBUGGING | true | true |\n| `take_screenshot` | DEBUGGING | true | true |\n\n*Note: `take_snapshot` is not read-only due to the `filePath` parameter allowing file system writes.\n\n## Integration with Input Automation\n\nInspection tools work in conjunction with input automation tools to enable test-verify workflows:\n\n```mermaid\ngraph TD\n    INSPECT[Inspection Tools] <-->|UID feedback| INTERACT[Input Automation]\n    \n    INSPECT --> SNAP[Snapshot with UIDs]\n    INTERACT --> CLICK[click uid]\n    INTERACT --> FILL[fill uid \"text\"]\n    INTERACT --> HOVER[hover uid]\n    \n    SNAP --> ELEM[Element UIDs]\n    ELEM --> CLICK\n    ELEM --> FILL\n    ELEM --> HOVER\n```\n\n**Source:** [skills/chrome-devtools/SKILL.md]()\n\n## Best Practices\n\n1. **Prefer Snapshots over Screenshots**: Text snapshots are faster, machine-parseable, and more reliable for automation\n2. **Use File Output for Large Data**: Specify `filePath` parameter when capturing large snapshots or traces\n3. **Wait Before Inspecting**: Always use `wait_for` when content loads dynamically\n4. **Check Console First**: Browser-issued issues often reveal accessibility problems without manual investigation\n5. **Keep Snapshots Current**: Element UIDs may change after page mutations—take fresh snapshots before interactions\n\n## Output Formats\n\nAll inspection tools support multiple output formats via the `--output-format` flag:\n\n| Format | Use Case |\n|--------|----------|\n| `markdown` (default) | Human-readable output with formatting |\n| `json` | Structured data for programmatic processing |\n\n**Source:** [skills/chrome-devtools-cli/SKILL.md]()\n\n## Error Handling\n\nInspection tools handle common failure scenarios:\n\n- **Dialog Blocking**: Tools with `blockedByDialog: true` will wait if a browser dialog appears\n- **Page Context Missing**: Operations fail gracefully if no page is selected\n- **Path Validation**: File operations validate paths before writing\n- **Timeout Handling**: Configurable timeouts prevent indefinite waits\n\n**Source:** [src/tools/snapshot.ts:28-31]()\n\n---\n\n<a id='performance-tools'></a>\n\n## Performance Analysis Tools\n\n### 相关页面\n\n相关主题：[Debugging and Inspection Tools](#debugging-tools), [Telemetry and Monitoring](#telemetry)\n\n<details>\n<summary>Related Source Files</summary>\n\nThe following source files were used to generate this documentation:\n\n- [src/tools/lighthouse.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/tools/lighthouse.ts)\n- [src/tools/performance.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/tools/performance.ts)\n- [src/HeapSnapshotManager.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/HeapSnapshotManager.ts)\n- [src/formatters/HeapSnapshotFormatter.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/formatters/HeapSnapshotFormatter.ts)\n- [src/trace-processing/parse.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/trace-processing/parse.ts)\n- [skills/debug-optimize-lcp/SKILL.md](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/skills/debug-optimize-lcp/SKILL.md)\n- [skills/chrome-devtools-cli/SKILL.md](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/skills/chrome-devtools-cli/SKILL.md)\n</details>\n\n# Performance Analysis Tools\n\nThe chrome-devtools-mcp repository provides a comprehensive suite of performance analysis tools through the Chrome DevTools Protocol integration. These tools enable automated performance auditing, runtime tracing, memory profiling, and network condition emulation.\n\n## Overview\n\nPerformance Analysis Tools in chrome-devtools-mcp encompass four primary domains:\n\n| Domain | Primary Tools | Purpose |\n|--------|---------------|---------|\n| **Lighthouse Auditing** | `lighthouse_audit` | Accessibility, SEO, best practices scoring |\n| **Performance Tracing** | `performance_start_trace`, `performance_stop_trace` | Chrome tracing with DevTools performance data |\n| **Memory Profiling** | `take_memory_snapshot`, `HeapSnapshotManager` | JavaScript heap analysis |\n| **Trace Processing** | `parse.ts` | Processing and parsing of trace events |\n\n资料来源：[src/tools/lighthouse.ts:1-20]()\n\n## Architecture\n\nThe performance analysis system follows a layered architecture:\n\n```mermaid\ngraph TD\n    subgraph \"CLI Layer\"\n        CLI[CLI Commands<br/>chrome-devtools CLI]\n    end\n    \n    subgraph \"Tool Layer\"\n        LH[Lighthouse Audit Tool]\n        PT[Performance Trace Tools]\n        MS[Memory Snapshot Tools]\n    end\n    \n    subgraph \"Protocol Layer\"\n        CDP[Chrome DevTools Protocol]\n    end\n    \n    subgraph \"Processing Layer\"\n        HSP[Heap Snapshot Parser]\n        TRP[Trace Event Parser]\n        FMT[Result Formatters]\n    end\n    \n    subgraph \"Output Layer\"\n        JSON[JSON Reports]\n        HTML[HTML Reports]\n        SNAP[Heap Snapshots]\n    end\n    \n    CLI --> LH\n    CLI --> PT\n    CLI --> MS\n    \n    LH --> CDP\n    PT --> CDP\n    MS --> CDP\n    \n    MS --> HSP\n    PT --> TRP\n    \n    HSP --> FMT\n    TRP --> FMT\n    \n    FMT --> JSON\n    FMT --> HTML\n    HSP --> SNAP\n```\n\n## Lighthouse Audit Tool\n\nThe `lighthouse_audit` tool provides automated accessibility, SEO, and best practices auditing.\n\n### Tool Definition\n\n```typescript\nexport const lighthouseAudit = definePageTool({\n  name: 'lighthouse_audit',\n  description: `Get Lighthouse score and reports for accessibility, SEO, best practices, and agentic browsing. This excludes performance.`,\n  schema: {\n    mode: zod.enum(['navigation', 'snapshot']).default('navigation'),\n    device: zod.enum(['desktop', 'mobile']).default('desktop'),\n    outputDirPath: zod.string().optional(),\n  },\n});\n```\n\n资料来源：[src/tools/lighthouse.ts:19-40]()\n\n### Audit Categories\n\n| Category | Description | Default Enabled |\n|----------|-------------|-----------------|\n| `accessibility` | WCAG compliance, ARIA labels, color contrast | Yes |\n| `seo` | Meta tags, crawlability, mobile friendliness | Yes |\n| `best-practices` | HTTPS usage, no deprecated APIs | Yes |\n| `agentic-browsing` | AI agent compatibility checks | Yes |\n\n### Parameters\n\n| Parameter | Type | Required | Default | Description |\n|-----------|------|----------|---------|-------------|\n| `mode` | `navigation` \\| `snapshot` | No | `navigation` | `navigation` reloads & audits; `snapshot` analyzes current state |\n| `device` | `desktop` \\| `mobile` | No | `desktop` | Device emulation type |\n| `outputDirPath` | string | No | temp file | Directory for JSON reports |\n\n### Usage Workflow\n\n```mermaid\ngraph LR\n    A[Start Audit] --> B{Mode?}\n    B -->|navigation| C[Reload Page]\n    B -->|snapshot| D[Analyze Current State]\n    C --> E[Run Lighthouse]\n    D --> E\n    E --> F[Generate JSON Report]\n    F --> G[Parse Results]\n    G --> H[Return Scores & Failed Audits]\n```\n\n资料来源：[src/tools/lighthouse.ts:40-60]()\n\n## Performance Tracing\n\nThe performance tracing system captures Chrome DevTools performance data for deep analysis.\n\n### Available Tools\n\n| Tool | Purpose |\n|------|---------|\n| `performance_start_trace` | Begin recording performance trace |\n| `performance_stop_trace` | Stop recording and return trace data |\n| `performance_analyze_insight` | Get details on specific Performance Insights |\n\n### Trace Configuration\n\n| Parameter | Type | Description |\n|-----------|------|-------------|\n| `filePath` | string | Optional path to save trace file (`.gz` format) |\n| `reload` | boolean | Whether to reload the page before tracing |\n\n### LCP Analysis\n\nThe trace system integrates with LCP (Largest Contentful Paint) debugging:\n\n```javascript\nasync () => {\n  return await new Promise(resolve => {\n    new PerformanceObserver(list => {\n      const entries = list.getEntries();\n      const last = entries[entries.length - 1];\n      resolve({\n        element: last.element?.tagName,\n        id: last.element?.id,\n        className: last.element?.className,\n        url: last.url,\n        startTime: last.startTime,\n        renderTime: last.renderTime,\n        loadTime: last.loadTime,\n        size: last.size,\n      });\n    }).observe({type: 'largest-contentful-paint', buffered: true});\n  });\n};\n```\n\n资料来源：[skills/debug-optimize-lcp/references/lcp-snippets.md:1-30]()\n\n### LCP Subpart Breakdown\n\nLCP is measured across four subparts that sum to 100%:\n\n| Subpart | Target | Root Cause | Fixes |\n|---------|--------|------------|-------|\n| TTFB | ~40% | Slow server response | Minimize redirects, CDN caching, bfcache eligibility |\n| Resource Load Delay | ~10% | Late discovery | Remove lazy-loading, add preload/fetchpriority |\n| Resource Load Duration | ~40% | Large/slow resource | WebP/AVIF formats, CDN, compression |\n| Element Render Delay | <10% | Render blocking | Inline critical CSS, defer JS, break long tasks |\n\n资料来源：[skills/debug-optimize-lcp/SKILL.md:1-50]()\n\n## Memory Profiling\n\nThe memory profiling system captures and analyzes JavaScript heap snapshots.\n\n### Heap Snapshot Manager\n\nThe `HeapSnapshotManager` class handles snapshot lifecycle:\n\n```typescript\nexport class PageCollector<T> {\n  #browser: Browser;\n  protected storage = new WeakMap<Page, Array<Array<WithSymbolId<T>>>>();\n  protected maxNavigationSaved = 3;\n  \n  async init(pages: Page[]) {\n    for (const page of pages) {\n      this.addPage(page);\n    }\n  }\n}\n```\n\n资料来源：[src/PageCollector.ts:1-50]()\n\n### Snapshot Operations\n\n| Operation | CLI Command | Description |\n|-----------|-------------|-------------|\n| Capture | `take_memory_snapshot \"./path.snap\"` | Capture heap snapshot to file |\n| Format | `HeapSnapshotFormatter` | Parse and format snapshot data |\n| Analyze | Manual inspection | View node counts, shallow sizes, retainer paths |\n\n### Heap Snapshot Data Structure\n\nThe system processes snapshots with the following structure:\n\n| Field | Type | Description |\n|-------|------|-------------|\n| nodes | Node[] | Array of heap nodes |\n| edges | Edge[] | References between nodes |\n| strings | string[] | String table for node names |\n| trace_tree | TraceNode | Sampling profile data |\n\n资料来源：[src/formatters/HeapSnapshotFormatter.ts:1-30]()\n\n## Trace Processing\n\nThe trace processing module parses Chrome DevTools trace events.\n\n### Parser Functions\n\n```typescript\ninterface ParsedTraceEvent {\n  name: string;\n  cat: string;\n  ph: string;\n  ts: number;\n  dur?: number;\n  args?: Record<string, unknown>;\n}\n```\n\n资料来源：[src/trace-processing/parse.ts:1-20]()\n\n### Supported Event Types\n\n| Event Type | Phase Code | Description |\n|------------|------------|-------------|\n| Duration | B/E | Begin/End of an operation |\n| Complete | X | Operation with known duration |\n| Instant | i | Point-in-time event |\n| Counter | C | Numeric value at a point |\n| Async | b/n/t | Asynchronous operations |\n| Sample | P | CPU sampling profile |\n\n### Trace File Format\n\nTrace files can be saved in two formats:\n\n| Format | Extension | Compression |\n|--------|-----------|-------------|\n| JSON | `.json` | None |\n| Perfetto | `.gz` | gzip |\n\n## CLI Commands\n\nThe performance tools are accessible via the `chrome-devtools` CLI:\n\n### Performance Commands\n\n```bash\n# Start tracing with optional reload\nchrome-devtools performance_start_trace true false\n\n# Start trace and save to file\nchrome-devtools performance_start_trace true true --filePath trace.gz\n\n# Stop trace and optionally save\nchrome-devtools performance_stop_trace\nchrome-devtools performance_stop_trace --filePath \"t.json\"\n\n# Analyze Performance Insights\nchrome-devtools performance_analyze_insight \"1\" \"LCPBreakdown\"\n```\n\n资料来源：[skills/chrome-devtools-cli/SKILL.md:1-100]()\n\n### Memory Commands\n\n```bash\n# Capture heap snapshot\nchrome-devtools take_memory_snapshot \"./snap.heapsnapshot\"\n```\n\n### Emulation Commands\n\nFor realistic performance testing under constrained conditions:\n\n```bash\n# Network throttling\nchrome-devtools emulate --networkConditions \"Fast 3G\"\n\n# CPU throttling\nchrome-devtools emulate --cpuThrottlingRate 4\n\n# Combined emulation\nchrome-devtools emulate --networkConditions \"Slow 3G\" --cpuThrottlingRate 4\n```\n\n资料来源：[skills/chrome-devtools-cli/SKILL.md:80-120]()\n\n## Common Performance Issues\n\n### LCP Issues Checklist\n\n| Issue | Detection | Fix |\n|-------|-----------|-----|\n| Lazy-loaded LCP image | `loading=\"lazy\"` on viewport images | Remove lazy-loading |\n| Missing fetchpriority | `<img>` without `fetchpriority` | Add `fetchpriority=\"high\"` |\n| Missing preload | LCP image not in HTML | Add `<link rel=\"preload\">` |\n| Render-blocking CSS | Stylesheets in `<head>` | Inline critical CSS |\n| Large LCP resource | Slow load duration | Compress, use WebP/AVIF |\n\n资料来源：[skills/debug-optimize-lcp/references/optimization-strategies.md:1-50]()\n\n### JavaScript Snippet for Issue Detection\n\n```javascript\n() => {\n  const issues = [];\n\n  // Check for lazy-loaded images in viewport\n  document.querySelectorAll('img[loading=\"lazy\"]').forEach(img => {\n    const rect = img.getBoundingClientRect();\n    if (rect.top < window.innerHeight) {\n      issues.push({\n        issue: 'lazy-loaded image in viewport',\n        element: img.outerHTML.substring(0, 200),\n        fix: 'Remove loading=\"lazy\" from this image'\n      });\n    }\n  });\n\n  return issues;\n};\n```\n\n资料来源：[skills/debug-optimize-lcp/references/lcp-snippets.md:35-55]()\n\n## Test Scenarios\n\nThe repository includes test scenarios for performance tools:\n\n```typescript\nexport const scenario: TestScenario = {\n  prompt: 'Check the performance of https://developers.chrome.com',\n  maxTurns: 2,\n  expectations: calls => {\n    assert.strictEqual(calls.length, 2);\n    assert.ok(\n      calls[0].name === 'navigate_page' || calls[0].name === 'new_page',\n    );\n    assert.ok(calls[1].name === 'performance_start_trace');\n  },\n};\n```\n\n资料来源：[scripts/eval_scenarios/performance_test.ts:1-25]()\n\n## Related Documentation\n\n- [Lighthouse Documentation](https://developer.chrome.com/docs/lighthouse)\n- [Chrome DevTools Performance Panel](https://developer.chrome.com/docs/devtools/performance)\n- [Memory Profiling](https://developer.chrome.com/docs/devtools/memory-problems)\n- [LCP Web.dev Guide](https://web.dev/articles/lcp)\n\n---\n\n<a id='cli-reference'></a>\n\n## CLI Reference\n\n### 相关页面\n\n相关主题：[Configuration Reference](#configuration), [Installation and Setup](#installation), [System Architecture](#system-architecture)\n\n<details>\n<summary>相关源码文件</summary>\n\n以下源码文件用于生成本页说明：\n\n- [src/bin/chrome-devtools.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/bin/chrome-devtools.ts)\n- [src/bin/chrome-devtools-cli-options.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/bin/chrome-devtools-cli-options.ts)\n- [src/tools/slim/tools.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/tools/slim/tools.ts)\n- [docs/cli.md](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/docs/cli.md)\n- [docs/slim-tool-reference.md](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/docs/slim-tool-reference.md)\n</details>\n\n# CLI Reference\n\nThe `chrome-devtools-mcp` CLI provides a command-line interface for interacting with Chrome DevTools, enabling browser automation, page manipulation, performance analysis, and network inspection directly from the terminal.\n\n## Overview\n\nThe CLI is built on top of the Model Context Protocol (MCP) and serves as the primary interface for users who prefer terminal-based workflows over programmatic SDK integration. It wraps the MCP server functionality into a user-friendly command structure.\n\n```mermaid\ngraph TD\n    A[User Terminal] -->|chrome-devtools command| B[CLI Entry Point]\n    B --> C[chrome-devtools-cli-options.ts]\n    C --> D[Argument Parsing]\n    D --> E[chrome-devtools-mcp Server]\n    E --> F[Chrome Browser Instance]\n    F --> G[Page Context]\n    G --> H[Tool Execution]\n    H --> I[Response Output]\n```\n\n资料来源：[skills/chrome-devtools-cli/SKILL.md]()\n\n## Command Structure\n\nThe general command syntax follows:\n\n```bash\nchrome-devtools <tool> [arguments] [flags]\n```\n\n### Global Flags\n\n| Flag | Description |\n|------|-------------|\n| `--help` | Display help message for any command |\n| `--output-format=json` | Return output in JSON format instead of Markdown |\n| `--viaCli` | Internal flag for CLI-to-server communication |\n\n资料来源：[skills/chrome-devtools-cli/SKILL.md]()\n\n## Service Management Commands\n\nThese commands control the lifecycle of the chrome-devtools-mcp server.\n\n```bash\nchrome-devtools start   # Start or restart chrome-devtools-mcp\nchrome-devtools status  # Check if chrome-devtools-mcp is running\nchrome-devtools stop    # Stop chrome-devtools-mcp if any\n```\n\nThe background server starts implicitly on first tool call. Users should **not** run `start`/`status`/`stop` before each use.\n\n资料来源：[skills/chrome-devtools-cli/SKILL.md]()\n\n## Navigation Commands\n\n### Page Navigation\n\n| Command | Description |\n|---------|-------------|\n| `navigate_page --url \"https://example.com\"` | Navigate the currently selected page to a URL |\n| `navigate_page --type \"reload\" --ignoreCache true` | Reload page ignoring cache |\n| `navigate_page --url \"https://example.com\" --timeout 5000` | Navigate with a timeout |\n| `navigate_page --handleBeforeUnload \"accept\"` | Handle before unload dialog |\n| `navigate_page --type \"back\" --initScript \"foo()\"` | Navigate back and run an init script |\n\n### Page Management\n\n| Command | Description |\n|---------|-------------|\n| `new_page \"https://example.com\"` | Create a new page |\n| `new_page \"https://example.com\" --background true --timeout 5000` | Create new page in background |\n| `new_page \"https://example.com\" --isolatedContext \"ctx\"` | Create page with isolated context |\n| `select_page 1` | Select a page as context for future tool calls |\n| `select_page 1 --bringToFront true` | Select page and bring it to front |\n| `close_page 1` | Close a page by its index |\n| `list_pages` | List all pages open in the browser |\n\n资料来源：[skills/chrome-devtools-cli/SKILL.md]()\n\n## Input Automation Commands\n\nThese commands interact with elements identified by `uid` from snapshot operations.\n\n### Element Interaction\n\n| Command | Description |\n|---------|-------------|\n| `take_snapshot` | Take a text snapshot of the page to get UIDs |\n| `click \"id\"` | Click on the provided element |\n| `click \"id\" --dblClick true --includeSnapshot true` | Double click and return snapshot |\n| `hover \"id\"` | Hover over the provided element |\n| `hover \"id\" --includeSnapshot true` | Hover and return snapshot |\n| `drag \"src\" \"dst\"` | Drag an element onto another element |\n| `fill \"id\" \"text\"` | Type text into an input or select an option |\n\n### Keyboard and Text Input\n\n| Command | Description |\n|---------|-------------|\n| `press_key \"Enter\"` | Press a key or key combination |\n| `press_key \"Control+A\" --includeSnapshot true` | Press a key and return snapshot |\n| `type_text \"hello\"` | Type text using keyboard into a focused input |\n| `type_text \"hello\" --submitKey \"Enter\"` | Type text and press a submit key |\n\n### File Upload\n\n| Command | Description |\n|---------|-------------|\n| `upload_file \"id\" \"file.txt\"` | Upload a file through a provided element |\n| `upload_file \"id\" \"file.txt\" --includeSnapshot true` | Upload and return snapshot |\n\n### Dialog Handling\n\n| Command | Description |\n|---------|-------------|\n| `handle_dialog accept` | Accept a browser dialog |\n| `handle_dialog dismiss --promptText \"hi\"` | Dismiss a dialog with prompt text |\n\n资料来源：[skills/chrome-devtools-cli/SKILL.md]()\n\n## Emulation Commands\n\n### Network Conditions\n\n```bash\nchrome-devtools emulate --networkConditions \"Offline\"\n```\n\n### Performance Emulation\n\n```bash\nchrome-devtools emulate --cpuThrottlingRate 4 --geolocation \"0x0\"\n```\n\n### Visual Emulation\n\n```bash\nchrome-devtools emulate --colorScheme \"dark\" --viewport \"1920x1080\"\nchrome-devtools emulate --userAgent \"Mozilla/5.0...\"\nchrome-devtools resize_page 1920 1080\n```\n\n资料来源：[skills/chrome-devtools-cli/SKILL.md]()\n\n## Performance Commands\n\n### Tracing\n\n| Command | Description |\n|---------|-------------|\n| `performance_start_trace true false` | Start performance trace recording |\n| `performance_start_trace true true --filePath t.gz` | Start trace and save to compressed file |\n| `performance_stop_trace` | Stop the active performance trace |\n| `performance_stop_trace --filePath \"t.json\"` | Stop trace and save to file |\n\n### Analysis\n\n| Command | Description |\n|---------|-------------|\n| `performance_analyze_insight \"1\" \"LCPBreakdown\"` | Get details on a Performance Insight |\n| `take_memory_snapshot \"./snap.heapsnapshot\"` | Capture a memory heapsnapshot |\n\n资料来源：[skills/chrome-devtools-cli/SKILL.md]()\n\n## Extension Management Commands\n\n| Command | Description |\n|---------|-------------|\n| `list_extensions` | List all installed Chrome extensions |\n| `install_extension \"/path/to/extension\"` | Install a Chrome extension |\n| `uninstall_extension \"extension_id\"` | Uninstall a Chrome extension |\n| `reload_extension \"extension_id\"` | Reload an unpacked Chrome extension |\n| `trigger_extension_action \"extension_id\"` | Trigger the default action of an extension |\n\n资料来源：[skills/chrome-devtools-cli/SKILL.md]()\n\n## Experimental Features\n\nExperimental tools require specific flags during server startup:\n\n```bash\n--experimentalVision=true   # Enable coordinate-based clicking\n--experimentalScreencast=true # Enable screencast (requires ffmpeg)\n--categoryExperimentalWebmcp=true # Enable WebMCP tools\n```\n\n### Experimental Commands\n\n| Command | Description | Required Flag |\n|---------|-------------|---------------|\n| `click_at 100 200` | Click at coordinates | `--experimentalVision=true` |\n| `screencast_start` | Start screencast recording | `--experimentalScreencast=true` |\n| `screencast_stop` | Stop active screencast | `--experimentalScreencast=true` |\n| `list_webmcp_tools` | List all WebMCP tools | `--categoryExperimentalWebmcp=true` |\n\n资料来源：[skills/chrome-devtools-cli/SKILL.md]()\n\n## WebMCP Tools\n\nWebMCP tools are exposed by the page itself and allow pages to define custom tools that the CLI can invoke.\n\n```bash\nchrome-devtools list_webmcp_tools    # List all WebMCP tools the page exposes\nchrome-devtools execute_webmcp_tool \"toolName\" --input '{\"key\": \"value\"}'\n```\n\n资料来源：[src/tools/webmcp.ts]()\n\n## Tool Categories\n\nThe CLI tools are organized into categories that can be enabled or disabled:\n\n| Category | Description | Default |\n|----------|-------------|---------|\n| Navigation | Page navigation and management | On |\n| Interaction | Element click, fill, hover, drag | On |\n| Input | Keyboard, text input, file upload | On |\n| Emulation | Network, device, viewport emulation | On |\n| Performance | Tracing, memory, insights | On |\n| Extensions | Chrome extension management | Off |\n| Experimental | Vision, screencast, WebMCP | Off |\n| WebMCP | Page-exposed tools | Off |\n\nCategories can be enabled via CLI flags:\n\n```bash\nchrome-devtools --categoryExtensions=true <tool>\n```\n\n资料来源：[skills/chrome-devtools/SKILL.md]()\n\n## Snapshot Format\n\nThe `take_snapshot` command returns a hierarchical tree structure:\n\n```\nuid=1_0 RootWebArea \"Example Domain\" url=\"https://example.com/\"\n  uid=1_1 heading \"Example Domain\" level=\"1\"\n  uid=1_2 link \"Learn more\" href=\"https://example.com/about\"\n```\n\nEach element has a unique `uid` for interaction. The format shows:\n- Element type (RootWebArea, heading, link, etc.)\n- Text content\n- Attributes (level, href, url)\n- Unique identifier (uid) for command targeting\n\n资料来源：[skills/chrome-devtools-cli/SKILL.md]()\n\n## Workflow Patterns\n\n```mermaid\ngraph LR\n    A[navigate_page] --> B[wait_for]\n    B --> C[take_snapshot]\n    C --> D{Get uid}\n    D --> E[Interact with element]\n    E --> F[click/fill/hover]\n    F --> G[includeSnapshot?]\n    G -->|Yes| C\n    G -->|No| H[Continue]\n```\n\n### Before Interacting with a Page\n\n1. **Navigate**: Use `navigate_page` or `new_page`\n2. **Wait**: Use `wait_for` to ensure content is loaded\n3. **Snapshot**: Use `take_snapshot` to understand page structure\n4. **Interact**: Use element `uid`s from snapshot for commands\n\n### Efficient Data Retrieval\n\n- Use `filePath` parameter for large outputs (screenshots, snapshots, traces)\n- Use pagination (`pageIdx`, `pageSize`) and filtering (`types`) to minimize data\n- Set `includeSnapshot: false` on input actions unless you need updated page state\n\n资料来源：[skills/chrome-devtools/SKILL.md]()\n\n## Slim Mode\n\nThe `--slim` mode provides a minimal set of tools focused on core navigation and interaction, without additional features like performance tracing or extensions.\n\nAvailable slim tools include essential navigation and element interaction commands.\n\n资料来源：[docs/slim-tool-reference.md]()\n\n## CLI Options Configuration\n\nThe CLI accepts the following configuration options (from `src/bin/chrome-devtools-cli-options.ts`):\n\n| Option | Type | Description |\n|--------|------|-------------|\n| `--slim` | boolean | Enable slim mode with reduced toolset |\n| `--chromePath` | string | Path to Chrome executable |\n| `--userDataDir` | string | Chrome profile directory |\n| `--port` | number | Server port |\n| `--host` | string | Server host |\n| `--experimentalVision` | boolean | Enable vision-based tools |\n| `--experimentalScreencast` | boolean | Enable screencast |\n| `--categoryExtensions` | boolean | Enable extension tools |\n| `--categoryExperimentalWebmcp` | boolean | Enable WebMCP tools |\n\n资料来源：[src/bin/chrome-devtools-cli-options.ts]()\n\n## MCP Server Integration\n\n```mermaid\nsequenceDiagram\n    participant User\n    participant CLI\n    participant MCPServer\n    participant Chrome\n    \n    User->>CLI: chrome-devtools navigate_page\n    CLI->>MCPServer: Tool Request\n    MCPServer->>Chrome: CDP Command\n    Chrome-->>MCPServer: CDP Response\n    MCPServer-->>CLI: Tool Response\n    CLI-->>User: Formatted Output\n```\n\nThe CLI communicates with the MCP server using the Model Context Protocol over stdio transport. The server spawns Chrome as a child process and manages CDP (Chrome DevTools Protocol) connections.\n\n资料来源：[scripts/generate-cli.ts]()\n\n## Installation\n\n```bash\nnpm i chrome-devtools-mcp@latest -g\nchrome-devtools status  # Verify installation\n```\n\n### Troubleshooting\n\n| Issue | Solution |\n|-------|----------|\n| Command not found | Ensure global npm `bin` directory is in PATH |\n| Permission errors | Use node version manager (nvm) instead of sudo |\n| Old version running | Run `chrome-devtools stop && npm uninstall -g chrome-devtools-mcp` |\n\n资料来源：[skills/chrome-devtools-cli/references/installation.md]()\n\n## Development Scripts\n\nFrom `package.json`:\n\n| Script | Command | Purpose |\n|--------|---------|---------|\n| `build` | `tsc && test build` | Compile TypeScript and verify build |\n| `test` | `build && run all tests` | Run complete test suite |\n| `test <path>` | `build && run single test` | Run specific test file |\n| `format` | `fix formatting` | Apply formatting and show linting errors |\n| `gen` | `generate documentation` | Regenerate tool reference docs |\n\n资料来源：[AGENTS.md]()\n\n## TypeScript Rules\n\nThe codebase follows strict TypeScript guidelines:\n\n- No `any` type\n- No `as` keyword for type casting\n- No `!` operator for type assertion\n- No `// @ts-ignore` comments\n- Prefer `for..of` over `forEach`\n\n资料来源：[AGENTS.md]()\n\n---\n\n<a id='telemetry'></a>\n\n## Telemetry and Monitoring\n\n### 相关页面\n\n相关主题：[System Architecture](#system-architecture), [Configuration Reference](#configuration)\n\n# Telemetry and Monitoring\n\n## Overview\n\nThe chrome-devtools-mcp project implements a telemetry and monitoring system located in the `src/telemetry/` directory. This system is responsible for collecting, logging, and persisting usage metrics and error data from the MCP server operations.\n\n## System Architecture\n\nThe telemetry system comprises several interconnected components that work together to capture and report server behavior:\n\n```mermaid\ngraph TD\n    A[Tool Execution] --> B[Metrics Registry]\n    A --> C[Clearcut Logger]\n    B --> D[Persistence Layer]\n    C --> D\n    D --> E[Metrics Export]\n    F[Watchdog Client] --> C\n    G[Errors Module] --> C\n```\n\n## Core Components\n\n### 1. Metrics Registry (`metricsRegistry.ts`)\n\nThe metrics registry tracks tool call statistics and flag usage across the MCP server. It maintains counters and aggregations for:\n\n- Tool invocation counts\n- Flag usage patterns\n- Performance-related metrics\n\nThe registry is populated by data defined in `tool_call_metrics.json` and `flag_usage_metrics.json`, which define the specific metrics to be tracked.\n\n**资料来源:** [src/telemetry/metricsRegistry.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/telemetry/metricsRegistry.ts)\n\n### 2. Clearcut Logger (`ClearcutLogger.ts`)\n\nClearcutLogger is the primary logging mechanism for telemetry data. It handles:\n\n- Structured logging of events\n- Connection to telemetry backends\n- Batch processing of log entries\n\n**资料来源:** [src/telemetry/ClearcutLogger.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/telemetry/ClearcutLogger.ts)\n\n### 3. Watchdog Client (`WatchdogClient.ts`)\n\nThe WatchdogClient provides health monitoring functionality for the MCP server. It:\n\n- Monitors server responsiveness\n- Tracks resource utilization\n- Reports health status to external monitoring systems\n\n**资料来源:** [src/telemetry/WatchdogClient.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/telemetry/WatchdogClient.ts)\n\n### 4. Errors Module (`errors.ts`)\n\nThe errors module handles error telemetry and reporting:\n\n- Captures error conditions during tool execution\n- Categorizes errors by type and severity\n- Provides structured error data for logging\n\n**资料来源:** [src/telemetry/errors.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/telemetry/errors.ts)\n\n### 5. Persistence Layer (`persistence.ts`)\n\nThe persistence module manages storage of telemetry data:\n\n- Buffers metrics before transmission\n- Handles local caching of data\n- Manages data retention policies\n\n**资料来源:** [src/telemetry/persistence.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/telemetry/persistence.ts)\n\n### 6. Types (`types.ts`)\n\nCentral type definitions for all telemetry components including:\n\n- Metric data structures\n- Log entry formats\n- Configuration interfaces\n\n**资料来源:** [src/telemetry/types.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/telemetry/types.ts)\n\n## Metrics Configuration\n\n### Tool Call Metrics (`tool_call_metrics.json`)\n\nThis JSON file defines which tools should have their invocations tracked. The format includes tool names and associated metadata for metrics collection.\n\n**资料来源:** [src/telemetry/tool_call_metrics.json](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/telemetry/tool_call_metrics.json)\n\n### Flag Usage Metrics (`flag_usage_metrics.json`)\n\nThis configuration file tracks usage patterns of command-line flags and configuration options passed to the MCP server.\n\n**资料来源:** [src/telemetry/flag_usage_metrics.json](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/telemetry/flag_usage_metrics.json)\n\n## Data Flow\n\n```mermaid\nsequenceDiagram\n    participant User as User/Tool\n    participant Registry as Metrics Registry\n    participant Logger as Clearcut Logger\n    participant Persistence as Persistence Layer\n    participant Backend as Telemetry Backend\n\n    User->>Registry: Record metric\n    Registry->>Persistence: Buffer data\n    User->>Logger: Log event\n    Logger->>Persistence: Batch events\n    Persistence->>Backend: Flush data\n    Backend-->>Persistence: Acknowledge\n```\n\n## Integration with Tool System\n\nThe telemetry system integrates with the tool definition infrastructure defined in `ToolDefinition.ts`. Tool execution flows through the telemetry system enabling automatic metrics collection.\n\n**资料来源:** [src/tools/ToolDefinition.ts:1-75](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/tools/ToolDefinition.ts)\n\n## WaitForHelper Integration\n\nThe `WaitForHelper` class handles navigation and event timing which feeds into performance telemetry. It tracks navigation events and DOM stability which are essential for understanding tool execution performance.\n\n**资料来源:** [src/WaitForHelper.ts:1-60](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/WaitForHelper.ts)\n\n## PageCollector Event Monitoring\n\nThe `PageCollector` class monitors page lifecycle events that contribute to telemetry data:\n\n- Target creation/destruction events\n- Navigation events\n- Resource loading patterns\n\n**资料来源:** [src/PageCollector.ts:1-60](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/PageCollector.ts)\n\n## Debug Logging\n\nFor troubleshooting telemetry issues, the project supports debug logging via the `DEBUG` environment variable. To write debug logs to a file:\n\n```sh\nnpx @modelcontextprotocol/inspector node /build/src/bin/chrome-devtools-mcp.js --log-file=/your/desired/path/log.txt\n```\n\n**资料来源:** [CONTRIBUTING.md](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/CONTRIBUTING.md)\n\n## Configuration Options\n\n| Option | Description | Default |\n|--------|-------------|---------|\n| `DEBUG` | Enable debug categories | undefined |\n| `--log-file` | Output debug logs to file | stdout |\n| Telemetry flags | Per-metric enable/disable | Enabled |\n\n## Best Practices\n\n1. **Review metrics before adding new ones** - Ensure the metric provides meaningful insight\n2. **Use structured logging** - Prefer the ClearcutLogger for consistency\n3. **Handle telemetry failures gracefully** - Telemetry should not block tool execution\n4. **Test metrics collection** - Verify metrics are recorded correctly in test scenarios\n\n**资料来源:** [CONTRIBUTING.md](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/CONTRIBUTING.md)\n\n## Related Documentation\n\n- [AGENTS.md](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/AGENTS.md) - General project instructions\n- [CONTRIBUTING.md](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/CONTRIBUTING.md) - Debugging and development guide\n- [skills/chrome-devtools/SKILL.md](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/skills/chrome-devtools/SKILL.md) - Tool usage patterns\n\n---\n\n---\n\n## Doramagic 踩坑日志\n\n项目：ChromeDevTools/chrome-devtools-mcp\n\n摘要：发现 18 个潜在踩坑项，其中 1 个为 high/blocking；最高优先级：配置坑 - 来源证据：performance_start_trace records 'CPU throttling: none / Network throttling: none' despite emulate setting throttling —…。\n\n## 1. 配置坑 · 来源证据：performance_start_trace records 'CPU throttling: none / Network throttling: none' despite emulate setting throttling —…\n\n- 严重度：high\n- 证据强度：source_linked\n- 发现：GitHub 社区证据显示该项目存在一个配置相关的待验证问题：performance_start_trace records 'CPU throttling: none / Network throttling: none' despite emulate setting throttling — measurements come back partially or full…\n- 对用户的影响：可能增加新用户试用和生产接入成本。\n- 建议检查：来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。\n- 防护动作：不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- 证据：community_evidence:github | cevd_644cef1d4144424abe63f24528f5d082 | https://github.com/ChromeDevTools/chrome-devtools-mcp/issues/1955 | 来源讨论提到 macos 相关条件，需在安装/试用前复核。\n\n## 2. 安装坑 · 来源证据：Auto-connect doesn't work on WSL with mirrored networking (Chrome on Windows host)\n\n- 严重度：medium\n- 证据强度：source_linked\n- 发现：GitHub 社区证据显示该项目存在一个安装相关的待验证问题：Auto-connect doesn't work on WSL with mirrored networking (Chrome on Windows host)\n- 对用户的影响：可能增加新用户试用和生产接入成本。\n- 建议检查：来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。\n- 防护动作：不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- 证据：community_evidence:github | cevd_3275fc356e284918a94cf8c2c037caee | https://github.com/ChromeDevTools/chrome-devtools-mcp/issues/2004 | 来源讨论提到 windows 相关条件，需在安装/试用前复核。\n\n## 3. 安装坑 · 来源证据：Update check hardcodes registry.npmjs.org, ignoring user's npm registry configuration\n\n- 严重度：medium\n- 证据强度：source_linked\n- 发现：GitHub 社区证据显示该项目存在一个安装相关的待验证问题：Update check hardcodes registry.npmjs.org, ignoring user's npm registry configuration\n- 对用户的影响：可能阻塞安装或首次运行。\n- 建议检查：来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。\n- 防护动作：不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- 证据：community_evidence:github | cevd_1946d257bfb04c23a67250da4d584631 | https://github.com/ChromeDevTools/chrome-devtools-mcp/issues/1943 | 来源讨论提到 node 相关条件，需在安装/试用前复核。\n\n## 4. 安装坑 · 来源证据：chrome-devtools-mcp: v0.20.1\n\n- 严重度：medium\n- 证据强度：source_linked\n- 发现：GitHub 社区证据显示该项目存在一个安装相关的待验证问题：chrome-devtools-mcp: v0.20.1\n- 对用户的影响：可能增加新用户试用和生产接入成本。\n- 建议检查：来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。\n- 防护动作：不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- 证据：community_evidence:github | cevd_11700367e17048138ab79571d751cec4 | https://github.com/ChromeDevTools/chrome-devtools-mcp/releases/tag/chrome-devtools-mcp-v0.20.1 | 来源类型 github_release 暴露的待验证使用条件。\n\n## 5. 安装坑 · 来源证据：chrome-devtools-mcp: v0.22.0\n\n- 严重度：medium\n- 证据强度：source_linked\n- 发现：GitHub 社区证据显示该项目存在一个安装相关的待验证问题：chrome-devtools-mcp: v0.22.0\n- 对用户的影响：可能增加新用户试用和生产接入成本。\n- 建议检查：来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。\n- 防护动作：不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- 证据：community_evidence:github | cevd_6ff69eabdc334130b7b093706390c6c1 | https://github.com/ChromeDevTools/chrome-devtools-mcp/releases/tag/chrome-devtools-mcp-v0.22.0 | 来源类型 github_release 暴露的待验证使用条件。\n\n## 6. 配置坑 · 来源证据：chrome-devtools-mcp: v0.21.0\n\n- 严重度：medium\n- 证据强度：source_linked\n- 发现：GitHub 社区证据显示该项目存在一个配置相关的待验证问题：chrome-devtools-mcp: v0.21.0\n- 对用户的影响：可能增加新用户试用和生产接入成本。\n- 建议检查：来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。\n- 防护动作：不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- 证据：community_evidence:github | cevd_41b2681dc7ae4bbabdb071511fdc0191 | https://github.com/ChromeDevTools/chrome-devtools-mcp/releases/tag/chrome-devtools-mcp-v0.21.0 | 来源类型 github_release 暴露的待验证使用条件。\n\n## 7. 能力坑 · 能力判断依赖假设\n\n- 严重度：medium\n- 证据强度：source_linked\n- 发现：README/documentation is current enough for a first validation pass.\n- 对用户的影响：假设不成立时，用户拿不到承诺的能力。\n- 建议检查：将假设转成下游验证清单。\n- 防护动作：假设必须转成验证项；没有验证结果前不能写成事实。\n- 证据：capability.assumptions | github_repo:1054793726 | https://github.com/ChromeDevTools/chrome-devtools-mcp | README/documentation is current enough for a first validation pass.\n\n## 8. 运行坑 · 来源证据：chrome-devtools-mcp: v0.20.0\n\n- 严重度：medium\n- 证据强度：source_linked\n- 发现：GitHub 社区证据显示该项目存在一个运行相关的待验证问题：chrome-devtools-mcp: v0.20.0\n- 对用户的影响：可能增加新用户试用和生产接入成本。\n- 建议检查：来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。\n- 防护动作：不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- 证据：community_evidence:github | cevd_8bef6b0b7a80406ab00a0576f82b35a7 | https://github.com/ChromeDevTools/chrome-devtools-mcp/releases/tag/chrome-devtools-mcp-v0.20.0 | 来源类型 github_release 暴露的待验证使用条件。\n\n## 9. 运行坑 · 来源证据：chrome-devtools-mcp: v0.24.0\n\n- 严重度：medium\n- 证据强度：source_linked\n- 发现：GitHub 社区证据显示该项目存在一个运行相关的待验证问题：chrome-devtools-mcp: v0.24.0\n- 对用户的影响：可能增加新用户试用和生产接入成本。\n- 建议检查：来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。\n- 防护动作：不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- 证据：community_evidence:github | cevd_e42176fdf7da4015ac82844a46f37c08 | https://github.com/ChromeDevTools/chrome-devtools-mcp/releases/tag/chrome-devtools-mcp-v0.24.0 | 来源类型 github_release 暴露的待验证使用条件。\n\n## 10. 运行坑 · 来源证据：chrome-devtools-mcp: v0.26.0\n\n- 严重度：medium\n- 证据强度：source_linked\n- 发现：GitHub 社区证据显示该项目存在一个运行相关的待验证问题：chrome-devtools-mcp: v0.26.0\n- 对用户的影响：可能增加新用户试用和生产接入成本。\n- 建议检查：来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。\n- 防护动作：不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- 证据：community_evidence:github | cevd_a6cf1fa6206f48e6a9e88a5d9d00fd64 | https://github.com/ChromeDevTools/chrome-devtools-mcp/releases/tag/chrome-devtools-mcp-v0.26.0 | 来源类型 github_release 暴露的待验证使用条件。\n\n## 11. 维护坑 · 维护活跃度未知\n\n- 严重度：medium\n- 证据强度：source_linked\n- 发现：未记录 last_activity_observed。\n- 对用户的影响：新项目、停更项目和活跃项目会被混在一起，推荐信任度下降。\n- 建议检查：补 GitHub 最近 commit、release、issue/PR 响应信号。\n- 防护动作：维护活跃度未知时，推荐强度不能标为高信任。\n- 证据：evidence.maintainer_signals | github_repo:1054793726 | https://github.com/ChromeDevTools/chrome-devtools-mcp | last_activity_observed missing\n\n## 12. 安全/权限坑 · 下游验证发现风险项\n\n- 严重度：medium\n- 证据强度：source_linked\n- 发现：no_demo\n- 对用户的影响：下游已经要求复核，不能在页面中弱化。\n- 建议检查：进入安全/权限治理复核队列。\n- 防护动作：下游风险存在时必须保持 review/recommendation 降级。\n- 证据：downstream_validation.risk_items | github_repo:1054793726 | https://github.com/ChromeDevTools/chrome-devtools-mcp | no_demo; severity=medium\n\n## 13. 安全/权限坑 · 存在安全注意事项\n\n- 严重度：medium\n- 证据强度：source_linked\n- 发现：No sandbox install has been executed yet; downstream must verify before user use.\n- 对用户的影响：用户安装前需要知道权限边界和敏感操作。\n- 建议检查：转成明确权限清单和安全审查提示。\n- 防护动作：安全注意事项必须面向用户前置展示。\n- 证据：risks.safety_notes | github_repo:1054793726 | https://github.com/ChromeDevTools/chrome-devtools-mcp | No sandbox install has been executed yet; downstream must verify before user use.\n\n## 14. 安全/权限坑 · 存在评分风险\n\n- 严重度：medium\n- 证据强度：source_linked\n- 发现：no_demo\n- 对用户的影响：风险会影响是否适合普通用户安装。\n- 建议检查：把风险写入边界卡，并确认是否需要人工复核。\n- 防护动作：评分风险必须进入边界卡，不能只作为内部分数。\n- 证据：risks.scoring_risks | github_repo:1054793726 | https://github.com/ChromeDevTools/chrome-devtools-mcp | no_demo; severity=medium\n\n## 15. 安全/权限坑 · 来源证据：Close empty-object tool schemas for stricter MCP client validation\n\n- 严重度：medium\n- 证据强度：source_linked\n- 发现：GitHub 社区证据显示该项目存在一个安全/权限相关的待验证问题：Close empty-object tool schemas for stricter MCP client validation\n- 对用户的影响：可能增加新用户试用和生产接入成本。\n- 建议检查：来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。\n- 防护动作：不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- 证据：community_evidence:github | cevd_2af67f120a9d4486998a92da71a92cb9 | https://github.com/ChromeDevTools/chrome-devtools-mcp/issues/2049 | 来源类型 github_issue 暴露的待验证使用条件。\n\n## 16. 安全/权限坑 · 来源证据：chrome-devtools-mcp: v0.25.0\n\n- 严重度：medium\n- 证据强度：source_linked\n- 发现：GitHub 社区证据显示该项目存在一个安全/权限相关的待验证问题：chrome-devtools-mcp: v0.25.0\n- 对用户的影响：可能影响授权、密钥配置或安全边界。\n- 建议检查：来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。\n- 防护动作：不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- 证据：community_evidence:github | cevd_51ee93809f08423dbc7b6c0d3eeddc77 | https://github.com/ChromeDevTools/chrome-devtools-mcp/releases/tag/chrome-devtools-mcp-v0.25.0 | 来源类型 github_release 暴露的待验证使用条件。\n\n## 17. 维护坑 · issue/PR 响应质量未知\n\n- 严重度：low\n- 证据强度：source_linked\n- 发现：issue_or_pr_quality=unknown。\n- 对用户的影响：用户无法判断遇到问题后是否有人维护。\n- 建议检查：抽样最近 issue/PR，判断是否长期无人处理。\n- 防护动作：issue/PR 响应未知时，必须提示维护风险。\n- 证据：evidence.maintainer_signals | github_repo:1054793726 | https://github.com/ChromeDevTools/chrome-devtools-mcp | issue_or_pr_quality=unknown\n\n## 18. 维护坑 · 发布节奏不明确\n\n- 严重度：low\n- 证据强度：source_linked\n- 发现：release_recency=unknown。\n- 对用户的影响：安装命令和文档可能落后于代码，用户踩坑概率升高。\n- 建议检查：确认最近 release/tag 和 README 安装命令是否一致。\n- 防护动作：发布节奏未知或过期时，安装说明必须标注可能漂移。\n- 证据：evidence.maintainer_signals | github_repo:1054793726 | https://github.com/ChromeDevTools/chrome-devtools-mcp | release_recency=unknown\n\n<!-- canonical_name: ChromeDevTools/chrome-devtools-mcp; human_manual_source: deepwiki_human_wiki -->\n",
      "markdown_key": "chrome-devtools-mcp",
      "pages": "draft",
      "source_refs": [
        {
          "evidence_id": "github_repo:1054793726",
          "kind": "repo",
          "supports_claim_ids": [
            "claim_identity",
            "claim_distribution",
            "claim_capability"
          ],
          "url": "https://github.com/ChromeDevTools/chrome-devtools-mcp"
        },
        {
          "evidence_id": "art_a76aea3a129743bfabc951e284a6d049",
          "kind": "docs",
          "supports_claim_ids": [
            "claim_identity",
            "claim_distribution",
            "claim_capability"
          ],
          "url": "https://github.com/ChromeDevTools/chrome-devtools-mcp#readme"
        }
      ],
      "summary": "DeepWiki/Human Wiki 完整输出，末尾追加 Discovery Agent 踩坑日志。",
      "title": "chrome-devtools-mcp 说明书",
      "toc": [
        "https://github.com/ChromeDevTools/chrome-devtools-mcp 项目说明书",
        "目录",
        "Project Overview",
        "Introduction",
        "Core Purpose and Scope",
        "Architecture Overview",
        "Tool Categories",
        "Page Management System",
        "Doramagic 踩坑日志"
      ]
    }
  },
  "quality_gate": {
    "blocking_gaps": [],
    "category_confidence": "medium",
    "compile_status": "ready_for_review",
    "five_assets_present": true,
    "install_sandbox_verified": true,
    "missing_evidence": [],
    "next_action": "publish to Doramagic.ai project surfaces",
    "prompt_preview_boundary_ok": true,
    "publish_status": "publishable",
    "quick_start_verified": true,
    "repo_clone_verified": true,
    "repo_commit": "3efd8c019416ddc83316fd7c4c8803a7c7367837",
    "repo_inspection_error": null,
    "repo_inspection_files": [
      "package.json",
      "README.md",
      "docs/cli.md",
      "docs/troubleshooting.md",
      "docs/third-party-developer-tools.md",
      "docs/debugging-android.md",
      "docs/design-principles.md",
      "docs/slim-tool-reference.md",
      "docs/tool-reference.md",
      "src/HeapSnapshotManager.ts",
      "src/logger.ts",
      "src/PageCollector.ts",
      "src/McpContext.ts",
      "src/devtools.d.ts",
      "src/version.ts",
      "src/DevToolsConnectionAdapter.ts",
      "src/issue-descriptions.ts",
      "src/McpPage.ts",
      "src/index.ts",
      "src/types.ts",
      "src/TextSnapshot.ts",
      "src/McpResponse.ts",
      "src/DevtoolsUtils.ts",
      "src/SlimMcpResponse.ts",
      "src/browser.ts",
      "src/WaitForHelper.ts",
      "src/polyfill.ts",
      "src/Mutex.ts",
      "src/ToolHandler.ts",
      "src/bin/chrome-devtools-mcp-cli-options.ts",
      "src/bin/chrome-devtools.ts",
      "src/bin/chrome-devtools-mcp-main.ts",
      "src/bin/check-latest-version.ts",
      "src/bin/chrome-devtools-cli-options.ts",
      "src/bin/chrome-devtools-mcp.ts",
      "src/third_party/devtools-heap-snapshot-worker.ts",
      "src/third_party/index.ts",
      "src/third_party/lighthouse-devtools-mcp-bundle.js",
      "src/third_party/devtools-formatter-worker.ts",
      "src/telemetry/tool_call_metrics.json"
    ],
    "repo_inspection_verified": true,
    "review_reasons": [],
    "tag_count_ok": true,
    "unsupported_claims": []
  },
  "schema_version": "0.1",
  "user_assets": {
    "ai_context_pack": {
      "asset_id": "ai_context_pack",
      "filename": "AI_CONTEXT_PACK.md",
      "markdown": "# chrome-devtools-mcp - Doramagic AI Context Pack\n\n> 定位：安装前体验与判断资产。它帮助宿主 AI 有一个好的开始，但不代表已经安装、执行或验证目标项目。\n\n## 充分原则\n\n- **充分原则，不是压缩原则**：AI Context Pack 应该充分到让宿主 AI 在开工前理解项目价值、能力边界、使用入口、风险和证据来源；它可以分层组织，但不以最短摘要为目标。\n- **压缩策略**：只压缩噪声和重复内容，不压缩会影响判断和开工质量的上下文。\n\n## 给宿主 AI 的使用方式\n\n你正在读取 Doramagic 为 chrome-devtools-mcp 编译的 AI Context Pack。请把它当作开工前上下文：帮助用户理解适合谁、能做什么、如何开始、哪些必须安装后验证、风险在哪里。不要声称你已经安装、运行或执行了目标项目。\n\n## Claim 消费规则\n\n- **事实来源**：Repo Evidence + Claim/Evidence Graph；Human Wiki 只提供显著性、术语和叙事结构。\n- **事实最低状态**：`supported`\n- `supported`：可以作为项目事实使用，但回答中必须引用 claim_id 和证据路径。\n- `weak`：只能作为低置信度线索，必须要求用户继续核实。\n- `inferred`：只能用于风险提示或待确认问题，不能包装成项目事实。\n- `unverified`：不得作为事实使用，应明确说证据不足。\n- `contradicted`：必须展示冲突来源，不得替用户强行选择一个版本。\n\n## 它最适合谁\n\n- **正在使用 Claude/Codex/Cursor/Gemini 等宿主 AI 的开发者**：README 或插件配置提到多个宿主 AI。 证据：`README.md` Claim：`clm_0004` supported 0.86\n- **希望把专业流程带进宿主 AI 的用户**：仓库包含 Skill 文档。 证据：`skills/a11y-debugging/SKILL.md`, `skills/chrome-devtools/SKILL.md`, `skills/chrome-devtools-cli/SKILL.md`, `skills/debug-optimize-lcp/SKILL.md` 等 Claim：`clm_0005` supported 0.86\n\n## 它能做什么\n\n- **AI Skill / Agent 指令资产库**（可做安装前预览）：项目包含可被宿主 AI 读取的 Skill 或 Agent 指令文件，可用于把专业流程带入 Claude、Codex、Cursor 等宿主。 证据：`skills/a11y-debugging/SKILL.md`, `skills/chrome-devtools/SKILL.md`, `skills/chrome-devtools-cli/SKILL.md`, `skills/debug-optimize-lcp/SKILL.md` 等 Claim：`clm_0001` supported 0.86\n- **多宿主安装与分发**（需要安装后验证）：项目包含插件或 marketplace 配置，说明它面向一个或多个 AI 宿主的安装和分发。 证据：`.claude-plugin/marketplace.json`, `.claude-plugin/plugin.json`, `.github/plugin/plugin.json` Claim：`clm_0002` supported 0.86\n- **命令行启动或安装流程**（需要安装后验证）：项目文档中存在可执行命令，真实使用需要在本地或宿主环境中运行这些命令。 证据：`README.md` Claim：`clm_0003` supported 0.86\n\n## 怎么开始\n\n- `claude mcp add chrome-devtools --scope user npx chrome-devtools-mcp@latest` 证据：`README.md` Claim：`clm_0006` supported 0.86\n- `/plugin marketplace add ChromeDevTools/chrome-devtools-mcp` 证据：`README.md` Claim：`clm_0007` supported 0.86\n- `/plugin install chrome-devtools-mcp@chrome-devtools-plugins` 证据：`README.md` Claim：`clm_0008` supported 0.86\n\n## 继续前判断卡\n\n- **当前建议**：需要管理员/安全审批\n- **为什么**：继续前可能涉及密钥、账号、外部服务或敏感上下文，建议先经过管理员或安全审批。\n\n### 30 秒判断\n\n- **现在怎么做**：需要管理员/安全审批\n- **最小安全下一步**：先跑 Prompt Preview；若涉及凭证或企业环境，先审批再试装\n- **先别相信**：工具权限边界不能在安装前相信。\n- **继续会触碰**：命令执行、宿主 AI 配置、本地环境或项目文件\n\n### 现在可以相信\n\n- **适合人群线索：正在使用 Claude/Codex/Cursor/Gemini 等宿主 AI 的开发者**（supported）：有 supported claim 或项目证据支撑，但仍不等于真实安装效果。 证据：`README.md` Claim：`clm_0004` supported 0.86\n- **适合人群线索：希望把专业流程带进宿主 AI 的用户**（supported）：有 supported claim 或项目证据支撑，但仍不等于真实安装效果。 证据：`skills/a11y-debugging/SKILL.md`, `skills/chrome-devtools/SKILL.md`, `skills/chrome-devtools-cli/SKILL.md`, `skills/debug-optimize-lcp/SKILL.md` 等 Claim：`clm_0005` supported 0.86\n- **能力存在：AI Skill / Agent 指令资产库**（supported）：可以相信项目包含这类能力线索；是否适合你的具体任务仍要试用或安装后验证。 证据：`skills/a11y-debugging/SKILL.md`, `skills/chrome-devtools/SKILL.md`, `skills/chrome-devtools-cli/SKILL.md`, `skills/debug-optimize-lcp/SKILL.md` 等 Claim：`clm_0001` supported 0.86\n- **能力存在：多宿主安装与分发**（supported）：可以相信项目包含这类能力线索；是否适合你的具体任务仍要试用或安装后验证。 证据：`.claude-plugin/marketplace.json`, `.claude-plugin/plugin.json`, `.github/plugin/plugin.json` Claim：`clm_0002` supported 0.86\n- **能力存在：命令行启动或安装流程**（supported）：可以相信项目包含这类能力线索；是否适合你的具体任务仍要试用或安装后验证。 证据：`README.md` Claim：`clm_0003` supported 0.86\n- **存在 Quick Start / 安装命令线索**（supported）：可以相信项目文档出现过启动或安装入口；不要因此直接在主力环境运行。 证据：`README.md` Claim：`clm_0006` supported 0.86\n\n### 现在还不能相信\n\n- **工具权限边界不能在安装前相信。**（unverified）：MCP/tool 类项目通常会触碰文件、网络、浏览器或外部 API，必须真实检查权限和日志。\n- **真实输出质量不能在安装前相信。**（unverified）：Prompt Preview 只能展示引导方式，不能证明真实项目中的结果质量。\n- **宿主 AI 版本兼容性不能在安装前相信。**（unverified）：Claude、Cursor、Codex、Gemini 等宿主加载规则和版本差异必须在真实环境验证。\n- **不会污染现有宿主 AI 行为，不能直接相信。**（inferred）：Skill、plugin、AGENTS/CLAUDE/GEMINI 指令可能改变宿主 AI 的默认行为。 证据：`.claude-plugin/marketplace.json`, `.claude-plugin/plugin.json`, `.github/plugin/plugin.json`, `AGENTS.md` 等\n- **可安全回滚不能默认相信。**（unverified）：除非项目明确提供卸载和恢复说明，否则必须先在隔离环境验证。\n- **真实安装后是否与用户当前宿主 AI 版本兼容？**（unverified）：兼容性只能通过实际宿主环境验证。 证据：`.claude-plugin/marketplace.json`, `.claude-plugin/plugin.json`, `.github/plugin/plugin.json`\n- **项目输出质量是否满足用户具体任务？**（unverified）：安装前预览只能展示流程和边界，不能替代真实评测。\n- **安装命令是否需要网络、权限或全局写入？**（unverified）：这影响企业环境和个人环境的安装风险。 证据：`README.md`\n\n### 继续会触碰什么\n\n- **命令执行**：包管理器、网络下载、本地插件目录、项目配置或用户主目录。 原因：运行第一条命令就可能产生环境改动；必须先判断是否值得跑。 证据：`README.md`\n- **宿主 AI 配置**：Claude/Codex/Cursor/Gemini/OpenCode 等宿主的 plugin、Skill 或规则加载配置。 原因：宿主配置会改变 AI 后续工作方式，可能和用户已有规则冲突。 证据：`.claude-plugin/marketplace.json`, `.claude-plugin/plugin.json`, `.github/plugin/plugin.json`, `AGENTS.md` 等\n- **本地环境或项目文件**：安装结果、插件缓存、项目配置或本地依赖目录。 原因：安装前无法证明写入范围和回滚方式，需要隔离验证。 证据：`.claude-plugin/marketplace.json`, `.claude-plugin/plugin.json`, `.github/plugin/plugin.json`, `README.md`\n- **环境变量 / API Key**：项目入口文档明确出现 API key、token、secret 或账号凭证配置。 原因：如果真实安装需要凭证，应先使用测试凭证并经过权限/合规判断。 证据：`README.md`\n- **宿主 AI 上下文**：AI Context Pack、Prompt Preview、Skill 路由、风险规则和项目事实。 原因：导入上下文会影响宿主 AI 后续判断，必须避免把未验证项包装成事实。\n\n### 最小安全下一步\n\n- **先跑 Prompt Preview**：用安装前交互式试用判断工作方式是否匹配，不需要授权或改环境。（适用：任何项目都适用，尤其是输出质量未知时。）\n- **只在隔离目录或测试账号试装**：避免安装命令污染主力宿主 AI、真实项目或用户主目录。（适用：存在命令执行、插件配置或本地写入线索时。）\n- **先备份宿主 AI 配置**：Skill、plugin、规则文件可能改变 Claude/Cursor/Codex 的默认行为。（适用：存在插件 manifest、Skill 或宿主规则入口时。）\n- **不要使用真实生产凭证**：环境变量/API key 一旦进入宿主或工具链，可能产生账号和合规风险。（适用：出现 API、TOKEN、KEY、SECRET 等环境线索时。）\n- **安装后只验证一个最小任务**：先验证加载、兼容、输出质量和回滚，再决定是否深用。（适用：准备从试用进入真实工作流时。）\n\n### 退出方式\n\n- **保留安装前状态**：记录原始宿主配置和项目状态，后续才能判断是否可恢复。\n- **准备移除宿主 plugin / Skill / 规则入口**：如果试装后行为异常，可以把宿主 AI 恢复到试装前状态。\n- **记录安装命令和写入路径**：没有明确卸载说明时，至少要知道哪些目录或配置需要手动清理。\n- **准备撤销测试 API key 或 token**：测试凭证泄露或误用时，可以快速止损。\n- **如果没有回滚路径，不进入主力环境**：不可回滚是继续前阻断项，不应靠信任或运气继续。\n\n## 哪些只能预览\n\n- 解释项目适合谁和能做什么\n- 基于项目文档演示典型对话流程\n- 帮助用户判断是否值得安装或继续研究\n\n## 哪些必须安装后验证\n\n- 真实安装 Skill、插件或 CLI\n- 执行脚本、修改本地文件或访问外部服务\n- 验证真实输出质量、性能和兼容性\n\n## 边界与风险判断卡\n\n- **把安装前预览误认为真实运行**：用户可能高估项目已经完成的配置、权限和兼容性验证。 处理方式：明确区分 prompt_preview_can_do 与 runtime_required。 Claim：`clm_0009` inferred 0.45\n- **宿主 AI 插件或 Skill 规则冲突**：新规则可能改变用户现有宿主 AI 的工作方式。 处理方式：安装前先检查插件 manifest 和 Skill 文件，必要时隔离测试。 证据：`.claude-plugin/marketplace.json`, `.claude-plugin/plugin.json`, `.github/plugin/plugin.json` Claim：`clm_0010` supported 0.86\n- **命令执行会修改本地环境**：安装命令可能写入用户主目录、宿主插件目录或项目配置。 处理方式：先在隔离环境或测试账号中运行。 证据：`README.md` Claim：`clm_0011` supported 0.86\n- **待确认**：真实安装后是否与用户当前宿主 AI 版本兼容？。原因：兼容性只能通过实际宿主环境验证。\n- **待确认**：项目输出质量是否满足用户具体任务？。原因：安装前预览只能展示流程和边界，不能替代真实评测。\n- **待确认**：安装命令是否需要网络、权限或全局写入？。原因：这影响企业环境和个人环境的安装风险。\n\n## 开工前工作上下文\n\n### 加载顺序\n\n- 先读取 how_to_use.host_ai_instruction，建立安装前判断资产的边界。\n- 读取 claim_graph_summary，确认事实来自 Claim/Evidence Graph，而不是 Human Wiki 叙事。\n- 再读取 intended_users、capabilities 和 quick_start_candidates，判断用户是否匹配。\n- 需要执行具体任务时，优先查 role_skill_index，再查 evidence_index。\n- 遇到真实安装、文件修改、网络访问、性能或兼容性问题时，转入 risk_card 和 boundaries.runtime_required。\n\n### 任务路由\n\n- **AI Skill / Agent 指令资产库**：先基于 role_skill_index / evidence_index 帮用户挑选可用角色、Skill 或工作流。 边界：可做安装前 Prompt 体验。 证据：`skills/a11y-debugging/SKILL.md`, `skills/chrome-devtools/SKILL.md`, `skills/chrome-devtools-cli/SKILL.md`, `skills/debug-optimize-lcp/SKILL.md` 等 Claim：`clm_0001` supported 0.86\n- **多宿主安装与分发**：先说明这是安装后验证能力，再给出安装前检查清单。 边界：必须真实安装或运行后验证。 证据：`.claude-plugin/marketplace.json`, `.claude-plugin/plugin.json`, `.github/plugin/plugin.json` Claim：`clm_0002` supported 0.86\n- **命令行启动或安装流程**：先说明这是安装后验证能力，再给出安装前检查清单。 边界：必须真实安装或运行后验证。 证据：`README.md` Claim：`clm_0003` supported 0.86\n\n### 上下文规模\n\n- 文件总数：257\n- 重要文件覆盖：40/257\n- 证据索引条目：80\n- 角色 / Skill 条目：6\n\n### 证据不足时的处理\n\n- **missing_evidence**：说明证据不足，要求用户提供目标文件、README 段落或安装后验证记录；不要补全事实。\n- **out_of_scope_request**：说明该任务超出当前 AI Context Pack 证据范围，并建议用户先查看 Human Manual 或真实安装后验证。\n- **runtime_request**：给出安装前检查清单和命令来源，但不要替用户执行命令或声称已执行。\n- **source_conflict**：同时展示冲突来源，标记为待核实，不要强行选择一个版本。\n\n## Prompt Recipes\n\n### 适配判断\n\n- 目标：判断这个项目是否适合用户当前任务。\n- 预期输出：适配结论、关键理由、证据引用、安装前可预览内容、必须安装后验证内容、下一步建议。\n\n```text\n请基于 chrome-devtools-mcp 的 AI Context Pack，先问我 3 个必要问题，然后判断它是否适合我的任务。回答必须包含：适合谁、能做什么、不能做什么、是否值得安装、证据来自哪里。所有项目事实必须引用 evidence_refs、source_paths 或 claim_id。\n```\n\n### 安装前体验\n\n- 目标：让用户在安装前感受核心工作流，同时避免把预览包装成真实能力或营销承诺。\n- 预期输出：一段带边界标签的体验剧本、安装后验证清单和谨慎建议；不含真实运行承诺或强营销表述。\n\n```text\n请把 chrome-devtools-mcp 当作安装前体验资产，而不是已安装工具或真实运行环境。\n\n请严格输出四段：\n1. 先问我 3 个必要问题。\n2. 给出一段“体验剧本”：用 [安装前可预览]、[必须安装后验证]、[证据不足] 三种标签展示它可能如何引导工作流。\n3. 给出安装后验证清单：列出哪些能力只有真实安装、真实宿主加载、真实项目运行后才能确认。\n4. 给出谨慎建议：只能说“值得继续研究/试装”“先补充信息后再判断”或“不建议继续”，不得替项目背书。\n\n硬性边界：\n- 不要声称已经安装、运行、执行测试、修改文件或产生真实结果。\n- 不要写“自动适配”“确保通过”“完美适配”“强烈建议安装”等承诺性表达。\n- 如果描述安装后的工作方式，必须使用“如果安装成功且宿主正确加载 Skill，它可能会……”这种条件句。\n- 体验剧本只能写成“示例台词/假设流程”：使用“可能会询问/可能会建议/可能会展示”，不要写“已写入、已生成、已通过、正在运行、正在生成”。\n- Prompt Preview 不负责给安装命令；如用户准备试装，只能提示先阅读 Quick Start 和 Risk Card，并在隔离环境验证。\n- 所有项目事实必须来自 supported claim、evidence_refs 或 source_paths；inferred/unverified 只能作风险或待确认项。\n\n```\n\n### 角色 / Skill 选择\n\n- 目标：从项目里的角色或 Skill 中挑选最匹配的资产。\n- 预期输出：候选角色或 Skill 列表，每项包含适用场景、证据路径、风险边界和是否需要安装后验证。\n\n```text\n请读取 role_skill_index，根据我的目标任务推荐 3-5 个最相关的角色或 Skill。每个推荐都要说明适用场景、可能输出、风险边界和 evidence_refs。\n```\n\n### 风险预检\n\n- 目标：安装或引入前识别环境、权限、规则冲突和质量风险。\n- 预期输出：环境、权限、依赖、许可、宿主冲突、质量风险和未知项的检查清单。\n\n```text\n请基于 risk_card、boundaries 和 quick_start_candidates，给我一份安装前风险预检清单。不要替我执行命令，只说明我应该检查什么、为什么检查、失败会有什么影响。\n```\n\n### 宿主 AI 开工指令\n\n- 目标：把项目上下文转成一次对话开始前的宿主 AI 指令。\n- 预期输出：一段边界明确、证据引用明确、适合复制给宿主 AI 的开工前指令。\n\n```text\n请基于 chrome-devtools-mcp 的 AI Context Pack，生成一段我可以粘贴给宿主 AI 的开工前指令。这段指令必须遵守 not_runtime=true，不能声称项目已经安装、运行或产生真实结果。\n```\n\n\n## 角色 / Skill 索引\n\n- 共索引 6 个角色 / Skill / 项目文档条目。\n\n- **a11y-debugging**（skill）：Uses Chrome DevTools MCP for accessibility a11y debugging and auditing based on web.dev guidelines. Use when testing semantic HTML, ARIA labels, focus states, keyboard navigation, tap targets, and color contrast. 激活提示：当用户任务与“a11y-debugging”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`skills/a11y-debugging/SKILL.md`\n- **chrome-devtools-cli**（skill）：Use this skill to write shell scripts or run shell commands to automate tasks in the browser or otherwise use Chrome DevTools via CLI. 激活提示：当用户任务与“chrome-devtools-cli”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`skills/chrome-devtools-cli/SKILL.md`\n- **chrome-devtools**（skill）：Uses Chrome DevTools via MCP for efficient debugging, troubleshooting and browser automation. Use when debugging web pages, automating browser interactions, analyzing performance, or inspecting network requests. This skill does not apply to --slim mode MCP configuration . 激活提示：当用户任务与“chrome-devtools”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`skills/chrome-devtools/SKILL.md`\n- **debug-optimize-lcp**（skill）：Guides debugging and optimizing Largest Contentful Paint LCP using Chrome DevTools MCP tools. Use this skill whenever the user asks about LCP performance, slow page loads, Core Web Vitals optimization, or wants to understand why their page's main content takes too long to appear. Also use when the user mentions \"largest contentful paint\", \"page load speed\", \"CWV\", or wants to improve how fast their hero image or mai… 激活提示：当用户任务与“debug-optimize-lcp”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`skills/debug-optimize-lcp/SKILL.md`\n- **memory-leak-debugging**（skill）：Diagnoses and resolves memory leaks in JavaScript/Node.js applications. Use when a user reports high memory usage, OOM errors, or wants to analyze heapsnapshots or run memory leak detection tools like memlab. 激活提示：当用户任务与“memory-leak-debugging”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`skills/memory-leak-debugging/SKILL.md`\n- **troubleshooting**（skill）：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. 激活提示：当用户任务与“troubleshooting”描述的流程高度相关时，先用它做安装前体验，再决定是否安装。 证据：`skills/troubleshooting/SKILL.md`\n\n## 证据索引\n\n- 共索引 80 条证据。\n\n- **Instructions**（documentation）：This repository contains an MCP server and CLI for Chrome DevTools. 证据：`AGENTS.md`\n- **Chrome DevTools for Agents**（documentation）：! npm chrome-devtools-mcp package https://img.shields.io/npm/v/chrome-devtools-mcp.svg https://npmjs.org/package/chrome-devtools-mcp 证据：`README.md`\n- **Package**（package_manifest）：{ \"name\": \"chrome-devtools-mcp\", \"version\": \"0.26.0\", \"description\": \"MCP server for Chrome DevTools\", \"type\": \"module\", \"bin\": { \"chrome-devtools-mcp\": \"./build/src/bin/chrome-devtools-mcp.js\", \"chrome-devtools\": \"./build/src/bin/chrome-devtools.js\" }, \"main\": \"./build/src/index.js\", \"scripts\": { \"cli:generate\": \"node --experimental-strip-types scripts/generate-cli.ts\", \"clean\": \"node -e \\\"require 'fs' .rmSync 'build', {recursive: true, force: true} \\\"\", \"bundle\": \"npm run clean && npm run build && rollup -c rollup.config.mjs && node -e \\\"require 'fs' .rmSync 'build/node modules', {recursive: true, force: true} \\\" && node --experimental-strip-types scripts/append-lighthouse-notices.ts\", \"b… 证据：`package.json`\n- **How to contribute**（documentation）：We'd love to accept your patches and contributions to this project. 证据：`CONTRIBUTING.md`\n- **Core Concepts**（skill_instruction）：Accessibility Tree vs DOM : Visually hiding an element e.g., CSS opacity: 0 behaves differently for screen readers than display: none or aria-hidden=\"true\" . The take snapshot tool returns the accessibility tree of the page, which represents what assistive technologies \"see\", making it the most reliable source of truth for semantic structure. 证据：`skills/a11y-debugging/SKILL.md`\n- **Setup**（skill_instruction）：The chrome-devtools-mcp CLI lets you interact with the browser from your terminal. 证据：`skills/chrome-devtools-cli/SKILL.md`\n- **Core Concepts**（skill_instruction）：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 . To enable extensions, use --categoryExtensions . Page selection : Tools operate on the currently selected page. Use list pages to see available pages, then select page to switch context. 证据：`skills/chrome-devtools/SKILL.md`\n- **What is LCP and why it matters**（skill_instruction）：Largest Contentful Paint LCP measures how quickly a page's main content becomes visible. It's the time from navigation start until the largest image or text block renders in the viewport. 证据：`skills/debug-optimize-lcp/SKILL.md`\n- **Memory Leak Debugging**（skill_instruction）：This skill provides expert guidance and workflows for finding, diagnosing, and fixing memory leaks in JavaScript and Node.js applications. 证据：`skills/memory-leak-debugging/SKILL.md`\n- **Troubleshooting Wizard**（skill_instruction）：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: 证据：`skills/troubleshooting/SKILL.md`\n- **Marketplace**（structured_config）：{ \"name\": \"chrome-devtools-plugins\", \"version\": \"0.26.0\", \"description\": \"Bundled plugins for actuating and debugging the Chrome browser.\", \"repository\": \"https://github.com/ChromeDevTools/chrome-devtools-mcp\", \"owner\": { \"name\": \"Chrome DevTools Team\", \"email\": \"devtools-dev@chromium.org\" }, \"plugins\": { \"name\": \"chrome-devtools-mcp\", \"source\": \"./\", \"description\": \"Reliable automation, in-depth debugging, and performance analysis in Chrome using Chrome DevTools and Puppeteer\" } } 证据：`.claude-plugin/marketplace.json`\n- **Plugin**（structured_config）：{ \"name\": \"chrome-devtools-mcp\", \"version\": \"0.26.0\", \"description\": \"Reliable automation, in-depth debugging, and performance analysis in Chrome using Chrome DevTools and Puppeteer\", \"mcpServers\": { \"chrome-devtools\": { \"command\": \"npx\", \"args\": \"chrome-devtools-mcp@latest\" } } } 证据：`.claude-plugin/plugin.json`\n- **Plugin**（structured_config）：{ \"name\": \"chrome-devtools-mcp\", \"version\": \"0.26.0\", \"description\": \"Reliable automation, in-depth debugging, and performance analysis in Chrome using Chrome DevTools and Puppeteer\", \"mcpServers\": { \"chrome-devtools\": { \"command\": \"npx\", \"args\": \"chrome-devtools-mcp@latest\" } } } 证据：`.github/plugin/plugin.json`\n- **License**（source_file）：Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ 证据：`LICENSE`\n- **Chrome DevTools CLI**（documentation）：The chrome-devtools-mcp package includes an experimental CLI interface that allows you to interact with the browser directly from your terminal. This is particularly useful for debugging or when you want an agent to generate scripts that automate browser actions. 证据：`docs/cli.md`\n- **Experimental: Debugging Chrome on Android**（documentation）：Experimental: Debugging Chrome on Android 证据：`docs/debugging-android.md`\n- **Design Principles**（documentation）：These are rough guidelines to follow when shipping features for the MCP server. Apply them with nuance. 证据：`docs/design-principles.md`\n- **Chrome DevTools MCP Slim Tool Reference**（documentation）：Chrome DevTools MCP Slim Tool Reference 证据：`docs/slim-tool-reference.md`\n- **Developer Guide: Building third-party developer tools**（documentation）：Developer Guide: Building third-party developer tools 证据：`docs/third-party-developer-tools.md`\n- **Chrome DevTools MCP Tool Reference**（documentation）：- Input automation input-automation 10 tools - click click - drag drag - fill fill - fill form fill form - handle dialog handle dialog - hover hover - press key press key - type text type text - upload file upload file - click at click at - Navigation automation navigation-automation 6 tools - close page close page - list pages list pages - navigate page navigate page - new page new page - select page select page - wait for wait for - Emulation emulation 2 tools - emulate emulate - resize page resize page - Performance performance 3 tools - performance analyze insight performance analyze insight - performance start trace performance start trace - performance stop trace performance stop trac… 证据：`docs/tool-reference.md`\n- **Troubleshooting**（documentation）：- Run npx chrome-devtools-mcp@latest --help to test if the MCP server runs on your machine. - Make sure that your MCP client uses the same npm and node version as your terminal. - When configuring your MCP client, try using the --yes argument to npx to auto-accept installation prompt. - Find a specific error in the output of the chrome-devtools-mcp server. Usually, if your client is an IDE, logs would be in the Output pane. - Search the GitHub repository issues and discussions https://github.com/ChromeDevTools/chrome-devtools-mcp for help or existing similar problems. 证据：`docs/troubleshooting.md`\n- **Changelog**（documentation）：0.26.0 https://github.com/ChromeDevTools/chrome-devtools-mcp/compare/chrome-devtools-mcp-v0.25.0...chrome-devtools-mcp-v0.26.0 2026-05-11 证据：`CHANGELOG.md`\n- **Security policy**（documentation）：The Chrome DevTools MCP project takes security very seriously. Please use Chromium’s process to report security issues https://www.chromium.org/Home/chromium-security/reporting-security-bugs/ . 证据：`SECURITY.md`\n- **Accessibility Debugging Snippets**（documentation）：Use these JavaScript snippets with the evaluate script tool. 证据：`skills/a11y-debugging/references/a11y-snippets.md`\n- **Installation**（documentation）：Install the package globally to make the chrome-devtools command available. You only need to do this the first time you use it. 证据：`skills/chrome-devtools-cli/references/installation.md`\n- **Elements and Size for LCP**（documentation）：The types of elements considered for Largest Contentful Paint LCP are: 证据：`skills/debug-optimize-lcp/references/elements-and-size.md`\n- **Largest Contentful Paint LCP Breakdown**（documentation）：Largest Contentful Paint LCP Breakdown 证据：`skills/debug-optimize-lcp/references/lcp-breakdown.md`\n- **LCP Debugging Snippets**（documentation）：Use these JavaScript snippets with the evaluate script tool to extract deep insights from the page. 证据：`skills/debug-optimize-lcp/references/lcp-snippets.md`\n- **LCP Optimization Strategies**（documentation）：Goal : Ensure the LCP resource starts loading as early as possible. 证据：`skills/debug-optimize-lcp/references/optimization-strategies.md`\n- **Common Memory Leaks**（documentation）：When analyzing a retainer trace from memlab , look for these common patterns in the codebase: 证据：`skills/memory-leak-debugging/references/common-leaks.md`\n- **Using Memlab**（documentation）：Memlab https://facebook.github.io/memlab/ is an E2E testing and analysis framework for finding JavaScript memory leaks. 证据：`skills/memory-leak-debugging/references/memlab.md`\n- **Settings**（structured_config）：{ \"context\": { \"fileName\": \"AGENTS.md\", \"GEMINI.md\" } } 证据：`.gemini/settings.json`\n- **.Mcp**（structured_config）：{ \"mcpServers\": { \"chrome-devtools\": { \"command\": \"npx\", \"args\": \"chrome-devtools-mcp@latest\" } } } 证据：`.mcp.json`\n- **.Release Please Manifest**（structured_config）：{ \".\": \"0.26.0\" } 证据：`.release-please-manifest.json`\n- **Gemini Extension**（structured_config）：{ \"name\": \"chrome-devtools-mcp\", \"version\": \"latest\", \"mcpServers\": { \"chrome-devtools\": { \"command\": \"npx\", \"args\": \"chrome-devtools-mcp@latest\" } } } 证据：`gemini-extension.json`\n- **Release Please Config**（structured_config）：{ \"changelog-sections\": {\"type\": \"feat\", \"section\": \"🎉 Features\", \"hidden\": false}, {\"type\": \"fix\", \"section\": \"🛠️ Fixes\", \"hidden\": false}, {\"type\": \"docs\", \"section\": \"📄 Documentation\", \"hidden\": false}, 证据：`release-please-config.json`\n- **Tsconfig**（structured_config）：{ \"extends\": \"../tsconfig.json\", \"compilerOptions\": { \"target\": \"esnext\", \"module\": \"nodenext\", \"moduleResolution\": \"nodenext\", \"outDir\": \"./ignored\", \"rootDir\": \".\", \"strict\": true, \"esModuleInterop\": true, \"skipLibCheck\": true, \"forceConsistentCasingInFileNames\": true, \"noImplicitReturns\": true, \"noImplicitOverride\": true, \"noFallthroughCasesInSwitch\": true, \"incremental\": true, \"allowJs\": true, \"allowImportingTsExtensions\": true, \"noEmit\": true, \"useUnknownInCatchVariables\": false }, \"include\": \"./ / .ts\", \"./ / .js\", \"./ / .mjs\" } 证据：`scripts/tsconfig.json`\n- **Server**（structured_config）：{ \"$schema\": \"https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json\", \"name\": \"io.github.ChromeDevTools/chrome-devtools-mcp\", \"title\": \"Chrome DevTools MCP\", \"description\": \"MCP server for Chrome DevTools\", \"repository\": { \"url\": \"https://github.com/ChromeDevTools/chrome-devtools-mcp\", \"source\": \"github\" }, \"version\": \"0.26.0\", \"packages\": { \"registryType\": \"npm\", \"registryBaseUrl\": \"https://registry.npmjs.org\", \"identifier\": \"chrome-devtools-mcp\", \"version\": \"0.26.0\", \"transport\": { \"type\": \"stdio\" }, \"environmentVariables\": } } 证据：`server.json`\n- **Tsconfig**（structured_config）：{ \"compilerOptions\": { \"target\": \"es2023\", \"lib\": \"ES2023\", \"DOM\", \"ES2024.Promise\", \"ESNext.Iterator\", \"ESNext.Collection\" , \"types\": \"node\", \"filesystem\" , \"moduleResolution\": \"bundler\", \"outDir\": \"./build\", \"rootDir\": \".\", \"esModuleInterop\": true, \"skipLibCheck\": true, \"forceConsistentCasingInFileNames\": true, \"noImplicitReturns\": true, \"noImplicitOverride\": true, \"noFallthroughCasesInSwitch\": true, \"incremental\": true, \"sourceMap\": true, \"allowJs\": true, \"useUnknownInCatchVariables\": false }, \"include\": \"src/ / .ts\", \"tests/ / .ts\", \"node modules/chrome-devtools-frontend/front end/core/common\", \"node modules/chrome-devtools-frontend/front end/core/host\", \"node modules/chrome-devtools-fr… 证据：`tsconfig.json`\n- **Flag Usage Metrics**（structured_config）：{ \"name\": \"browser url present\", \"flagType\": \"boolean\" }, { \"name\": \"headless\", \"flagType\": \"boolean\" }, { \"name\": \"executable path present\", \"flagType\": \"boolean\" }, { \"name\": \"isolated\", \"flagType\": \"boolean\" }, { \"name\": \"channel\", \"flagType\": \"enum\", \"choices\": \"CHANNEL UNSPECIFIED\", \"CHANNEL CANARY\", \"CHANNEL DEV\", \"CHANNEL BETA\", \"CHANNEL STABLE\" }, { \"name\": \"log file present\", \"flagType\": \"boolean\" }, { \"name\": \"accept insecure certs present\", \"flagType\": \"boolean\" }, { \"name\": \"accept insecure certs\", \"flagType\": \"boolean\" }, { \"name\": \"auto connect present\", \"flagType\": \"boolean\" }, { \"name\": \"auto connect\", \"flagType\": \"boolean\" }, { \"name\": \"category emulation present\", \"flagTyp… 证据：`src/telemetry/flag_usage_metrics.json`\n- **Tool Call Metrics**（structured_config）：{ \"name\": \"click\", \"args\": { \"name\": \"dbl click\", \"argType\": \"boolean\" }, { \"name\": \"include snapshot\", \"argType\": \"boolean\" } }, { \"name\": \"click at\", \"args\": { \"name\": \"x\", \"argType\": \"number\" }, { \"name\": \"y\", \"argType\": \"number\" }, { \"name\": \"dbl click\", \"argType\": \"boolean\" }, { \"name\": \"include snapshot\", \"argType\": \"boolean\" } }, { \"name\": \"close page\", \"args\": { \"name\": \"page id\", \"argType\": \"number\" } }, { \"name\": \"drag\", \"args\": { \"name\": \"from uid length\", \"argType\": \"number\" }, { \"name\": \"to uid length\", \"argType\": \"number\" }, { \"name\": \"include snapshot\", \"argType\": \"boolean\" } }, { \"name\": \"emulate\", \"args\": { \"name\": \"network conditions\", \"argType\": \"string\" }, { \"name\": \"cpu… 证据：`src/telemetry/tool_call_metrics.json`\n- **Manifest**（structured_config）：{ \"manifest version\": 3, \"name\": \"Test Extension with Content Script\", \"version\": \"1.0\", \"permissions\": \"tabs\", \"scripting\" , \"host permissions\": \" \" , \"content scripts\": { \"matches\": \" \" , \"js\": \"content.js\" , \"run at\": \"document start\", \"all frames\": true } } 证据：`tests/tools/fixtures/extension-content-script/manifest.json`\n- **Manifest**（structured_config）：{ \"name\": \"Test Extension Side Panel\", \"version\": \"1.0.0\", \"manifest version\": 3, \"permissions\": \"sidePanel\" , \"action\": { \"default title\": \"Click to open panel\" }, \"background\": { \"service worker\": \"sw.js\" }, \"side panel\": { \"default path\": \"sidepanel.html\" } } 证据：`tests/tools/fixtures/extension-side-panel/manifest.json`\n- **Manifest**（structured_config）：{ \"manifest version\": 3, \"name\": \"Test Extension with SW\", \"version\": \"1.0\", \"background\": { \"service worker\": \"sw.js\" }, \"action\": { \"default popup\": \"popup.html\" } } 证据：`tests/tools/fixtures/extension-sw/manifest.json`\n- **Manifest**（structured_config）：{ \"manifest version\": 3, \"name\": \"Test Extension\", \"version\": \"1.0\", \"action\": { \"default popup\": \"popup.html\" } } 证据：`tests/tools/fixtures/extension/manifest.json`\n- **.gitattributes**（source_file）：text=auto eol=lf 证据：`.gitattributes`\n- **breaks often so better to roll separetely.**（source_file）：version: 2 updates: - package-ecosystem: npm directory: / schedule: interval: weekly day: 'sunday' time: '02:00' timezone: Europe/Berlin groups: dependencies: dependency-type: production patterns: - ' ' dev-dependencies: dependency-type: development exclude-patterns: - 'puppeteer ' - 'chrome-devtools-frontend' - '@modelcontextprotocol/sdk' - 'yargs' - 'debug' - 'core-js' patterns: - ' ' breaks often so better to roll separetely. bundled-devtools: patterns: - 'chrome-devtools-frontend' bundled: patterns: - 'puppeteer ' - '@modelcontextprotocol/sdk' - 'yargs' - 'debug' - 'core-js' - package-ecosystem: github-actions directory: / schedule: interval: weekly day: 'sunday' time: '04:00' timezone:… 证据：`.github/dependabot.yml`\n- **Logs**（source_file）：Logs logs .log npm-debug.log yarn-debug.log yarn-error.log lerna-debug.log .pnpm-debug.log 证据：`.gitignore`\n- **.npmrc**（source_file）：package-lock=true 证据：`.npmrc`\n- **.nvmrc**（source_file）：v24 证据：`.nvmrc`\n- **Prettier-only ignores.**（source_file）：Prettier-only ignores. CHANGELOG.md src/third party/lighthouse-devtools-mcp-bundle.js 证据：`.prettierignore`\n- **.Prettierrc**（source_file）：/ @license Copyright 2025 Google LLC SPDX-License-Identifier: Apache-2.0 / 证据：`.prettierrc.cjs`\n- **Eslint.Config**（source_file）：/ @license Copyright 2025 Google LLC SPDX-License-Identifier: Apache-2.0 / 证据：`eslint.config.mjs`\n- **Puppeteer.Config**（source_file）：/ @license Copyright 2025 Google Inc. SPDX-License-Identifier: Apache-2.0 / 证据：`puppeteer.config.cjs`\n- **Rollup.Config**（source_file）：/ Copyright 2021 Google LLC. Copyright c Microsoft Corporation. Licensed under the Apache License, Version 2.0 the \"License\" ; you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. / 证据：`rollup.config.mjs`\n- **Append Lighthouse Notices**（source_file）：/ @license Copyright 2026 Google LLC SPDX-License-Identifier: Apache-2.0 / 证据：`scripts/append-lighthouse-notices.ts`\n- **Count Tokens**（source_file）：/ @license Copyright 2026 Google LLC SPDX-License-Identifier: Apache-2.0 / 证据：`scripts/count_tokens.ts`\n- **Eval Gemini**（source_file）：/ @license Copyright 2026 Google LLC SPDX-License-Identifier: Apache-2.0 / 证据：`scripts/eval_gemini.ts`\n- **Generate Cli**（source_file）：/ @license Copyright 2026 Google LLC SPDX-License-Identifier: Apache-2.0 / 证据：`scripts/generate-cli.ts`\n- **${title}**（source_file）：/ @license Copyright 2025 Google LLC SPDX-License-Identifier: Apache-2.0 / 证据：`scripts/generate-docs.ts`\n- 其余 20 条证据见 `AI_CONTEXT_PACK.json` 或 `EVIDENCE_INDEX.json`。\n\n## 宿主 AI 必须遵守的规则\n\n- **把本资产当作开工前上下文，而不是运行环境。**：AI Context Pack 只包含证据化项目理解，不包含目标项目的可执行状态。 证据：`AGENTS.md`, `README.md`, `package.json`\n- **回答用户时区分可预览内容与必须安装后才能验证的内容。**：安装前体验的消费者价值来自降低误装和误判，而不是伪装成真实运行。 证据：`AGENTS.md`, `README.md`, `package.json`\n\n## 用户开工前应该回答的问题\n\n- 你准备在哪个宿主 AI 或本地环境中使用它？\n- 你只是想先体验工作流，还是准备真实安装？\n- 你最在意的是安装成本、输出质量、还是和现有规则的冲突？\n\n## 验收标准\n\n- 所有能力声明都能回指到 evidence_refs 中的文件路径。\n- AI_CONTEXT_PACK.md 没有把预览包装成真实运行。\n- 用户能在 3 分钟内看懂适合谁、能做什么、如何开始和风险边界。\n\n---\n\n## Doramagic Context Augmentation\n\n下面内容用于强化 Repomix/AI Context Pack 主体。Human Manual 只提供阅读骨架；踩坑日志会被转成宿主 AI 必须遵守的工作约束。\n\n## Human Manual 骨架\n\n使用规则：这里只是项目阅读路线和显著性信号，不是事实权威。具体事实仍必须回到 repo evidence / Claim Graph。\n\n宿主 AI 硬性规则：\n- 不得把页标题、章节顺序、摘要或 importance 当作项目事实证据。\n- 解释 Human Manual 骨架时，必须明确说它只是阅读路线/显著性信号。\n- 能力、安装、兼容性、运行状态和风险判断必须引用 repo evidence、source path 或 Claim Graph。\n\n- **Project Overview**：importance `high`\n  - source_paths: README.md, package.json, src/index.ts, docs/design-principles.md\n- **Installation and Setup**：importance `high`\n  - source_paths: README.md, package.json, .nvmrc\n- **Configuration Reference**：importance `high`\n  - source_paths: src/bin/chrome-devtools-mcp-cli-options.ts, src/bin/chrome-devtools-mcp-main.ts, puppeteer.config.cjs, .mcp.json\n- **System Architecture**：importance `high`\n  - source_paths: src/DevToolsConnectionAdapter.ts, src/daemon/daemon.ts, src/daemon/client.ts, src/daemon/types.ts, src/McpPage.ts\n- **MCP Protocol Integration**：importance `high`\n  - source_paths: src/McpContext.ts, src/McpResponse.ts, src/SlimMcpResponse.ts, src/tools/ToolDefinition.ts, src/tools/categories.ts\n- **Input and Navigation Automation Tools**：importance `high`\n  - source_paths: src/tools/input.ts, src/tools/pages.ts, src/tools/emulation.ts, src/WaitForHelper.ts, src/utils/keyboard.ts\n- **Debugging and Inspection Tools**：importance `high`\n  - source_paths: src/tools/screenshot.ts, src/tools/snapshot.ts, src/tools/network.ts, src/tools/console.ts, src/tools/memory.ts\n- **Performance Analysis Tools**：importance `medium`\n  - source_paths: src/tools/lighthouse.ts, src/tools/performance.ts, src/tools/screencast.ts, src/HeapSnapshotManager.ts, src/formatters/HeapSnapshotFormatter.ts\n\n## Repo Inspection Evidence / 源码检查证据\n\n- repo_clone_verified: true\n- repo_inspection_verified: true\n- repo_commit: `3efd8c019416ddc83316fd7c4c8803a7c7367837`\n- inspected_files: `package.json`, `README.md`, `docs/cli.md`, `docs/troubleshooting.md`, `docs/third-party-developer-tools.md`, `docs/debugging-android.md`, `docs/design-principles.md`, `docs/slim-tool-reference.md`, `docs/tool-reference.md`, `src/HeapSnapshotManager.ts`, `src/logger.ts`, `src/PageCollector.ts`, `src/McpContext.ts`, `src/devtools.d.ts`, `src/version.ts`, `src/DevToolsConnectionAdapter.ts`, `src/issue-descriptions.ts`, `src/McpPage.ts`, `src/index.ts`, `src/types.ts`\n\n宿主 AI 硬性规则：\n- 没有 repo_clone_verified=true 时，不得声称已经读过源码。\n- 没有 repo_inspection_verified=true 时，不得把 README/docs/package 文件判断写成事实。\n- 没有 quick_start_verified=true 时，不得声称 Quick Start 已跑通。\n\n## Doramagic Pitfall Constraints / 踩坑约束\n\n这些规则来自 Doramagic 发现、验证或编译过程中的项目专属坑点。宿主 AI 必须把它们当作工作约束，而不是普通说明文字。\n\n### Constraint 1: 来源证据：performance_start_trace records 'CPU throttling: none / Network throttling: none' despite emulate setting throttling —…\n\n- Trigger: GitHub 社区证据显示该项目存在一个配置相关的待验证问题：performance_start_trace records 'CPU throttling: none / Network throttling: none' despite emulate setting throttling — measurements come back partially or full…\n- Host AI rule: 来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。\n- Why it matters: 可能增加新用户试用和生产接入成本。\n- Evidence: community_evidence:github | cevd_644cef1d4144424abe63f24528f5d082 | https://github.com/ChromeDevTools/chrome-devtools-mcp/issues/1955 | 来源讨论提到 macos 相关条件，需在安装/试用前复核。\n- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。\n\n### Constraint 2: 来源证据：Auto-connect doesn't work on WSL with mirrored networking (Chrome on Windows host)\n\n- Trigger: GitHub 社区证据显示该项目存在一个安装相关的待验证问题：Auto-connect doesn't work on WSL with mirrored networking (Chrome on Windows host)\n- Host AI rule: 来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。\n- Why it matters: 可能增加新用户试用和生产接入成本。\n- Evidence: community_evidence:github | cevd_3275fc356e284918a94cf8c2c037caee | https://github.com/ChromeDevTools/chrome-devtools-mcp/issues/2004 | 来源讨论提到 windows 相关条件，需在安装/试用前复核。\n- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。\n\n### Constraint 3: 来源证据：Update check hardcodes registry.npmjs.org, ignoring user's npm registry configuration\n\n- Trigger: GitHub 社区证据显示该项目存在一个安装相关的待验证问题：Update check hardcodes registry.npmjs.org, ignoring user's npm registry configuration\n- Host AI rule: 来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。\n- Why it matters: 可能阻塞安装或首次运行。\n- Evidence: community_evidence:github | cevd_1946d257bfb04c23a67250da4d584631 | https://github.com/ChromeDevTools/chrome-devtools-mcp/issues/1943 | 来源讨论提到 node 相关条件，需在安装/试用前复核。\n- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。\n\n### Constraint 4: 来源证据：chrome-devtools-mcp: v0.20.1\n\n- Trigger: GitHub 社区证据显示该项目存在一个安装相关的待验证问题：chrome-devtools-mcp: v0.20.1\n- Host AI rule: 来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。\n- Why it matters: 可能增加新用户试用和生产接入成本。\n- Evidence: community_evidence:github | cevd_11700367e17048138ab79571d751cec4 | https://github.com/ChromeDevTools/chrome-devtools-mcp/releases/tag/chrome-devtools-mcp-v0.20.1 | 来源类型 github_release 暴露的待验证使用条件。\n- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。\n\n### Constraint 5: 来源证据：chrome-devtools-mcp: v0.22.0\n\n- Trigger: GitHub 社区证据显示该项目存在一个安装相关的待验证问题：chrome-devtools-mcp: v0.22.0\n- Host AI rule: 来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。\n- Why it matters: 可能增加新用户试用和生产接入成本。\n- Evidence: community_evidence:github | cevd_6ff69eabdc334130b7b093706390c6c1 | https://github.com/ChromeDevTools/chrome-devtools-mcp/releases/tag/chrome-devtools-mcp-v0.22.0 | 来源类型 github_release 暴露的待验证使用条件。\n- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。\n\n### Constraint 6: 来源证据：chrome-devtools-mcp: v0.21.0\n\n- Trigger: GitHub 社区证据显示该项目存在一个配置相关的待验证问题：chrome-devtools-mcp: v0.21.0\n- Host AI rule: 来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。\n- Why it matters: 可能增加新用户试用和生产接入成本。\n- Evidence: community_evidence:github | cevd_41b2681dc7ae4bbabdb071511fdc0191 | https://github.com/ChromeDevTools/chrome-devtools-mcp/releases/tag/chrome-devtools-mcp-v0.21.0 | 来源类型 github_release 暴露的待验证使用条件。\n- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。\n\n### Constraint 7: 能力判断依赖假设\n\n- Trigger: README/documentation is current enough for a first validation pass.\n- Host AI rule: 将假设转成下游验证清单。\n- Why it matters: 假设不成立时，用户拿不到承诺的能力。\n- Evidence: capability.assumptions | github_repo:1054793726 | https://github.com/ChromeDevTools/chrome-devtools-mcp | README/documentation is current enough for a first validation pass.\n- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。\n\n### Constraint 8: 来源证据：chrome-devtools-mcp: v0.20.0\n\n- Trigger: GitHub 社区证据显示该项目存在一个运行相关的待验证问题：chrome-devtools-mcp: v0.20.0\n- Host AI rule: 来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。\n- Why it matters: 可能增加新用户试用和生产接入成本。\n- Evidence: community_evidence:github | cevd_8bef6b0b7a80406ab00a0576f82b35a7 | https://github.com/ChromeDevTools/chrome-devtools-mcp/releases/tag/chrome-devtools-mcp-v0.20.0 | 来源类型 github_release 暴露的待验证使用条件。\n- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。\n\n### Constraint 9: 来源证据：chrome-devtools-mcp: v0.24.0\n\n- Trigger: GitHub 社区证据显示该项目存在一个运行相关的待验证问题：chrome-devtools-mcp: v0.24.0\n- Host AI rule: 来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。\n- Why it matters: 可能增加新用户试用和生产接入成本。\n- Evidence: community_evidence:github | cevd_e42176fdf7da4015ac82844a46f37c08 | https://github.com/ChromeDevTools/chrome-devtools-mcp/releases/tag/chrome-devtools-mcp-v0.24.0 | 来源类型 github_release 暴露的待验证使用条件。\n- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。\n\n### Constraint 10: 来源证据：chrome-devtools-mcp: v0.26.0\n\n- Trigger: GitHub 社区证据显示该项目存在一个运行相关的待验证问题：chrome-devtools-mcp: v0.26.0\n- Host AI rule: 来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。\n- Why it matters: 可能增加新用户试用和生产接入成本。\n- Evidence: community_evidence:github | cevd_a6cf1fa6206f48e6a9e88a5d9d00fd64 | https://github.com/ChromeDevTools/chrome-devtools-mcp/releases/tag/chrome-devtools-mcp-v0.26.0 | 来源类型 github_release 暴露的待验证使用条件。\n- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。\n",
      "summary": "给宿主 AI 的上下文和工作边界。",
      "title": "AI Context Pack / 带给我的 AI"
    },
    "boundary_risk_card": {
      "asset_id": "boundary_risk_card",
      "filename": "BOUNDARY_RISK_CARD.md",
      "markdown": "# Boundary & Risk Card / 安装前决策卡\n\n项目：ChromeDevTools/chrome-devtools-mcp\n\n## Doramagic 试用结论\n\n当前结论：可以进入发布前推荐检查；首次使用仍应从最小权限、临时目录和可回滚配置开始。\n\n## 用户现在可以做\n\n- 可以先阅读 Human Manual，理解项目目的和主要工作流。\n- 可以复制 Prompt Preview 做安装前体验；这只验证交互感，不代表真实运行。\n- 可以把官方 Quick Start 命令放到隔离环境中验证，不要直接进主力环境。\n\n## 现在不要做\n\n- 不要把 Prompt Preview 当成项目实际运行结果。\n- 不要把 metadata-only validation 当成沙箱安装验证。\n- 不要把未验证能力写成“已支持、已跑通、可放心安装”。\n- 不要在首次试用时交出生产数据、私人文件、真实密钥或主力配置目录。\n\n## 安装前检查\n\n- 宿主 AI 是否匹配：mcp_host\n- 官方安装入口状态：已发现官方入口\n- 是否在临时目录、临时宿主或容器中验证：必须是\n- 是否能回滚配置改动：必须能\n- 是否需要 API Key、网络访问、读写文件或修改宿主配置：未确认前按高风险处理\n- 是否记录了安装命令、实际输出和失败日志：必须记录\n\n## 当前阻塞项\n\n- 无阻塞项。\n\n## 项目专属踩坑\n\n- 来源证据：performance_start_trace records 'CPU throttling: none / Network throttling: none' despite emulate setting throttling —…（high）：可能增加新用户试用和生产接入成本。 建议检查：来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。\n- 来源证据：Auto-connect doesn't work on WSL with mirrored networking (Chrome on Windows host)（medium）：可能增加新用户试用和生产接入成本。 建议检查：来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。\n- 来源证据：Update check hardcodes registry.npmjs.org, ignoring user's npm registry configuration（medium）：可能阻塞安装或首次运行。 建议检查：来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。\n- 来源证据：chrome-devtools-mcp: v0.20.1（medium）：可能增加新用户试用和生产接入成本。 建议检查：来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。\n- 来源证据：chrome-devtools-mcp: v0.22.0（medium）：可能增加新用户试用和生产接入成本。 建议检查：来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。\n\n## 风险与权限提示\n\n- no_demo: medium\n\n## 证据缺口\n\n- 暂未发现结构化证据缺口。\n",
      "summary": "安装、权限、验证和推荐前风险。",
      "title": "Boundary & Risk Card / 边界与风险卡"
    },
    "human_manual": {
      "asset_id": "human_manual",
      "filename": "HUMAN_MANUAL.md",
      "markdown": "# https://github.com/ChromeDevTools/chrome-devtools-mcp 项目说明书\n\n生成时间：2026-05-15 14:02:19 UTC\n\n## 目录\n\n- [Project Overview](#overview)\n- [Installation and Setup](#installation)\n- [Configuration Reference](#configuration)\n- [System Architecture](#system-architecture)\n- [MCP Protocol Integration](#mcp-protocol)\n- [Input and Navigation Automation Tools](#automation-tools)\n- [Debugging and Inspection Tools](#debugging-tools)\n- [Performance Analysis Tools](#performance-tools)\n- [CLI Reference](#cli-reference)\n- [Telemetry and Monitoring](#telemetry)\n\n<a id='overview'></a>\n\n## Project Overview\n\n### 相关页面\n\n相关主题：[Installation and Setup](#installation), [System Architecture](#system-architecture), [Configuration Reference](#configuration)\n\n<details>\n<summary>相关源码文件</summary>\n\n以下源码文件用于生成本页说明：\n\n- [AGENTS.md](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/AGENTS.md)\n- [skills/chrome-devtools-cli/SKILL.md](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/skills/chrome-devtools-cli/SKILL.md)\n- [skills/debug-optimize-lcp/SKILL.md](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/skills/debug-optimize-lcp/SKILL.md)\n- [skills/a11y-debugging/SKILL.md](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/skills/a11y-debugging/SKILL.md)\n- [skills/debug-optimize-lcp/references/optimization-strategies.md](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/skills/debug-optimize-lcp/references/optimization-strategies.md)\n- [scripts/eval_scenarios/snapshot_test.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/scripts/eval_scenarios/snapshot_test.ts)\n- [scripts/eval_scenarios/performance_test.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/scripts/eval_scenarios/performance_test.ts)\n- [src/tools/ToolDefinition.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/tools/ToolDefinition.ts)\n- [src/McpResponse.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/McpResponse.ts)\n- [src/tools/webmcp.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/tools/webmcp.ts)\n- [src/PageCollector.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/PageCollector.ts)\n</details>\n\n# Project Overview\n\n## Introduction\n\nThe **chrome-devtools-mcp** project is a Model Context Protocol (MCP) server and command-line interface (CLI) for Chrome DevTools. It provides a comprehensive bridge that enables AI assistants, automated testing systems, and developer tools to programmatically control and interact with Chrome browser instances through Chrome DevTools Protocol (CDP).\n\n资料来源：[AGENTS.md](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/AGENTS.md)\n\n## Core Purpose and Scope\n\nThe project serves as an abstraction layer that exposes Chrome DevTools capabilities as MCP tools, making browser automation accessible through a standardized protocol. This enables use cases including:\n\n- **AI-Powered Browser Automation**: Allowing language models to control browsers for research, testing, and data extraction\n- **Performance Analysis**: Capturing traces, analyzing Largest Contentful Paint (LCP), and measuring page load metrics\n- **Accessibility Auditing**: Running automated accessibility checks and inspecting the accessibility tree\n- **End-to-End Testing**: Automating user interactions including navigation, form filling, and element inspection\n- **WebMCP Tool Execution**: Running custom tools exposed by web pages through the WebMCP protocol\n\n资料来源：[skills/chrome-devtools-cli/SKILL.md](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/skills/chrome-devtools-cli/SKILL.md)\n\n## Architecture Overview\n\nThe system follows a layered architecture with distinct components:\n\n```mermaid\ngraph TD\n    A[CLI / AI Agent] --> B[MCP Server]\n    B --> C[Tool Registry]\n    C --> D[CDP Client]\n    D --> E[Chrome Browser]\n    F[WebMCP Tools] -.-> B\n    G[PageCollector] --> H[Event Listeners]\n    H --> E\n```\n\n### Component Layers\n\n| Layer | Purpose | Key Files |\n|-------|---------|-----------|\n| **MCP Protocol** | Standardized communication interface | `src/McpResponse.ts` |\n| **Tool System** | Tool definitions and schema validation | `src/tools/ToolDefinition.ts` |\n| **CDP Bridge** | Chrome DevTools Protocol communication | `src/PageCollector.ts` |\n| **Skills Layer** | Domain-specific tool groupings | `skills/*/SKILL.md` |\n\n资料来源：[src/McpResponse.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/McpResponse.ts) and [src/PageCollector.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/PageCollector.ts)\n\n## Tool Categories\n\nThe project organizes tools into the following categories:\n\n| Category | Description | Example Tools |\n|----------|-------------|---------------|\n| **Navigation** | Page navigation and management | `navigate_page`, `new_page`, `close_page`, `select_page` |\n| **Inspection** | Page content and state inspection | `take_snapshot`, `take_screenshot`, `evaluate_script` |\n| **Interaction** | User simulation | `type_text`, `press_key`, `fill_form`, `upload_file` |\n| **Performance** | Performance measurement and tracing | `performance_start_trace`, `performance_stop_trace`, `take_memory_snapshot` |\n| **Emulation** | Browser environment simulation | `emulate`, `resize_page` |\n| **Network** | Network request inspection | (Network-related tools) |\n| **Accessibility** | A11y auditing | Lighthouse-based accessibility audits |\n| **WEBMCP** | Dynamic page-exposed tools | `list_webmcp_tools`, `execute_webmcp_tool` |\n\n资料来源：[skills/chrome-devtools-cli/SKILL.md](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/skills/chrome-devtools-cli/SKILL.md)\n\n## Page Management System\n\nThe `PageCollector` class manages multiple browser pages using Chrome's target lifecycle:\n\n```mermaid\ngraph LR\n    A[Browser Instance] -->|targetcreated| B[PageCollector]\n    A -->|targetdestroyed| B\n    B --> C[WeakMap Storage]\n    C --> D[Navigation History]\n    D --> E[Resource Tracking]\n```\n\nKey characteristics:\n- **Multiple Page Support**: Manages several open pages simultaneously\n- **Navigation History**: Stores up to 3 recent navigations per page (`maxNavigationSaved = 3`)\n- **Resource Tracking**: Collects resources per navigation sub-list\n- **Event-Driven**: Listens to Chrome target lifecycle events\n\n资料来源：[src/PageCollector.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/PageCollector.ts)\n\n## Tool Definition System\n\nThe tool system uses TypeScript and Zod for schema validation. Two primary tool types exist:\n\n### Global Tools\n\nTools that operate independently of page context:\n\n```typescript\nexport function defineTool<Schema extends zod.ZodRawShape>(\n  definition: ToolDefinition<Schema>,\n): DefinedTool<Schema>;\n```\n\n### Page-Scoped Tools\n\nTools that require a selected page context:\n\n```typescript\nexport function definePageTool<Schema extends zod.ZodRawShape>(\n  definition: PageToolDefinition<Schema>,\n): DefinedPageTool<Schema>;\n```\n\n#### Page Scope Schema\n\n```typescript\nexport const pageIdSchema = {\n  pageId: zod.number().optional().describe('Targets a specific page by ID.'),\n};\n```\n\n#### Timeout Schema\n\n```typescript\nexport const timeoutSchema = {\n  timeout: zod\n    .number()\n    .int()\n    .optional()\n    .describe(\n      `Maximum wait time in milliseconds. If set to 0, the default timeout will be used.`,\n    ),\n};\n```\n\n资料来源：[src/tools/ToolDefinition.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/tools/ToolDefinition.ts)\n\n## WebMCP Integration\n\nWebMCP enables web pages to expose custom tools that can be discovered and executed by this MCP server. The system provides two tools:\n\n| Tool | Purpose |\n|------|---------|\n| `list_webmcp_tools` | Lists all WebMCP tools the current page exposes |\n| `execute_webmcp_tool` | Executes a named WebMCP tool with optional JSON parameters |\n\n```typescript\nexport const listWebMcpTools = definePageTool({\n  name: 'list_webmcp_tools',\n  description: `Lists all WebMCP tools the page exposes.`,\n  annotations: {\n    category: ToolCategory.WEBMCP,\n    readOnlyHint: true,\n  },\n  schema: {},\n  blockedByDialog: false,\n});\n```\n\n资料来源：[src/tools/webmcp.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/tools/webmcp.ts)\n\n## Navigation Tools\n\nThe project provides comprehensive navigation capabilities:\n\n### Basic Navigation\n\n| Command | Description |\n|---------|-------------|\n| `new_page` | Creates a new page, optionally at a specified URL |\n| `navigate_page` | Navigates the selected page to a URL or performs back/reload |\n| `select_page` | Selects a page as the context for future tool calls |\n| `close_page` | Closes a page by index |\n\n### Navigation Options\n\n```typescript\ninterface NavigationOptions {\n  url?: string;                    // Target URL\n  type?: 'navigate' | 'back' | 'reload';\n  timeout?: number;                // Navigation timeout in ms\n  ignoreCache?: boolean;          // Ignore cache on reload\n  bringToFront?: boolean;         // Bring page to front after selection\n  background?: boolean;            // Create page in background\n  isolatedContext?: string;       // Isolated world context name\n  handleBeforeUnload?: 'accept' | 'dismiss';\n  initScript?: string;             // JavaScript to run after navigation\n}\n```\n\n资料来源：[skills/chrome-devtools-cli/SKILL.md](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/skills/chrome-devtools-cli/SKILL.md)\n\n## Performance Analysis Tools\n\n### Tracing Workflow\n\n```mermaid\ngraph LR\n    A[performance_start_trace] --> B[User Interactions]\n    B --> C[performance_stop_trace]\n    C --> D[Trace Analysis]\n    D --> E[insight_analyze_insight]\n```\n\n### Available Performance Tools\n\n| Tool | Purpose |\n|------|---------|\n| `performance_start_trace` | Starts performance trace recording |\n| `performance_stop_trace` | Stops the active trace |\n| `performance_analyze_insight` | Gets details on specific Performance Insights |\n| `take_memory_snapshot` | Captures memory heapsnapshot |\n\n### LCP Optimization Debugging\n\nThe project includes specialized tools for debugging Largest Contentful Paint issues:\n\n1. **Identify LCP Element**: Extract element tag, id, className, URL, and timing data\n2. **Audit Common Issues**: Check for lazy-loaded images in viewport, missing fetchpriority\n3. **Optimization Strategies**: Preload, fetchpriority, modern formats, critical CSS inlining\n\n资料来源：[skills/debug-optimize-lcp/SKILL.md](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/skills/debug-optimize-lcp/SKILL.md) and [skills/debug-optimize-lcp/references/optimization-strategies.md](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/skills/debug-optimize-lcp/references/optimization-strategies.md)\n\n## Accessibility Debugging Tools\n\n### Core A11y Workflow\n\n```mermaid\ngraph TD\n    A[Lighthouse Audit] --> B{Analyze Score}\n    B -->|Score < 1| C[Review Failed Audits]\n    B -->|Pass| D[Snapshot Tree]\n    C --> D\n    D --> E[Check Semantics]\n    E --> F[Verify Labels]\n    F --> G[Test Keyboard Nav]\n```\n\n### Key Capabilities\n\n- **Automated Audits**: Run Lighthouse accessibility audits with JSON report output\n- **Accessibility Tree Inspection**: Use `take_snapshot` to capture the semantic structure\n- **Semantic Analysis**: Verify heading hierarchy, ARIA landmarks\n- **Label Verification**: Ensure all form inputs have associated labels\n- **Keyboard Navigation**: Test focus management using `press_key` with Tab navigation\n\n资料来源：[skills/a11y-debugging/SKILL.md](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/skills/a11y-debugging/SKILL.md)\n\n## Evaluation Framework\n\nThe project includes a test framework for verifying tool usage correctness:\n\n```typescript\nexport interface TestScenario {\n  prompt: string;           // The prompt to send to the model\n  maxTurns: number;        // Maximum conversation turns\n  htmlRoute?: {            // Optional custom HTML for testing\n    path: string;\n    htmlContent: string;\n  };\n  expectations: (calls: ToolCall[]) => void;  // Validation function\n}\n```\n\n### Example Test Scenarios\n\n| Scenario | Purpose |\n|----------|---------|\n| `snapshot_test.ts` | Verifies navigation followed by snapshot capture |\n| `performance_test.ts` | Verifies navigation followed by trace start |\n| `fill_select_and_checkboxes_test.ts` | Verifies form interaction patterns |\n\n资料来源：[scripts/eval_scenarios/snapshot_test.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/scripts/eval_scenarios/snapshot_test.ts) and [scripts/eval_scenarios/performance_test.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/scripts/eval_scenarios/performance_test.ts)\n\n## Response Format\n\nThe MCP response system supports structured output with multiple content sections:\n\n| Section | Content |\n|---------|---------|\n| `toolDefinitions` | List of available tools with schemas |\n| `webmcpTools` | Page-exposed WebMCP tools |\n| `networkRequests` | Captured network requests (when enabled) |\n| `pagination` | Pagination metadata for large result sets |\n\n```typescript\nstructuredContent.webmcpTools = data.webmcpTools.map(\n  ({name, description, inputSchema, annotations}) => ({\n    name,\n    description,\n    inputSchema,\n    annotations,\n  }),\n);\n```\n\n资料来源：[src/McpResponse.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/McpResponse.ts)\n\n## Build and Development\n\n### Available npm Scripts\n\n| Script | Purpose |\n|--------|---------|\n| `npm run build` | Compile TypeScript and verify build |\n| `npm run test` | Build and run all tests |\n| `npm run test <path>` | Build and run a single test file |\n| `npm run format` | Fix formatting and show linting errors |\n| `npm run gen` | Generate tool reference documentation |\n\n### TypeScript Guidelines\n\nThe project enforces strict TypeScript practices:\n\n- **No `any` type**: Use proper generics and unknown types\n- **No `as` keyword**: Use type guards and type predicates\n- **No `!` operator**: Use explicit null checks\n- **No `// @ts-ignore`**: Fix actual type issues\n- **Prefer `for..of`**: Over `forEach` for better type inference\n\n资料来源：[AGENTS.md](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/AGENTS.md)\n\n## Installation\n\nThe CLI can be installed globally via npm:\n\n```bash\nnpm i chrome-devtools-mcp@latest -g\nchrome-devtools status  # Verify installation\n```\n\nTroubleshooting tips include ensuring the global npm `bin` directory is in PATH and avoiding `sudo` by using node version managers.\n\n资料来源：[skills/chrome-devtools-cli/references/installation.md](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/skills/chrome-devtools-cli/references/installation.md)\n\n## Summary\n\nThe chrome-devtools-mcp project provides a powerful bridge between AI assistants and Chrome DevTools, enabling programmatic browser control through a well-structured MCP interface. Its comprehensive tool system covers navigation, inspection, interaction, performance analysis, and accessibility auditing, while the WebMCP integration allows dynamic tool exposure from web pages. The TypeScript-based architecture with Zod schema validation ensures type safety and developer productivity, making it suitable for both automated testing and AI-driven browser interactions.\n\n---\n\n<a id='installation'></a>\n\n## Installation and Setup\n\n### 相关页面\n\n相关主题：[Project Overview](#overview), [Configuration Reference](#configuration)\n\n<details>\n<summary>相关源码文件</summary>\n\n以下源码文件用于生成本页说明：\n\n- [AGENTS.md](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/AGENTS.md)\n- [CONTRIBUTING.md](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/CONTRIBUTING.md)\n- [skills/chrome-devtools-cli/references/installation.md](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/skills/chrome-devtools-cli/references/installation.md)\n- [skills/chrome-devtools-cli/SKILL.md](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/skills/chrome-devtools-cli/SKILL.md)\n- [package.json](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/package.json)\n</details>\n\n# Installation and Setup\n\nThis page covers all methods for installing and configuring the **chrome-devtools-mcp** project, including global CLI usage, local development setup, and MCP server integration.\n\n## Overview\n\nThe chrome-devtools-mcp project provides two primary interfaces:\n\n1. **CLI Tool** (`chrome-devtools`) - A command-line interface for terminal-based browser automation\n2. **MCP Server** - A Model Context Protocol server for integrating Chrome DevTools into AI assistants\n\nThe installation approach depends on your use case:\n\n| Use Case | Recommended Method | Installation Command |\n|----------|-------------------|---------------------|\n| Terminal automation | Global CLI | `npm i chrome-devtools-mcp@latest -g` |\n| AI assistant integration | MCP Server | Clone and build from source |\n| Development contribution | Local development | Clone, install dependencies, build |\n\n资料来源：[skills/chrome-devtools-cli/references/installation.md:1-5]()\n\n## Prerequisites\n\n### Node.js Version Requirement\n\nThe project requires a specific Node.js version defined in `.nvmrc`. Before installation, ensure you have the correct version:\n\n```bash\n# Check the required Node.js version\ncat .nvmrc\n```\n\nUsing a Node version manager (such as nvm) is strongly recommended to avoid permission errors and manage multiple Node versions.\n\n资料来源：[CONTRIBUTING.md:31-35]()\n\n### System Requirements\n\n- **Operating System**: macOS, Linux, or Windows with WSL\n- **Chrome/Chromium**: Chrome browser must be installed on the system\n- **npm**: Node Package Manager (included with Node.js)\n- **Optional**: ffmpeg (required only for experimental screencast feature)\n\n## Method 1: Global CLI Installation\n\n### Installation\n\nInstall the package globally to make the `chrome-devtools` command available system-wide:\n\n```bash\nnpm i chrome-devtools-mcp@latest -g\n```\n\n资料来源：[skills/chrome-devtools-cli/references/installation.md:5]()\n\n### Verification\n\nAfter installation, verify the setup:\n\n```bash\nchrome-devtools status\n```\n\nA successful output indicates the CLI is properly installed and accessible.\n\n资料来源：[skills/chrome-devtools-cli/references/installation.md:7]()\n\n## Method 2: Local Development Setup\n\nFor contributing to the project or running the latest development version:\n\n### Workflow Diagram\n\n```mermaid\ngraph TD\n    A[Clone Repository] --> B[Check Node.js Version]\n    B --> C{nvm installed?}\n    C -->|No| D[Install nvm]\n    C -->|Yes| E[Run nvm use]\n    D --> E\n    E --> F[Run npm ci]\n    F --> G[Run npm run build]\n    G --> H[Verify with npm run test]\n    H --> I[Setup Complete]\n```\n\n### Step-by-Step Instructions\n\n#### 1. Clone the Repository\n\n```bash\ngit clone https://github.com/ChromeDevTools/chrome-devtools-mcp.git\ncd chrome-devtools-mcp\n```\n\n资料来源：[CONTRIBUTING.md:33-36]()\n\n#### 2. Set Node.js Version\n\n```bash\nnvm use\n```\n\nThis reads the version from `.nvmrc` and switches to the correct Node.js version.\n\n#### 3. Install Dependencies\n\n```bash\nnpm ci\n```\n\nThe `npm ci` command performs a clean install using the exact versions from `package-lock.json`, ensuring consistency across environments.\n\n资料来源：[CONTRIBUTING.md:36]()\n\n#### 4. Build the Project\n\n```bash\nnpm run build\n```\n\nThis command runs TypeScript compilation (`tsc`) and verifies the build succeeds. The build output is placed in the `build/` directory.\n\n资料来源：[AGENTS.md:5]()\n\n### Available npm Scripts\n\n| Script | Purpose |\n|--------|---------|\n| `npm run build` | Compile TypeScript and test build |\n| `npm run test` | Build and run all tests |\n| `npm run test <path>` | Build and run a single test file |\n| `npm run format` | Fix formatting and show linting errors |\n\n资料来源：[AGENTS.md:5-10]()\n\n## Method 3: MCP Server Configuration\n\nFor integrating with AI assistants that support the Model Context Protocol.\n\n### Configuration Schema\n\n```json\n{\n  \"mcpServers\": {\n    \"chrome-devtools\": {\n      \"command\": \"node\",\n      \"args\": [\"/path-to/build/src/bin/chrome-devtools-mcp.js\"]\n    }\n  }\n}\n```\n\n资料来源：[CONTRIBUTING.md:45-51]()\n\n### MCP Server Binary Location\n\nAfter building, the MCP server executable is located at:\n\n```\nbuild/src/bin/chrome-devtools-mcp.js\n```\n\n### Using with Inspector\n\nTest the MCP server using the official inspector:\n\n```bash\nnpx @modelcontextprotocol/inspector node /build/src/bin/chrome-devtools-mcp.js\n```\n\n资料来源：[CONTRIBUTING.md:40-43]()\n\n### VS Code SSH Configuration\n\nWhen running the inspector with VS Code SSH, two ports are spawned:\n\n| Port | Purpose |\n|------|---------|\n| 6274 | Primary service (auto-forwarded by VS Code) |\n| 6277 | Secondary service (requires manual forwarding) |\n\nManual port forwarding may be required for port 6277.\n\n资料来源：[CONTRIBUTING.md:54-58]()\n\n## Service Management\n\nThe CLI includes service management commands:\n\n```bash\nchrome-devtools start   # Start or restart chrome-devtools-mcp\nchrome-devtools status  # Check if chrome-devtools-mcp is running\nchrome-devtools stop    # Stop chrome-devtools-mcp if running\n```\n\n资料来源：[skills/chrome-devtools-cli/SKILL.md:67-70]()\n\nFor AI workflows, the background server starts implicitly on first tool call—do not manually run `start`/`status`/`stop` before each use.\n\n## CLI Arguments and Configuration\n\nConfigure the MCP server behavior using CLI arguments in your MCP configuration:\n\n```bash\nnpx chrome-devtools-mcp@latest --help\n```\n\n### Common Configuration Flags\n\n| Flag | Description | Example |\n|------|-------------|---------|\n| `--categoryExtensions` | Enable Chrome extension support | `--categoryExtensions` |\n| `--experimentalVision` | Enable experimental vision tools | `--experimentalVision=true` |\n| `--experimentalScreencast` | Enable screencast (requires ffmpeg) | `--experimentalScreencast=true` |\n| `--categoryExperimentalWebmcp` | Enable experimental WebMCP tools | `--categoryExperimentalWebmcp=true` |\n\n资料来源：[skills/chrome-devtools-cli/SKILL.md:1-3]()\n\n## TypeScript Development Guidelines\n\nWhen developing or contributing to this project, adhere to strict TypeScript rules:\n\n| Rule | Description |\n|------|-------------|\n| No `any` type | Use explicit types |\n| No `as` keyword | Use type guards or proper casting |\n| No `!` operator | Avoid non-null assertions |\n| No `@ts-ignore` | Fix actual type errors |\n| Prefer `for..of` | Over `forEach` |\n\n资料来源：[AGENTS.md:13-20]()\n\n## Troubleshooting\n\n### Command Not Found\n\nIf `chrome-devtools` is not recognized after installation:\n\n1. Ensure your global npm `bin` directory is in your system's `PATH`\n2. Restart your terminal or source your shell configuration file (e.g., `.bashrc`, `.zshrc`)\n\n资料来源：[skills/chrome-devtools-cli/references/installation.md:11-13]()\n\n### Permission Errors\n\nIf you encounter `EACCES` or permission errors during installation:\n\n- **Do not** use `sudo`\n- Use a node version manager like `nvm`\n- Or configure npm to use a different global directory\n\n资料来源：[skills/chrome-devtools-cli/references/installation.md:16-19]()\n\n### Old Version Running\n\nIf an outdated version is running:\n\n```bash\nchrome-devtools stop && npm uninstall -g chrome-devtools-mcp\nnpm i chrome-devtools-mcp@latest -g\n```\n\n资料来源：[skills/chrome-devtools-cli/references/installation.md:22-25]()\n\n### Debug Logging\n\nTo write debug logs to `log.txt` in the working directory, see the debugging section in CONTRIBUTING.md.\n\n资料来源：[CONTRIBUTING.md:62-63]()\n\n## Lighthouse Dependency Updates\n\nThe project bundles Lighthouse for performance auditing. To update the Lighthouse dependency:\n\n1. Update the Lighthouse version in `package.json`\n2. Run `npm install`\n3. Check out the corresponding Lighthouse repository revision to a sibling directory (`../lighthouse`)\n4. Run `npm run update-lighthouse` (requires yarn)\n5. Commit the bundle\n\n资料来源：[CONTRIBUTING.md:24-29]()\n\n## Quick Reference\n\n```bash\n# Global CLI installation\nnpm i chrome-devtools-mcp@latest -g\n\n# Verify installation\nchrome-devtools status\n\n# Development setup\ngit clone https://github.com/ChromeDevTools/chrome-devtools-mcp.git\ncd chrome-devtools-mcp\nnvm use\nnpm ci\nnpm run build\nnpm run test\n\n# MCP server configuration\n{\n  \"mcpServers\": {\n    \"chrome-devtools\": {\n      \"command\": \"node\",\n      \"args\": [\"/path-to/build/src/bin/chrome-devtools-mcp.js\"]\n    }\n  }\n}\n\n---\n\n<a id='configuration'></a>\n\n## Configuration Reference\n\n### 相关页面\n\n相关主题：[Installation and Setup](#installation), [CLI Reference](#cli-reference), [MCP Protocol Integration](#mcp-protocol)\n\n<details>\n<summary>相关源码文件</summary>\n\n以下源码文件用于生成本页说明：\n\n- [src/bin/chrome-devtools-mcp-cli-options.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/bin/chrome-devtools-mcp-cli-options.ts)\n- [src/bin/chrome-devtools-mcp-main.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/bin/chrome-devtools-mcp-main.ts)\n- [puppeteer.config.cjs](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/puppeteer.config.cjs)\n- [.mcp.json](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/.mcp.json)\n</details>\n\n# Configuration Reference\n\nThis page documents all configuration options available for the `chrome-devtools-mcp` project, covering CLI arguments, MCP server initialization, Puppeteer browser settings, and MCP client configuration files.\n\n## Overview\n\nThe `chrome-devtools-mcp` project supports multiple layers of configuration:\n\n1. **CLI Arguments** - Command-line flags passed when starting the MCP server or CLI\n2. **Puppeteer Configuration** - Browser launch and connection settings\n3. **MCP Client Configuration** - JSON configuration for connecting MCP clients\n\nConfiguration flows through the application as follows:\n\n```mermaid\ngraph TD\n    A[CLI Arguments] --> B[chrome-devtools-mcp-cli-options.ts]\n    B --> C[ParsedArguments Type]\n    C --> D[chrome-devtools-mcp-main.ts]\n    D --> E[Puppeteer Launch]\n    F[.mcp.json] --> G[MCP Client]\n    G --> H[MCP Server Connection]\n```\n\n## CLI Configuration\n\nThe MCP server accepts numerous command-line arguments for customization. These are defined in `src/bin/chrome-devtools-mcp-cli-options.ts` and typed via the `ParsedArguments` interface.\n\n### General Options\n\n| Option | Type | Default | Description |\n|--------|------|---------|-------------|\n| `--port` | `number` | `6274` | Port for the MCP server to listen on |\n| `--host` | `string` | `\"127.0.0.1\"` | Host address to bind |\n| `--log-file` | `string` | `undefined` | Path to write debug logs |\n| `--help` | `boolean` | `false` | Show help message |\n\n资料来源：[src/bin/chrome-devtools-mcp-cli-options.ts](src/bin/chrome-devtools-mcp-cli-options.ts)\n\n### Browser Connection Options\n\n| Option | Type | Default | Description |\n|--------|------|---------|-------------|\n| `--browserUrl` | `string` | `undefined` | Connect to an existing Chrome instance at this URL |\n| `--autoConnect` | `boolean` | `true` | Automatically connect to existing Chrome |\n| `--browserPath` | `string` | `undefined` | Custom path to Chrome executable |\n| `--userDataDir` | `string` | `undefined` | Chrome profile directory path |\n\n资料来源：[src/bin/chrome-devtools-mcp-cli-options.ts](src/bin/chrome-devtools-mcp-cli-options.ts)\n\n### Browser Launch Options\n\n| Option | Type | Default | Description |\n|--------|------|---------|-------------|\n| `--headless` | `boolean` | `true` | Run Chrome in headless mode |\n| `--sandbox` | `boolean` | `true` | Enable Chrome sandbox mode |\n| `--noFirstRun` | `boolean` | `true` | Skip first-run dialogs |\n| `--windowSize` | `string` | `\"1920x1080\"` | Default window dimensions |\n\n资料来源：[src/bin/chrome-devtools-mcp-cli-options.ts](src/bin/chrome-devtools-mcp-cli-options.ts)\n\n### MCP Server Categories\n\nThe MCP server organizes tools into categories. Categories can be enabled or disabled using `--category*` flags:\n\n| Option | Type | Default | Description |\n|--------|------|---------|-------------|\n| `--categoryNavigation` | `boolean` | `true` | Navigation tools (navigate_page, new_page) |\n| `--categoryInteraction` | `boolean` | `true` | Interaction tools (click, fill, type) |\n| `--categoryInspection` | `boolean` | `true` | Inspection tools (take_snapshot, take_screenshot) |\n| `--categoryPerformance` | `boolean` | `true` | Performance tools (traces, profiles) |\n| `--categoryNetwork` | `boolean` | `true` | Network tools (network_interceptor) |\n| `--categoryExtensions` | `boolean` | `false` | Chrome extension management |\n| `--categoryExperimental` | `boolean` | `false` | Experimental tools |\n| `--categoryExperimentalWebmcp` | `boolean` | `false` | WebMCP integration tools |\n| `--categoryDebugging` | `boolean` | `false` | Debugging utilities |\n\n```bash\n# Enable extension support\nchrome-devtools-mcp --categoryExtensions=true\n\n# Enable experimental features\nchrome-devtools-mcp --categoryExperimental=true --experimentalVision=true\n```\n\n资料来源：[src/tools/categories.ts](src/tools/categories.ts) 资料来源：[skills/chrome-devtools/SKILL.md](skills/chrome-devtools/SKILL.md)\n\n### Experimental Features\n\nExperimental features require explicit enabling via CLI flags:\n\n| Option | Type | Default | Description |\n|--------|------|---------|-------------|\n| `--experimentalVision` | `boolean` | `false` | Enable coordinate-based clicking (click_at) |\n| `--experimentalScreencast` | `boolean` | `false` | Enable screencast recording |\n\n```bash\n# Start with experimental vision mode\nchrome-devtools-mcp --experimentalVision=true\n```\n\n资料来源：[skills/chrome-devtools-cli/SKILL.md](skills/chrome-devtools-cli/SKILL.md)\n\n### Debugging Options\n\n| Option | Type | Default | Description |\n|--------|------|---------|-------------|\n| `--verbose` | `boolean` | `false` | Enable verbose logging |\n| `DEBUG` | `env` | `undefined` | Debug categories filter |\n\n```sh\n# Run with debug logging to log.txt\nnpx @modelcontextprotocol/inspector node /build/src/bin/chrome-devtools-mcp.js --log-file=/path/to/log.txt\n```\n\n资料来源：[CONTRIBUTING.md](CONTRIBUTING.md)\n\n## Puppeteer Configuration\n\nThe project uses Puppeteer for browser automation. Configuration is defined in `puppeteer.config.cjs` and can be overridden via CLI arguments.\n\n### Configuration File Structure\n\n```javascript\n// puppeteer.config.cjs\nmodule.exports = {\n  puppeteer: {\n    // Browser launch arguments\n    args: [\n      '--no-sandbox',\n      '--disable-setuid-sandbox',\n      '--disable-dev-shm-usage',\n    ],\n    // Default launch settings\n    headless: true,\n  }\n};\n```\n\n### Default Browser Arguments\n\nThe following Chromium arguments are passed by default:\n\n| Argument | Purpose |\n|----------|---------|\n| `--no-sandbox` | Disable sandbox (may be overridden by `--sandbox`) |\n| `--disable-setuid-sandbox` | Prevent setuid complications |\n| `--disable-dev-shm-usage` | Avoid shared memory issues in containers |\n| `--disable-web-security` | Disable web security for testing |\n| `--ash-no-nudges` | Disable Ash nudges |\n\n### Connection Modes\n\nThe MCP server supports two browser connection modes:\n\n```mermaid\ngraph TD\n    A[Start chrome-devtools-mcp] --> B{--browserUrl provided?}\n    B -->|Yes| C[Remote Connection Mode]\n    B -->|No| D[Launch Mode]\n    D --> E{--userDataDir provided?}\n    E -->|Yes| F[Use existing profile]\n    E -->|No| G[Create temporary profile]\n    C --> H[Connect via CDP WebSocket]\n    F --> I[Puppeteer.launch]\n    G --> I\n```\n\n1. **Launch Mode** (default): Puppeteer launches a new Chrome instance\n2. **Remote Connection Mode**: Connect to an existing Chrome via `--browserUrl`\n\n资料来源：[src/bin/chrome-devtools-mcp-main.ts](src/bin/chrome-devtools-mcp-main.ts)\n\n## MCP Client Configuration\n\nThe `.mcp.json` file provides configuration for MCP clients connecting to the server.\n\n### Example Configuration\n\n```json\n{\n  \"mcpServers\": {\n    \"chrome-devtools\": {\n      \"command\": \"npx\",\n      \"args\": [\"chrome-devtools-mcp@latest\"],\n      \"env\": {}\n    }\n  }\n}\n```\n\n### Extended Configuration Example\n\n```json\n{\n  \"mcpServers\": {\n    \"chrome-devtools\": {\n      \"command\": \"node\",\n      \"args\": [\n        \"/path/to/chrome-devtools-mcp/build/src/bin/chrome-devtools-mcp.js\",\n        \"--port\", \"6274\",\n        \"--headless\", \"false\",\n        \"--categoryExtensions\", \"true\"\n      ],\n      \"env\": {}\n    }\n  }\n}\n```\n\n### Configuration for Remote Connection\n\nTo connect to a specific Chrome instance:\n\n```json\n{\n  \"mcpServers\": {\n    \"chrome-devtools\": {\n      \"command\": \"npx\",\n      \"args\": [\n        \"chrome-devtools-mcp@latest\",\n        \"--browserUrl\", \"http://localhost:9222\",\n        \"--autoConnect\", \"true\"\n      ]\n    }\n  }\n}\n```\n\n资料来源：[.mcp.json](.mcp.json)\n\n## Tool Categories and Annotations\n\nTools are annotated with metadata that affects their availability based on configuration:\n\n### Category Reference\n\n| Category | Flag | Description |\n|----------|------|-------------|\n| `NAVIGATION` | `--categoryNavigation` | Page navigation and management |\n| `INTERACTION` | `--categoryInteraction` | User interaction (clicks, fills) |\n| `INSPECTION` | `--categoryInspection` | Page inspection (snapshots, screenshots) |\n| `PERFORMANCE` | `--categoryPerformance` | Performance profiling |\n| `NETWORK` | `--categoryNetwork` | Network request handling |\n| `EXTENSIONS` | `--categoryExtensions` | Chrome extension management |\n| `EXPERIMENTAL` | `--categoryExperimental` | Experimental tools |\n| `EXPERIMENTAL_WEBMCP` | `--categoryExperimentalWebmcp` | WebMCP integration |\n| `DEBUGGING` | `--categoryDebugging` | Debug utilities |\n\n### Tool Annotation Schema\n\n```typescript\ninterface ToolAnnotation {\n  title?: string;\n  category?: ToolCategory;\n  conditions?: string[];  // Required flags for tool availability\n  readOnlyHint?: boolean; // Indicates if tool modifies browser state\n}\n```\n\nTools marked with `readOnlyHint: false` may be blocked in read-only MCP modes.\n\n```mermaid\ngraph LR\n    A[Tool Annotation] --> B[readOnlyHint]\n    A --> C[category]\n    A --> D[conditions]\n    B --> E{Client Mode}\n    C --> F[Category Filter]\n    D --> G[Flag Check]\n    E -->|Plan/ReadOnly| H[Only readOnlyHint=true]\n    E -->|Normal| I[All tools]\n```\n\n资料来源：[src/tools/ToolDefinition.ts](src/tools/ToolDefinition.ts) 资料来源：[skills/troubleshooting/SKILL.md](skills/troubleshooting/SKILL.md)\n\n## Environment Variables\n\n| Variable | Description |\n|----------|-------------|\n| `DEBUG` | Controls debug logging categories (e.g., `DEBUG=*`) |\n| `PUPPETEER_SKIP_DOWNLOAD` | Skip Puppeteer browser download |\n| `PUPPETEER_EXECUTABLE_PATH` | Custom Chrome executable path |\n\n## Configuration Precedence\n\nConfiguration values are resolved in the following order (highest to lowest):\n\n1. **CLI Arguments** - Explicit flags passed at runtime\n2. **Environment Variables** - Set in shell or `.env` files\n3. **Configuration Files** - `.mcp.json`, `puppeteer.config.cjs`\n4. **Default Values** - Built-in defaults in source code\n\n```mermaid\ngraph TD\n    A[Configuration Resolution] --> B[CLI Arguments]\n    A --> C[Environment Variables]\n    A --> D[Config Files]\n    A --> E[Defaults]\n    B --> F[Final Config]\n    C --> F\n    D --> F\n    E --> F\n    style B fill:#ff9999\n    style F fill:#99ff99\n```\n\n## Quick Reference\n\n### Minimal Configuration\n\n```bash\n# Default settings (headless, localhost:6274)\nnpx chrome-devtools-mcp@latest\n```\n\n### Common Configurations\n\n```bash\n# Visible browser with extensions\nchrome-devtools-mcp --headless=false --categoryExtensions=true\n\n# Remote Chrome connection\nchrome-devtools-mcp --browserUrl=http://localhost:9222\n\n# Custom port\nchrome-devtools-mcp --port=9000\n```\n\n## Troubleshooting Configuration Issues\n\n| Symptom | Likely Cause | Solution |\n|---------|--------------|----------|\n| Only 9 tools available | Read-only mode enforced by MCP client | Disable read-only/Plan mode in client |\n| Extension tools missing | `--categoryExtensions` not enabled | Add `--categoryExtensions=true` |\n| New profile created instead of connecting | Incorrect `--browserUrl` or typo in flags | Verify URL and check for flag typos like `--autoBronnect` |\n| `chrome-devtools` command not found | PATH not configured | Ensure npm global bin is in PATH |\n\n资料来源：[skills/troubleshooting/SKILL.md](skills/troubleshooting/SKILL.md)\n\n---\n\n<a id='system-architecture'></a>\n\n## System Architecture\n\n### 相关页面\n\n相关主题：[Project Overview](#overview), [MCP Protocol Integration](#mcp-protocol), [Telemetry and Monitoring](#telemetry)\n\n<details>\n<summary>Relevant Source Files</summary>\n\n以下源码文件用于生成本页说明：\n\n- [src/tools/ToolDefinition.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/tools/ToolDefinition.ts)\n- [src/PageCollector.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/PageCollector.ts)\n- [src/tools/webmcp.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/tools/webmcp.ts)\n- [src/tools/categories.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/tools/categories.ts)\n- [src/browser.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/browser.ts)\n- [AGENTS.md](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/AGENTS.md)\n</details>\n\n# System Architecture\n\n## Overview\n\nThe `chrome-devtools-mcp` project implements a Model Context Protocol (MCP) server that provides programmatic control over Chrome DevTools through a well-defined architecture of interconnected components. The system enables AI assistants and CLI tools to interact with a headless Chrome browser instance by exposing browser operations as typed tools with schema validation.\n\nThe architecture follows a layered design pattern with clear separation between the protocol layer (MCP), the tool definition system, browser management, and page-level interactions. This modular approach allows for extensibility while maintaining type safety and consistent behavior across all exposed functionality.\n\n资料来源：[AGENTS.md]()\n\n## High-Level Architecture\n\n```mermaid\ngraph TD\n    subgraph \"Client Layer\"\n        CLI[CLI Tool<br>chrome-devtools]\n        AI[AI Assistant<br>MCP Client]\n    end\n\n    subgraph \"MCP Protocol Layer\"\n        MCP[MCP Server<br>Protocol Handler]\n        TDEF[Tool Definitions<br>Registry]\n    end\n\n    subgraph \"Tool System\"\n        PAGES[Page Tools<br>Context-Aware]\n        GLOB[Global Tools<br>Browser-Level]\n    end\n\n    subgraph \"Browser Layer\"\n        CHROME[Chrome Browser<br>Puppeteer/CDP]\n        PAGES_BROWSER[Pages<br>Target Management]\n    end\n\n    CLI --> MCP\n    AI --> MCP\n    MCP --> TDEF\n    TDEF --> PAGES\n    TDEF --> GLOB\n    MCP --> CHROME\n    CHROME --> PAGES_BROWSER\n```\n\n## Core Components\n\n### 1. Tool Definition System\n\nThe tool definition system is the foundation of the MCP server's extensibility. It provides factory functions for creating both page-scoped and global tools with automatic schema validation.\n\n| Component | File | Purpose |\n|-----------|------|---------|\n| `defineTool` | `src/tools/ToolDefinition.ts:11-30` | Factory for global tools |\n| `definePageTool` | `src/tools/ToolDefinition.ts:52-90` | Factory for page-scoped tools |\n| `ToolCategory` | `src/tools/categories.ts` | Tool categorization enum |\n\nThe `defineTool` function supports two invocation patterns:\n\n```typescript\n// Direct tool definition\ndefineTool({\n  name: 'tool_name',\n  schema: { /* zod schema */ },\n  handler: async (request, response, context) => { /* ... */ }\n});\n\n// Factory pattern with arguments\ndefineTool((args?: Args) => ({\n  name: 'tool_name',\n  schema: { /* zod schema using args */ },\n  handler: async (request, response, context) => { /* ... */ }\n}));\n```\n\n资料来源：[src/tools/ToolDefinition.ts:11-30]()\n\n### 2. Page Scoped Tools\n\nPage-scoped tools are tools that operate within the context of a specific browser page. They receive an additional `page` property in the request object and have access to the page's DOM, JavaScript context, and rendering state.\n\n```typescript\nexport function definePageTool<\n  Schema extends zod.ZodRawShape,\n  Args extends ParsedArguments = ParsedArguments,\n>(\n  definition:\n    | PageToolDefinition<Schema>\n    | ((args?: Args) => PageToolDefinition<Schema>),\n): DefinedPageTool<Schema> | ((args?: Args) => DefinedPageTool<Schema>)\n```\n\nThe returned tool automatically receives the `pageScoped: true` marker, which the MCP server uses to route requests appropriately. Each page-scoped tool handler receives:\n\n- `request`: Contains both the parsed schema arguments and `{ page: ContextPage }`\n- `response`: Response object for sending results back to the client\n- `context`: Full context object with browser and session information\n\n资料来源：[src/tools/ToolDefinition.ts:52-90]()\n\n### 3. Page Collector Pattern\n\nThe `PageCollector` class manages the lifecycle of browser pages and collects events/data from them. It implements the observer pattern for tracking page creation and destruction.\n\n```mermaid\ngraph TD\n    subgraph \"PageCollector Lifecycle\"\n        INIT[init(pages: Page[])]\n        ADD[addPage(page)]\n        LISTEN[Start Event Listeners]\n    end\n\n    subgraph \"Event Handling\"\n        CREATED[targetcreated<br>Event]\n        DESTROYED[targetdestroyed<br>Event]\n    end\n\n    subgraph \"Storage\"\n        STORAGE[(WeakMap&lt;Page,<br>Array&lt;Array&lt;WithSymbolId&lt;T&gt;&gt;&gt;&gt;)]\n    end\n\n    INIT --> ADD\n    ADD --> LISTEN\n    CREATED --> ADD\n    LISTEN --> STORAGE\n```\n\nKey characteristics of the `PageCollector`:\n\n| Property | Description |\n|----------|-------------|\n| `#browser` | Reference to the Puppeteer Browser instance |\n| `#listenersInitializer` | Factory function for creating event listeners |\n| `#listeners` | WeakMap tracking active listeners per page |\n| `maxNavigationSaved` | Maximum navigations to retain (default: 3) |\n| `storage` | WeakMap storing collected data per page |\n\n资料来源：[src/PageCollector.ts]()\n\n### 4. Browser Management\n\nThe browser module (`src/browser.ts`) handles the initialization and lifecycle of the Puppeteer-based Chrome browser instance. It provides the foundation for all page operations and CDP (Chrome DevTools Protocol) interactions.\n\nThe browser layer is responsible for:\n\n- Launching headless Chrome with appropriate flags\n- Managing browser context and isolated worlds\n- Coordinating page creation and destruction\n- Providing access to CDP sessions for advanced operations\n\n资料来源：[src/browser.ts]()\n\n### 5. WebMCP Tool System\n\nThe WebMCP system allows pages to expose their own tools to the MCP server, enabling dynamic tool discovery and execution from web applications.\n\n```mermaid\ngraph LR\n    WEB[Web Application<br>Exposes Tools]\n    MCP[MCP Server]\n    EXEC[execute_webmcp_tool]\n    LIST[list_webmcp_tools]\n\n    WEB --> LIST\n    LIST --> WEB\n    WEB --> EXEC\n    EXEC --> WEB\n```\n\nTwo primary tools manage WebMCP functionality:\n\n| Tool | Purpose |\n|------|---------|\n| `list_webmcp_tools` | Enumerates all WebMCP tools exposed by the current page |\n| `execute_webmcp_tool` | Invokes a named WebMCP tool with optional parameters |\n\n```typescript\nexport const listWebMcpTools = definePageTool({\n  name: 'list_webmcp_tools',\n  description: `Lists all WebMCP tools the page exposes.`,\n  annotations: {\n    category: ToolCategory.WEBMCP,\n    readOnlyHint: true,\n  },\n  schema: {},\n  blockedByDialog: false,\n  handler: async (_request, response, _context) => {\n    response.setListWebMcpTools();\n  },\n});\n```\n\n资料来源：[src/tools/webmcp.ts]()\n\n## Tool Categories\n\nTools are organized into categories for logical grouping and documentation purposes. The category system enables documentation generation and tool discovery.\n\n| Category | Description |\n|----------|-------------|\n| `WEBMCP` | Tools exposed by web pages themselves |\n| Navigation | Page navigation and history operations |\n| Input | Form filling, clicking, keyboard input |\n| Capture | Screenshots, snapshots, memory profiling |\n| Network | Network request inspection and manipulation |\n| Performance | Tracing, profiling, performance insights |\n\n资料来源：[src/tools/categories.ts]()\n\n## Request/Response Flow\n\n```mermaid\nsequenceDiagram\n    participant Client\n    participant MCP as MCP Server\n    participant TDEF as Tool Definitions\n    participant HANDLER as Tool Handler\n    participant BROWSER as Browser/Page\n\n    Client->>MCP: Tool Request (with args)\n    MCP->>TDEF: Lookup Tool Definition\n    TDEF-->>MCP: Schema + Handler Reference\n    MCP->>MCP: Validate Arguments (Zod)\n    MCP->>HANDLER: Invoke Handler(request, response, context)\n    HANDLER->>BROWSER: CDP Commands / Puppeteer API\n    BROWSER-->>HANDLER: Result\n    HANDLER-->>MCP: Update Response\n    MCP-->>Client: JSON-RPC Response\n```\n\n## Tool Schema System\n\nAll tool parameters are validated using Zod schemas, ensuring type safety and providing automatic OpenAPI-style documentation.\n\n```typescript\n// Schema definition example\nschema: {\n  toolName: zod.string().describe('The name of the WebMCP tool to execute'),\n  input: zod\n    .string()\n    .optional()\n    .describe('The JSON-stringified parameters to pass to the WebMCP tool'),\n}\n```\n\nThe schema system supports:\n\n- **Required/Optional detection**: Automatically determines if fields are required based on Zod type\n- **Type transformations**: Applied via `.transform()` for input normalization\n- **Descriptions**: Extracted for documentation generation\n- **Enumerations**: Validated against allowed values\n\nCommon schema utilities include:\n\n| Schema | File | Purpose |\n|--------|------|---------|\n| `pageIdSchema` | `ToolDefinition.ts:95-97` | Optional page targeting |\n| `timeoutSchema` | `ToolDefinition.ts:99-107` | Timeout with zero-to-undefined transform |\n| `viewportTransform` | `ToolDefinition.ts` | Viewport dimension parsing |\n\n资料来源：[src/tools/ToolDefinition.ts:95-107]()\n\n## Error Handling Patterns\n\nThe architecture defines specific error constants for expected failure conditions:\n\n```typescript\nexport const CLOSE_PAGE_ERROR =\n  'The last open page cannot be closed. It is fine to keep it open.';\n```\n\nThis error message indicates that the MCP server intentionally allows users to keep the final browser page open rather than forcing closure, which is a deliberate UX decision for browser automation workflows.\n\n## Type Safety Guarantees\n\nThe codebase enforces strict TypeScript practices to maintain type safety:\n\n| Rule | Rationale |\n|------|-----------|\n| No `any` type | Prevents untyped data flow |\n| No `as` casting | Avoids bypass of type checking |\n| No `!` assertions | Prevents unsafe assumptions |\n| No `// @ts-ignore` | Maintains full type coverage |\n| Prefer `for..of` over `forEach` | Better async/await compatibility |\n\n资料来源：[AGENTS.md]()\n\n## Build and Test Infrastructure\n\n```mermaid\ngraph LR\n    subgraph \"Build Commands\"\n        BUILD[npm run build<br>tsc compilation]\n        TEST[npm run test<br>Build + Run Tests]\n        FORMAT[npm run format<br>Fix linting]\n        GEN[npm run gen<br>Generate Docs]\n    end\n\n    subgraph \"Output Artifacts\"\n        JS[JavaScript<br>/build/src]\n        TYPES[Type Declarations<br>/build/src]\n        DOCS[Markdown Docs<br>/skills/*]\n    end\n\n    BUILD --> JS\n    BUILD --> TYPES\n    TEST --> JS\n    GEN --> DOCS\n```\n\nThe project uses a standardized build pipeline that ensures type correctness at compile time and provides consistent tooling for development tasks.\n\n## Summary\n\nThe chrome-devtools-mcp system architecture provides:\n\n1. **Extensible Tool System**: Factory functions for creating typed, validated tools\n2. **Page Context Awareness**: Automatic injection of page context into tool handlers\n3. **Event-Driven Page Management**: Observer pattern for tracking browser page lifecycle\n4. **Schema Validation**: Zod-based runtime validation with compile-time type inference\n5. **WebMCP Integration**: Bidirectional tool exposure between server and web pages\n6. **Strict Type Safety**: No escape hatches for type checking, ensuring reliability\n\nThis architecture enables reliable browser automation while maintaining the flexibility needed for diverse use cases ranging from simple navigation to complex performance profiling and accessibility debugging.\n\n---\n\n<a id='mcp-protocol'></a>\n\n## MCP Protocol Integration\n\n### 相关页面\n\n相关主题：[System Architecture](#system-architecture), [Input and Navigation Automation Tools](#automation-tools), [Debugging and Inspection Tools](#debugging-tools)\n\n<details>\n<summary>Relevant Source Files</summary>\n\n以下源码文件用于生成本页说明：\n\n- [src/index.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/index.ts)\n- [src/McpResponse.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/McpResponse.ts)\n- [src/tools/ToolDefinition.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/tools/ToolDefinition.ts)\n- [src/tools/webmcp.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/tools/webmcp.ts)\n- [src/tools/categories.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/tools/categories.ts)\n- [scripts/generate-docs.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/scripts/generate-docs.ts)\n</details>\n\n# MCP Protocol Integration\n\n## Overview\n\nThe `chrome-devtools-mcp` project implements a Model Context Protocol (MCP) server that enables AI assistants and MCP clients to interact with Chrome DevTools programmatically. This integration provides a standardized interface for browser automation, debugging, and performance analysis through a collection of well-defined tools.\n\nThe MCP protocol serves as the communication layer between AI assistants and the Chrome browser, allowing tools to be discovered, invoked, and executed remotely. The server handles tool registration, request routing, response formatting, and maintains state across multiple browser pages.\n\n资料来源：[src/index.ts:1-50](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/index.ts)\n\n## Architecture\n\n### High-Level System Design\n\n```mermaid\ngraph TD\n    MCP_CLIENT[\"MCP Client / AI Assistant\"]\n    MCP_SERVER[\"MCP Server<br/>(chrome-devtools-mcp)\"]\n    TOOL_REGISTRY[\"Tool Registry\"]\n    BROWSER[\"Chrome Browser\"]\n    CDP[\"Chrome DevTools Protocol\"]\n    \n    MCP_CLIENT -->|\"Call Tool Request\"| MCP_SERVER\n    MCP_SERVER -->|\"Tool Definitions\"| MCP_CLIENT\n    MCP_SERVER --> TOOL_REGISTRY\n    TOOL_REGISTRY -->|\"Handler Execution\"| MCP_SERVER\n    MCP_SERVER -->|\"CDP Commands\"| BROWSER\n    BROWSER --> CDP\n```\n\n### Tool Registration Flow\n\n```mermaid\ngraph TD\n    START[\"Server Initialization\"] --> CREATE_TOOLS[\"createTools()\"]\n    CREATE_TOOLS --> REGISTER[\"registerTool()\"]\n    REGISTER --> DEFINE[\"definePageTool()\"]\n    DEFINE --> SCHEMA[\"Schema Validation\"]\n    SCHEMA --> HANDLER[\"Handler Mapping\"]\n    HANDLER --> READY[\"Tool Available\"]\n    \n    STYLE REGISTER fill:#90EE90\n    STYLE READY fill:#98FB98\n```\n\nThe MCP server initializes by invoking `createTools()` which returns an array of tool definitions. Each tool is then registered with the MCP server using the protocol's `setRequestHandler()` method. Tools are defined using `definePageTool()` which establishes the tool name, description, input schema, annotations, and handler function.\n\n资料来源：[src/index.ts:40-65](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/index.ts)\n\n## Tool Definition System\n\n### ToolDefinition.ts Pattern\n\nTools are defined using the `definePageTool()` function which creates a structured tool definition with type-safe schemas. The definition includes metadata, validation rules, and the execution handler.\n\n```typescript\nexport const listWebMcpTools = definePageTool({\n  name: 'list_webmcp_tools',\n  description: `Lists all WebMCP tools the page exposes.`,\n  annotations: {\n    category: ToolCategory.WEBMCP,\n    readOnlyHint: true,\n  },\n  schema: {},\n  blockedByDialog: false,\n  handler: async (_request, response, _context) => {\n    response.setListWebMcpTools();\n  },\n});\n```\n\n资料来源：[src/tools/webmcp.ts:15-27](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/tools/webmcp.ts)\n\n### Tool Definition Structure\n\n| Property | Type | Description |\n|----------|------|-------------|\n| `name` | `string` | Unique identifier for the tool |\n| `description` | `string` | Human-readable description for the MCP client |\n| `annotations` | `ToolAnnotations` | Metadata about the tool's behavior |\n| `schema` | `ZodSchema` | Input validation schema |\n| `blockedByDialog` | `boolean` | Whether the tool waits for dialog dismissal |\n| `handler` | `AsyncHandler` | Function that executes the tool |\n\n### Tool Annotations\n\nThe annotation system provides additional metadata about tools that MCP clients can use for tool selection, permission handling, and UI display.\n\n```typescript\ninterface ToolAnnotations {\n  category?: ToolCategory;\n  readOnlyHint?: boolean;\n  conditions?: string[];\n  // Additional annotation properties...\n}\n```\n\n| Annotation | Type | Purpose |\n|------------|------|---------|\n| `category` | `ToolCategory` | Groups tools into logical categories |\n| `readOnlyHint` | `boolean` | Indicates if tool doesn't modify browser state |\n| `conditions` | `string[]` | Flags required for this tool to execute |\n\n资料来源：[src/tools/ToolDefinition.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/tools/ToolDefinition.ts)\n\n## Tool Categories\n\nTools are organized into categories that help MCP clients understand their purpose and scope.\n\n```mermaid\ngraph TD\n    TOOLS[\"All Tools\"]\n    NAV[\"Navigation<br/>(navigate, new_page, close)\"]\n    INPUT[\"Input Automation<br/>(click, fill, type_text)\"]\n    EMULATE[\"Emulation<br/>(viewport, userAgent)\"]\n    PERFORMANCE[\"Performance<br/>(trace, analyze)\"]\n    NETWORK[\"Network<br/>(requests, cookies)\"]\n    WEBMCP[\"WebMCP<br/>(page-exposed tools)\"]\n    \n    TOOLS --> NAV\n    TOOLS --> INPUT\n    TOOLS --> EMULATE\n    TOOLS --> PERFORMANCE\n    TOOLS --> NETWORK\n    TOOLS --> WEBMCP\n```\n\n### Available Categories\n\n| Category | Enum Value | Description |\n|----------|-------------|-------------|\n| Navigation | `ToolCategory.NAVIGATION` | Page navigation and management |\n| Input Automation | `ToolCategory.INPUT` | Element interaction and form input |\n| Emulation | `ToolCategory.EMULATION` | Browser environment simulation |\n| Performance | `ToolCategory.PERFORMANCE` | Tracing and performance analysis |\n| Network | `ToolCategory.NETWORK` | Network request inspection |\n| WebMCP | `ToolCategory.WEBMCP` | Tools exposed by the web page |\n| Accessibility | `ToolCategory.A11Y` | Accessibility auditing |\n| Debug | `ToolCategory.DEBUG` | JavaScript debugging tools |\n\n资料来源：[src/tools/categories.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/tools/categories.ts)\n\n## Response System\n\n### McpResponse Architecture\n\nThe response system formats tool execution results into structured MCP responses that include both human-readable markdown and machine-parseable structured content.\n\n```mermaid\ngraph LR\n    REQUEST[\"Tool Request\"] --> HANDLER[\"Tool Handler\"]\n    HANDLER --> RESPONSE[\"McpResponse\"]\n    RESPONSE -->|Text Content| MARKDOWN[\"Markdown Output\"]\n    RESPONSE -->|Structured Data| JSON[\"JSON / Structured\"]\n    \n    subgraph Response Components\n        TOOL_DEFS[\"Tool Definitions\"]\n        NETWORK[\"Network Requests\"]\n        PAGINATION[\"Pagination Info\"]\n        WEBMCP_TOOLS[\"WebMCP Tools\"]\n    end\n    \n    RESPONSE --> TOOL_DEFS\n    RESPONSE --> NETWORK\n    RESPONSE --> PAGINATION\n    RESPONSE --> WEBMCP_TOOLS\n```\n\n### Response Formatting Features\n\n| Feature | Description |\n|---------|-------------|\n| **Tool Definitions** | Lists all available tools with their schemas |\n| **Network Requests** | Includes network waterfall data when requested |\n| **Pagination** | Handles large result sets with pagination info |\n| **WebMCP Tools** | Lists tools exposed by the current web page |\n| **Structured Content** | Provides machine-readable data alongside text |\n\n资料来源：[src/McpResponse.ts:50-120](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/McpResponse.ts)\n\n### Structured Content Model\n\nThe `structuredContent` object provides programmatic access to response data:\n\n```typescript\ninterface StructuredContent {\n  webmcpTools?: WebMcpToolInfo[];\n  networkRequests?: NetworkRequest[];\n  pagination?: PaginationInfo;\n  [key: string]: unknown;\n}\n```\n\n### Pagination Support\n\nWhen handling large datasets (e.g., network requests), the response includes pagination metadata:\n\n```typescript\nconst paginationData = this.#dataWithPagination(\n  requests,\n  this.#networkRequestsOptions.pagination,\n);\nstructuredContent.pagination = paginationData.pagination;\n```\n\n资料来源：[src/McpResponse.ts:150-180](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/McpResponse.ts)\n\n## WebMCP Integration\n\nWebMCP enables web pages to expose custom tools that MCP clients can discover and invoke. This creates a two-way communication channel where the browser can extend its capabilities based on the loaded page.\n\n```mermaid\ngraph TD\n    MCP_CLIENT[\"MCP Client\"]\n    SERVER[\"MCP Server\"]\n    CHROME[\"Chrome Browser\"]\n    WEB_PAGE[\"Web Page\"]\n    \n    subgraph Discovery Flow\n        CLIENT_LIST[\"list_webmcp_tools\"]\n        SERVER -->|\"Query\"| CHROME\n        CHROME --> WEB_PAGE\n        WEB_PAGE -->|\"Exposes tools\"| CHROME\n        CHROME -->|\"Tool list\"| SERVER\n        SERVER -->|\"Tool names\"| CLIENT_LIST\n    end\n    \n    subgraph Execution Flow\n        EXEC[\"execute_webmcp_tool\"]\n        CLIENT -->|\"toolName + input\"| SERVER\n        SERVER -->|\"Forward\"| CHROME\n        CHROME --> WEB_PAGE\n        WEB_PAGE -->|\"Execute\"| RESULT[\"Result\"]\n    end\n```\n\n### WebMCP Tools\n\n| Tool | Description | Parameters |\n|------|-------------|------------|\n| `list_webmcp_tools` | Lists all tools exposed by the current page | None |\n| `execute_webmcp_tool` | Invokes a WebMCP tool exposed by the page | `toolName`, `input` (JSON string) |\n\nThe `execute_webmcp_tool` accepts input as a JSON string which is parsed and passed to the page-exposed tool:\n\n```typescript\nlet input: Record<string, unknown> = {};\nif (request.params.input) {\n  try {\n    const parsed = JSON.parse(request.params.input);\n    if (typeof parsed === 'object' && parsed !== null) {\n      input = parsed;\n    }\n  } catch (error) {\n    // Handle parse error\n  }\n}\n```\n\n资料来源：[src/tools/webmcp.ts:29-60](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/tools/webmcp.ts)\n\n## Tool Documentation Generation\n\nThe repository includes a documentation generation system that parses tool definitions and produces formatted markdown:\n\n```mermaid\ngraph TD\n    SOURCE[\"Tool Source Files\"]\n    PARSER[\"Documentation Parser\"]\n    ANNOTATIONS[\"Parse Annotations\"]\n    SCHEMA[\"Parse Input Schema\"]\n    CROSSLINKS[\"Add Cross-References\"]\n    OUTPUT[\"Markdown Documentation\"]\n    \n    SOURCE --> PARSER\n    PARSER --> ANNOTATIONS\n    PARSER --> SCHEMA\n    ANNOTATIONS --> CROSSLINKS\n    SCHEMA --> CROSSLINKS\n    CROSSLINKS --> OUTPUT\n```\n\n### Schema Documentation\n\nProperties are sorted by required status first, then alphabetically:\n\n```typescript\nconst propertyNames = Object.keys(properties).sort((a, b) => {\n  const aRequired = required.includes(a);\n  const bRequired = required.includes(b);\n  if (aRequired && !bRequired) return -1;\n  if (!aRequired && bRequired) return 1;\n  return a.localeCompare(b);\n});\n```\n\nRequired properties are marked with `**(required)**` and optional properties with `_(optional)_`.\n\n资料来源：[scripts/generate-docs.ts:100-140](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/scripts/generate-docs.ts)\n\n## Server Initialization\n\n### Startup Sequence\n\n```mermaid\nsequenceDiagram\n    participant CLI as CLI / MCP Client\n    participant Server as MCP Server\n    participant Tools as Tool Registry\n    participant Browser as Chrome Browser\n    \n    CLI->>Server: Initialize with args\n    Server->>Server: parseArguments()\n    Server->>Tools: createTools()\n    Tools->>Server: Tool definitions\n    loop For each tool\n        Server->>Server: registerTool()\n    end\n    Server->>Server: loadIssueDescriptions()\n    Server->>CLI: Server ready\n```\n\n### Tool Registration Implementation\n\n```typescript\nconst tools = createTools(serverArgs);\nfor (const tool of tools) {\n  server.setRequestHandler(\n    {name: tool.name, description: tool.description, ...},\n    async (params) => {\n      return await toolHandler.handle(params);\n    },\n  );\n}\n```\n\n资料来源：[src/index.ts:45-60](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/index.ts)\n\n## Configuration and Flags\n\nThe MCP server accepts various configuration options that affect tool behavior:\n\n| Flag | Description | Default |\n|------|-------------|---------|\n| `--slim` | Disables non-essential features | `false` |\n| `--performanceCrux` | Enable CrUX API for performance data | `true` |\n| `--usageStatistics` | Enable anonymous usage collection | `true` |\n| `--browser-url` | Direct browser connection URL | - |\n| `--autoConnect` | Auto-handshake with running Chrome | `false` |\n| `--logFile` | Debug log file path | - |\n\n### Disclaimer System\n\nThe server logs disclaimers on startup to inform users about data exposure:\n\n```typescript\nexport const logDisclaimers = (args) => {\n  console.error(`chrome-devtools-mcp exposes content of the browser instance...`);\n  \n  if (!args.slim && args.performanceCrux) {\n    console.error(`Performance tools may send trace URLs to Google CrUX API...`);\n  }\n};\n```\n\n资料来源：[src/index.ts:70-90](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/index.ts)\n\n## Type Safety\n\nThe codebase enforces strict TypeScript practices:\n\n| Rule | Enforcement |\n|------|-------------|\n| No `any` type | All types must be explicitly defined |\n| No `as` casts | Use type guards and transforms |\n| No `!` assertions | Use conditional checks |\n| No `@ts-ignore` | Code must compile cleanly |\n| No `@ts-nocheck` | Full type checking required |\n\nTools use Zod schemas for runtime validation, ensuring that the runtime behavior matches the TypeScript types:\n\n```typescript\nschema: {\n  toolName: zod.string().describe('The name of the WebMCP tool to execute'),\n  input: zod.string().optional().describe('The JSON-stringified parameters...'),\n},\n```\n\n资料来源：[src/tools/webmcp.ts:30-40](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/tools/webmcp.ts)\n\n---\n\n<a id='automation-tools'></a>\n\n## Input and Navigation Automation Tools\n\n### 相关页面\n\n相关主题：[Debugging and Inspection Tools](#debugging-tools), [Performance Analysis Tools](#performance-tools), [Configuration Reference](#configuration)\n\n<details>\n<summary>相关源码文件</summary>\n\n以下源码文件用于生成本页说明：\n\n- [src/tools/input.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/tools/input.ts)\n- [src/tools/pages.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/tools/pages.ts)\n- [src/tools/emulation.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/tools/emulation.ts)\n- [src/WaitForHelper.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/WaitForHelper.ts)\n- [src/utils/keyboard.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/utils/keyboard.ts)\n- [docs/tool-reference.md](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/docs/tool-reference.md)\n- [skills/chrome-devtools-cli/SKILL.md](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/skills/chrome-devtools-cli/SKILL.md)\n- [skills/chrome-devtools/SKILL.md](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/skills/chrome-devtools/SKILL.md)\n</details>\n\n# Input and Navigation Automation Tools\n\n## Overview\n\nThe Input and Navigation Automation Tools constitute the core interaction layer of the `chrome-devtools-mcp` project, enabling programmatic control over browser pages through the Chrome DevTools Protocol (CDP). These tools allow AI agents and automated scripts to simulate real user interactions including keyboard input, mouse actions, page navigation, and environment emulation.\n\n**资料来源:** [skills/chrome-devtools/SKILL.md](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/skills/chrome-devtools/SKILL.md)\n\n## Architecture\n\nThe automation system is organized into three primary tool categories that work in concert to provide comprehensive browser control:\n\n```mermaid\ngraph TD\n    A[chrome-devtools-mcp Tools] --> B[Input Tools]\n    A --> C[Navigation Tools]\n    A --> D[Emulation Tools]\n    \n    B --> B1[click]\n    B --> B2[fill]\n    B --> B3[type_text]\n    B --> B4[press_key]\n    B --> B5[hover]\n    B --> B6[drag]\n    B --> B7[upload_file]\n    \n    C --> C1[navigate_page]\n    C --> C2[new_page]\n    C --> C3[select_page]\n    C --> C4[close_page]\n    C --> C5[list_pages]\n    \n    D --> D1[emulate]\n    D --> D2[resize_page]\n    \n    E[WaitForHelper] --> B\n    E --> C\n```\n\n**资料来源:** [src/tools/ToolDefinition.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/tools/ToolDefinition.ts)\n\n## Input Tools\n\nInput tools provide the capability to simulate user interactions with page elements. All input operations require a valid element `uid` obtained from a previous `take_snapshot` call.\n\n**资料来源:** [skills/chrome-devtools-cli/SKILL.md](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/skills/chrome-devtools-cli/SKILL.md)\n\n### Core Input Operations\n\n| Tool | Purpose | Key Parameters |\n|------|---------|----------------|\n| `click` | Click on an element | `uid` (required), `dblClick`, `includeSnapshot` |\n| `fill` | Fill text into input/select | `uid` (required), `value` (required), `includeSnapshot` |\n| `type_text` | Type text character by character | `text` (required), `submitKey`, `includeSnapshot` |\n| `press_key` | Press a key or combination | `key` (required), `includeSnapshot` |\n| `hover` | Hover over an element | `uid` (required), `includeSnapshot` |\n| `drag` | Drag element to destination | `src` (required), `dst` (required), `includeSnapshot` |\n| `upload_file` | Upload file via input element | `uid` (required), `filePath` (required), `includeSnapshot` |\n\n**资料来源:** [src/tools/input.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/tools/input.ts)\n\n### Keyboard Handling\n\nThe keyboard system supports complex key combinations through a modifier parsing mechanism defined in `src/utils/keyboard.ts`:\n\n```typescript\n// Key format: \"Control+A\", \"Control+Shift+R\", \"Alt+F4\"\nconst tokens = parseKey(request.params.key);\nconst [key, ...modifiers] = tokens;\n```\n\n**资料来源:** [src/utils/keyboard.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/utils/keyboard.ts)\n\nSupported modifiers:\n- `Control`\n- `Shift`\n- `Alt`\n- `Meta`\n\n### Interaction Workflow\n\n```mermaid\nsequenceDiagram\n    participant Agent as AI Agent\n    participant Snapshot as take_snapshot\n    participant Input as Input Tool\n    participant Page as Chrome Page\n    \n    Agent->>Page: navigate_page / new_page\n    Agent->>Snapshot: take_snapshot\n    Snapshot-->>Agent: Element UIDs\n    Agent->>Input: click uid=\"1_5\"\n    Input->>Page: CDP Input.dispatchMouseEvent\n    Page-->>Input: Mouse click confirmed\n    Input-->>Agent: Result response\n```\n\n**资料来源:** [skills/chrome-devtools/SKILL.md](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/skills/chrome-devtools/SKILL.md)\n\n### Common Input Patterns\n\n**Typing with Submit:**\n```bash\nchrome-devtools type_text \"hello\" --submitKey \"Enter\"\n```\n\n**Click with Snapshot:**\n```bash\nchrome-devtools click \"uid\" --includeSnapshot true\n```\n\n**Pressing Key Combinations:**\n```bash\nchrome-devtools press_key \"Control+A\" --includeSnapshot true\n```\n\n**资料来源:** [skills/chrome-devtools-cli/SKILL.md](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/skills/chrome-devtools-cli/SKILL.md)\n\n## Navigation Tools\n\nNavigation tools manage page lifecycle and context within the browser instance.\n\n**资料来源:** [src/tools/pages.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/tools/pages.ts)\n\n### Page Management Operations\n\n| Tool | Purpose | Key Parameters |\n|------|---------|----------------|\n| `navigate_page` | Navigate current page to URL | `url` (required), `type`, `ignoreCache`, `timeout`, `handleBeforeUnload`, `initScript` |\n| `new_page` | Create new page/tab | `url`, `background`, `timeout`, `isolatedContext` |\n| `select_page` | Set active page context | `pageId` (required), `bringToFront` |\n| `close_page` | Close page by index | `pageId` (optional) |\n| `list_pages` | List all open pages | - |\n\n**资料来源:** [src/tools/pages.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/tools/pages.ts)\n\n### Navigation Types\n\nThe `navigate_page` tool supports multiple navigation types:\n\n```typescript\ntype: \"navigate\" | \"reload\" | \"back\" | \"forward\"\n```\n\n| Type | Behavior |\n|------|----------|\n| `navigate` | Default navigation to specified URL |\n| `reload` | Reload current page (supports `ignoreCache`) |\n| `back` | Navigate to previous page in history |\n| `forward` | Navigate to next page in history |\n\n**资料来源:** [src/tools/pages.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/tools/pages.ts)\n\n### Before Unload Handling\n\nWhen navigating away from a page with pending changes, the browser may display a \"before unload\" dialog:\n\n```bash\nchrome-devtools navigate_page --url \"https://example.com\" --handleBeforeUnload \"accept\"\n```\n\n| Option | Behavior |\n|--------|----------|\n| `accept` | Proceed with navigation, dismiss dialog |\n| `dismiss` | Cancel navigation |\n\n**资料来源:** [skills/chrome-devtools-cli/SKILL.md](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/skills/chrome-devtools-cli/SKILL.md)\n\n### Multi-Page Context Management\n\nPages are managed with a zero-based index system. The `select_page` tool changes the active page context for subsequent tool calls:\n\n```bash\n# List pages to see available pages\nchrome-devtools list_pages\n\n# Select page by index\nchrome-devtools select_page 1 --bringToFront true\n```\n\n**资料来源:** [skills/chrome-devtools/SKILL.md](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/skills/chrome-devtools/SKILL.md)\n\n### Isolated Contexts\n\nNew pages can be created with isolated JavaScript contexts, useful for testing extensions or isolated scripts:\n\n```bash\nchrome-devtools new_page \"https://example.com\" --isolatedContext \"ctx\"\n```\n\n**资料来源:** [src/tools/pages.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/tools/pages.ts)\n\n### Page Lifecycle\n\n```mermaid\nstateDiagram-v2\n    [*] --> created: new_page\n    created --> active: select_page\n    active --> background: select_page (other)\n    background --> active: select_page (bringToFront)\n    active --> closed: close_page\n    closed --> [*]\n    \n    active --> navigating: navigate_page\n    navigating --> active: Load complete\n```\n\n**资料来源:** [src/PageCollector.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/PageCollector.ts)\n\n## Emulation Tools\n\nEmulation tools control browser environment settings including network conditions, CPU throttling, geolocation, viewport, and user agent.\n\n**资料来源:** [src/tools/emulation.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/tools/emulation.ts)\n\n### Emulation Capabilities\n\n| Capability | Parameters | Description |\n|------------|------------|-------------|\n| Network Conditions | `networkConditions` | Preset: \"Offline\", \"Slow 3G\", \"Fast 3G\", etc. |\n| CPU Throttling | `cpuThrottlingRate` | Multiplier (e.g., 4 = 4x slowdown) |\n| Geolocation | `geolocation` | Coordinates in format \"lat,lng\" |\n| Color Scheme | `colorScheme` | \"light\" or \"dark\" |\n| Viewport | `viewport` | Format: \"WIDTHxHEIGHT\" (e.g., \"1920x1080\") |\n| User Agent | `userAgent` | Custom UA string |\n\n**资料来源:** [src/tools/emulation.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/tools/emulation.ts)\n\n### Emulation Commands\n\n**Network Emulation:**\n```bash\nchrome-devtools emulate --networkConditions \"Offline\"\n```\n\n**Multiple Emulations:**\n```bash\nchrome-devtools emulate --cpuThrottlingRate 4 --geolocation \"0x0\"\n```\n\n**Visual Emulation:**\n```bash\nchrome-devtools emulate --colorScheme \"dark\" --viewport \"1920x1080\"\n```\n\n**User Agent Spoofing:**\n```bash\nchrome-devtools emulate --userAgent \"Mozilla/5.0...\"\n```\n\n**资料来源:** [skills/chrome-devtools-cli/SKILL.md](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/skills/chrome-devtools-cli/SKILL.md)\n\n### Page Resize\n\nThe `resize_page` tool resizes the selected page's window:\n\n```bash\nchrome-devtools resize_page 1920 1080\n```\n\n**资料来源:** [src/tools/emulation.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/tools/emulation.ts)\n\n## WaitForHelper\n\nThe `WaitForHelper` module provides synchronization mechanisms to ensure page elements are ready before interactions occur.\n\n**资料来源:** [src/WaitForHelper.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/WaitForHelper.ts)\n\n### Wait Strategies\n\n| Strategy | Description |\n|----------|-------------|\n| `wait_for` | Generic wait for specified duration or condition |\n| Event-based | Wait for navigation, network idle, or element state |\n| Timeout handling | Configurable timeout with default fallback |\n\n**资料来源:** [skills/chrome-devtools/SKILL.md](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/skills/chrome-devtools/SKILL.md)\n\n### Recommended Workflow\n\nThe official workflow ensures reliable automation:\n\n1. **Navigate**: Use `navigate_page` or `new_page`\n2. **Wait**: Use `wait_for` if you know what to look for\n3. **Snapshot**: Use `take_snapshot` to understand page structure\n4. **Interact**: Use element `uid`s from snapshot for `click`, `fill`, etc.\n\n**资料来源:** [skills/chrome-devtools/SKILL.md](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/skills/chrome-devtools/SKILL.md)\n\n## Tool Configuration Schema\n\nAll tools follow a consistent schema pattern defined in `src/tools/ToolDefinition.ts`:\n\n```typescript\nexport const timeoutSchema = {\n  timeout: zod\n    .number()\n    .int()\n    .optional()\n    .describe(\n      `Maximum wait time in milliseconds. If set to 0, the default timeout will be used.`,\n    )\n    .transform(value => {\n      return value && value <= 0 ? undefined : value;\n    }),\n};\n\nexport const pageIdSchema = {\n  pageId: zod.number().optional().describe('Targets a specific page by ID.'),\n};\n```\n\n**资料来源:** [src/tools/ToolDefinition.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/tools/ToolDefinition.ts)\n\n### IncludeSnapshot Pattern\n\nMany input tools support the `includeSnapshot` flag to return an updated page snapshot after the action:\n\n```bash\nchrome-devtools click \"id\" --includeSnapshot true\n```\n\nWhen `true`, the response includes the full accessibility tree, allowing chaining without an explicit `take_snapshot` call.\n\n**资料来源:** [skills/chrome-devtools-cli/SKILL.md](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/skills/chrome-devtools-cli/SKILL.md)\n\n## Error Handling\n\n### Dialog Blocking\n\nSome input tools are blocked when a dialog is present:\n\n```typescript\nblockedByDialog: true,\n```\n\nIn such cases, use `handle_dialog` first:\n\n```bash\nchrome-devtools handle_dialog accept\nchrome-devtools handle_dialog dismiss --promptText \"hi\"\n```\n\n**资料来源:** [src/tools/input.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/tools/input.ts)\n\n### Page Closure Restrictions\n\nThe last open page cannot be closed:\n\n```typescript\nexport const CLOSE_PAGE_ERROR =\n  'The last open page cannot be closed. It is fine to keep it open.';\n```\n\n**资料来源:** [src/tools/ToolDefinition.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/tools/ToolDefinition.ts)\n\n## CLI Usage\n\nAll tools are accessible via the `chrome-devtools` CLI:\n\n```bash\nchrome-devtools <tool> [arguments] [flags]\n```\n\n### Help System\n\n```bash\nchrome-devtools take_snapshot --help\n```\n\n### Output Formats\n\nBy default, output is in Markdown. Use `--output-format=json` for JSON output:\n\n```bash\nchrome-devtools list_pages --output-format=json\n```\n\n**资料来源:** [skills/chrome-devtools-cli/SKILL.md](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/skills/chrome-devtools-cli/SKILL.md)\n\n## Tool Categories\n\nTools are organized into categories for documentation and navigation:\n\n| Category | Description |\n|----------|-------------|\n| `INPUT` | Keyboard, mouse, and element interactions |\n| `NAVIGATION` | Page lifecycle and context management |\n| `EMULATION` | Browser environment control |\n| `INSPECTION` | Page inspection and snapshots |\n| `PERFORMANCE` | Performance tracing and analysis |\n| `NETWORK` | Network request inspection |\n\n**资料来源:** [docs/tool-reference.md](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/docs/tool-reference.md)\n\n## Testing and Validation\n\nThe repository includes test scenarios that validate tool behavior:\n\n```typescript\nexpectations: calls => {\n  assert.ok(\n    calls[0].name === 'navigate_page' || calls[0].name === 'new_page',\n  );\n  assert.strictEqual(calls[1].name, 'take_snapshot');\n  assert.strictEqual(calls[2].name, 'fill_form');\n}\n```\n\n**资料来源:** [scripts/eval_scenarios/fill_select_and_checkboxes_test.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/scripts/eval_scenarios/fill_select_and_checkboxes_test.ts)\n\n## Summary\n\nThe Input and Navigation Automation Tools provide a comprehensive API for browser automation through:\n\n- **Input Tools**: Simulate user interactions with precise element targeting\n- **Navigation Tools**: Full page lifecycle management including multi-page contexts\n- **Emulation Tools**: Control browser environment for testing various conditions\n- **WaitForHelper**: Synchronization primitives for reliable automation\n\nThese tools work together to enable reliable browser automation workflows suitable for testing, scraping, and AI agent interactions.\n\n---\n\n<a id='debugging-tools'></a>\n\n## Debugging and Inspection Tools\n\n### 相关页面\n\n相关主题：[Input and Navigation Automation Tools](#automation-tools), [Performance Analysis Tools](#performance-tools)\n\n<details>\n<summary>相关源码文件</summary>\n\n以下源码文件用于生成本页说明：\n\n- [src/tools/snapshot.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/tools/snapshot.ts)\n- [src/tools/screenshot.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/tools/screenshot.ts)\n- [src/tools/network.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/tools/network.ts)\n- [src/tools/console.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/tools/console.ts)\n- [src/tools/memory.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/tools/memory.ts)\n- [src/formatters/ConsoleFormatter.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/formatters/ConsoleFormatter.ts)\n- [src/formatters/NetworkFormatter.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/formatters/NetworkFormatter.ts)\n- [src/formatters/SnapshotFormatter.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/formatters/SnapshotFormatter.ts)\n</details>\n\n# Debugging and Inspection Tools\n\n## Overview\n\nThe Debugging and Inspection Tools in chrome-devtools-mcp provide comprehensive capabilities for examining browser page state, accessibility trees, console output, network activity, and memory usage. These tools serve as the primary interface for automated debugging, accessibility auditing, and performance analysis workflows.\n\nThe inspection layer is built on Chrome DevTools Protocol (CDP) and exposes both programmatic and visual inspection capabilities through a unified MCP (Model Context Protocol) interface. All tools operate on the currently selected page context, enabling sequential inspection workflows.\n\n## Architecture\n\n```mermaid\ngraph TD\n    subgraph \"Inspection Layer\"\n        SNAP[Snapshot Tools]\n        SCR[Screen Tools]\n        NET[Network Tools]\n        CON[Console Tools]\n        MEM[Memory Tools]\n    end\n    \n    subgraph \"Formatting Layer\"\n        SF[SnapshotFormatter]\n        NF[NetworkFormatter]\n        CF[ConsoleFormatter]\n    end\n    \n    subgraph \"CDP Integration\"\n        CDP[Chrome DevTools Protocol]\n        PUP[CDP Puppeteer Bridge]\n    end\n    \n    SNAP --> SF\n    SCR --> CDP\n    NET --> NF\n    CON --> CF\n    MEM --> CDP\n    \n    SF --> PUP\n    NF --> PUP\n    CF --> PUP\n    PUP --> CDP\n    \n    style SNAP fill:#e1f5fe\n    style SCR fill:#e1f5fe\n    style NET fill:#e1f5fe\n    style CON fill:#e1f5fe\n    style MEM fill:#e1f5fe\n```\n\n## Page Snapshot Tools\n\n### take_snapshot\n\nThe primary inspection tool that captures the accessibility tree of the currently selected page. The snapshot provides a text-based representation of page structure with unique element identifiers (UIDs) used for subsequent interaction.\n\n**Parameters:**\n\n| Parameter | Type | Required | Description |\n|-----------|------|----------|-------------|\n| `verbose` | boolean | No | Include all available information from the full a11y tree. Default: `false` |\n| `filePath` | string | No | Absolute or relative path to save snapshot output instead of attaching to response |\n\n**Key Features:**\n\n- Returns element hierarchy with unique `uid` identifiers\n- Indicates which element is selected in DevTools Elements panel\n- Supports output to file for large snapshots\n- Based on accessibility tree, not raw DOM (reflects what assistive technologies perceive)\n- Marked as `blockedByDialog: true` to handle browser dialogs gracefully\n\n**Source:** [src/tools/snapshot.ts:17-43]()\n\n### wait_for\n\nSuspends execution until a specified condition is met on the page, enabling synchronization with dynamic content loading.\n\n**Source:** [src/tools/snapshot.ts:45+]()\n\n## Console Tools\n\n### list_console_messages\n\nRetrieves console output and browser-issued accessibility audits from the current page. This tool captures both developer-initiated logs and automatic Chrome accessibility checks.\n\n**Use Cases:**\n\n- Capturing `console.log`, `console.error`, and other console methods\n- Detecting browser-issued accessibility issues\n- Preserving messages from page load that occurred before inspection\n- Filtering by message types (`log`, `warn`, `error`, `info`, `debug`, `issue`)\n\n**Source:** [src/tools/console.ts]()\n\n### Console Output Types\n\n| Type | Description | Typical Use |\n|------|-------------|-------------|\n| `log` | General information | Debug output |\n| `warn` | Warning messages | Non-critical issues |\n| `error` | Error messages | Failures and exceptions |\n| `info` | Informational messages | Status updates |\n| `debug` | Debug-level details | Verbose debugging |\n| `issue` | Browser a11y audits | Accessibility violations |\n\nThe console formatter (`ConsoleFormatter.ts`) processes raw CDP messages into structured, human-readable output with proper formatting of objects and arrays.\n\n**Source:** [src/formatters/ConsoleFormatter.ts]()\n\n## Network Inspection Tools\n\n### Network Monitoring\n\nThe network inspection subsystem captures HTTP traffic, WebSocket communications, and resource loading timing. Network tools are essential for debugging API calls, identifying slow resources, and analyzing request/response patterns.\n\n**Source:** [src/tools/network.ts]()\n\n**Network Formatter:** [src/formatters/NetworkFormatter.ts]()\n\n### Network Parameters\n\n| Parameter | Type | Description |\n|-----------|------|-------------|\n| `pageIdx` | number | Page index for pagination |\n| `pageSize` | number | Number of items per page |\n| `types` | string[] | Filter by resource types (document, stylesheet, image, script, xhr, etc.) |\n| `includePreservedMessages` | boolean | Include messages from before tool invocation |\n\n## Memory Inspection Tools\n\n### take_memory_snapshot\n\nCaptures V8 heap memory snapshots for debugging memory leaks and analyzing memory consumption patterns. Heap snapshots are saved in Chrome's standard `.heapsnapshot` format.\n\n**Parameters:**\n\n| Parameter | Type | Required | Description |\n|-----------|------|----------|-------------|\n| `filePath` | string | Yes | Target path for the snapshot file |\n\n**Use Cases:**\n\n- Identifying memory leaks\n- Analyzing object retention paths\n- Comparing heap states before/after operations\n- Finding detached DOM trees\n\n**Source:** [src/tools/memory.ts]()\n\n## Screenshot Tools\n\n### take_screenshot\n\nCaptures visual representation of the current page state. Unlike snapshots, screenshots provide pixel-level fidelity for visual inspection when accessibility tree information is insufficient.\n\n**Use Cases:**\n\n- Visual debugging when structure is unclear\n- Capturing rendered UI state\n- Documenting bug reproductions\n- Inspecting CSS-dependent layouts\n\n**Source:** [src/tools/screenshot.ts]()\n\n## Snapshot Formatting\n\nThe SnapshotFormatter (`SnapshotFormatter.ts`) transforms raw accessibility tree data into human-readable hierarchical text format.\n\n**Output Structure:**\n\n```\nuid=1_0 RootWebArea \"Example Domain\" url=\"https://example.com/\"\n  uid=1_1 heading \"Example Domain\" level=\"1\"\n  uid=1_2 paragraph \"Some content text\"\n```\n\n**Key Formatting Features:**\n\n- Hierarchical indentation reflecting DOM tree structure\n- UID assignment following CDP node IDs\n- Role-based element classification (heading, paragraph, button, etc.)\n- Attribute inclusion for semantic details\n- ARIA property preservation\n\n**Source:** [src/formatters/SnapshotFormatter.ts]()\n\n## Workflow Patterns\n\n### Standard Inspection Workflow\n\n```mermaid\ngraph LR\n    A[Navigate to Page] --> B[wait_for Condition]\n    B --> C[take_snapshot]\n    C --> D{Issue Found?}\n    D -->|Yes| E[Take Screenshot]\n    E --> F[Check Console Logs]\n    F --> G[Document Findings]\n    D -->|No| H[Continue Testing]\n    \n    style A fill:#c8e6c9\n    style C fill:#bbdefb\n    style F fill:#fff9c4\n```\n\n### Accessibility Audit Workflow\n\n1. **Lighthouse Audit**: Run comprehensive accessibility audit via MCP tools\n2. **Console Inspection**: Check for browser-issued `issue` type messages\n3. **Snapshot Analysis**: Verify heading hierarchy, ARIA labels, semantic landmarks\n4. **Form Input Verification**: Ensure all inputs have associated labels\n5. **Focus Navigation**: Test keyboard navigation with `press_key` tool\n\n**Source:** [skills/a11y-debugging/SKILL.md]()\n\n## Tool Categories\n\nAll inspection tools are categorized under `ToolCategory.DEBUGGING` for organizational purposes and MCP tool discovery.\n\n**Source:** [src/tools/snapshot.ts:10]()\n\n### Category Matrix\n\n| Tool | Category | Read-Only | Blocked by Dialog |\n|------|----------|-----------|-------------------|\n| `take_snapshot` | DEBUGGING | false* | true |\n| `wait_for` | DEBUGGING | true | true |\n| `list_console_messages` | DEBUGGING | true | false |\n| `take_memory_snapshot` | DEBUGGING | true | true |\n| `take_screenshot` | DEBUGGING | true | true |\n\n*Note: `take_snapshot` is not read-only due to the `filePath` parameter allowing file system writes.\n\n## Integration with Input Automation\n\nInspection tools work in conjunction with input automation tools to enable test-verify workflows:\n\n```mermaid\ngraph TD\n    INSPECT[Inspection Tools] <-->|UID feedback| INTERACT[Input Automation]\n    \n    INSPECT --> SNAP[Snapshot with UIDs]\n    INTERACT --> CLICK[click uid]\n    INTERACT --> FILL[fill uid \"text\"]\n    INTERACT --> HOVER[hover uid]\n    \n    SNAP --> ELEM[Element UIDs]\n    ELEM --> CLICK\n    ELEM --> FILL\n    ELEM --> HOVER\n```\n\n**Source:** [skills/chrome-devtools/SKILL.md]()\n\n## Best Practices\n\n1. **Prefer Snapshots over Screenshots**: Text snapshots are faster, machine-parseable, and more reliable for automation\n2. **Use File Output for Large Data**: Specify `filePath` parameter when capturing large snapshots or traces\n3. **Wait Before Inspecting**: Always use `wait_for` when content loads dynamically\n4. **Check Console First**: Browser-issued issues often reveal accessibility problems without manual investigation\n5. **Keep Snapshots Current**: Element UIDs may change after page mutations—take fresh snapshots before interactions\n\n## Output Formats\n\nAll inspection tools support multiple output formats via the `--output-format` flag:\n\n| Format | Use Case |\n|--------|----------|\n| `markdown` (default) | Human-readable output with formatting |\n| `json` | Structured data for programmatic processing |\n\n**Source:** [skills/chrome-devtools-cli/SKILL.md]()\n\n## Error Handling\n\nInspection tools handle common failure scenarios:\n\n- **Dialog Blocking**: Tools with `blockedByDialog: true` will wait if a browser dialog appears\n- **Page Context Missing**: Operations fail gracefully if no page is selected\n- **Path Validation**: File operations validate paths before writing\n- **Timeout Handling**: Configurable timeouts prevent indefinite waits\n\n**Source:** [src/tools/snapshot.ts:28-31]()\n\n---\n\n<a id='performance-tools'></a>\n\n## Performance Analysis Tools\n\n### 相关页面\n\n相关主题：[Debugging and Inspection Tools](#debugging-tools), [Telemetry and Monitoring](#telemetry)\n\n<details>\n<summary>Related Source Files</summary>\n\nThe following source files were used to generate this documentation:\n\n- [src/tools/lighthouse.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/tools/lighthouse.ts)\n- [src/tools/performance.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/tools/performance.ts)\n- [src/HeapSnapshotManager.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/HeapSnapshotManager.ts)\n- [src/formatters/HeapSnapshotFormatter.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/formatters/HeapSnapshotFormatter.ts)\n- [src/trace-processing/parse.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/trace-processing/parse.ts)\n- [skills/debug-optimize-lcp/SKILL.md](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/skills/debug-optimize-lcp/SKILL.md)\n- [skills/chrome-devtools-cli/SKILL.md](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/skills/chrome-devtools-cli/SKILL.md)\n</details>\n\n# Performance Analysis Tools\n\nThe chrome-devtools-mcp repository provides a comprehensive suite of performance analysis tools through the Chrome DevTools Protocol integration. These tools enable automated performance auditing, runtime tracing, memory profiling, and network condition emulation.\n\n## Overview\n\nPerformance Analysis Tools in chrome-devtools-mcp encompass four primary domains:\n\n| Domain | Primary Tools | Purpose |\n|--------|---------------|---------|\n| **Lighthouse Auditing** | `lighthouse_audit` | Accessibility, SEO, best practices scoring |\n| **Performance Tracing** | `performance_start_trace`, `performance_stop_trace` | Chrome tracing with DevTools performance data |\n| **Memory Profiling** | `take_memory_snapshot`, `HeapSnapshotManager` | JavaScript heap analysis |\n| **Trace Processing** | `parse.ts` | Processing and parsing of trace events |\n\n资料来源：[src/tools/lighthouse.ts:1-20]()\n\n## Architecture\n\nThe performance analysis system follows a layered architecture:\n\n```mermaid\ngraph TD\n    subgraph \"CLI Layer\"\n        CLI[CLI Commands<br/>chrome-devtools CLI]\n    end\n    \n    subgraph \"Tool Layer\"\n        LH[Lighthouse Audit Tool]\n        PT[Performance Trace Tools]\n        MS[Memory Snapshot Tools]\n    end\n    \n    subgraph \"Protocol Layer\"\n        CDP[Chrome DevTools Protocol]\n    end\n    \n    subgraph \"Processing Layer\"\n        HSP[Heap Snapshot Parser]\n        TRP[Trace Event Parser]\n        FMT[Result Formatters]\n    end\n    \n    subgraph \"Output Layer\"\n        JSON[JSON Reports]\n        HTML[HTML Reports]\n        SNAP[Heap Snapshots]\n    end\n    \n    CLI --> LH\n    CLI --> PT\n    CLI --> MS\n    \n    LH --> CDP\n    PT --> CDP\n    MS --> CDP\n    \n    MS --> HSP\n    PT --> TRP\n    \n    HSP --> FMT\n    TRP --> FMT\n    \n    FMT --> JSON\n    FMT --> HTML\n    HSP --> SNAP\n```\n\n## Lighthouse Audit Tool\n\nThe `lighthouse_audit` tool provides automated accessibility, SEO, and best practices auditing.\n\n### Tool Definition\n\n```typescript\nexport const lighthouseAudit = definePageTool({\n  name: 'lighthouse_audit',\n  description: `Get Lighthouse score and reports for accessibility, SEO, best practices, and agentic browsing. This excludes performance.`,\n  schema: {\n    mode: zod.enum(['navigation', 'snapshot']).default('navigation'),\n    device: zod.enum(['desktop', 'mobile']).default('desktop'),\n    outputDirPath: zod.string().optional(),\n  },\n});\n```\n\n资料来源：[src/tools/lighthouse.ts:19-40]()\n\n### Audit Categories\n\n| Category | Description | Default Enabled |\n|----------|-------------|-----------------|\n| `accessibility` | WCAG compliance, ARIA labels, color contrast | Yes |\n| `seo` | Meta tags, crawlability, mobile friendliness | Yes |\n| `best-practices` | HTTPS usage, no deprecated APIs | Yes |\n| `agentic-browsing` | AI agent compatibility checks | Yes |\n\n### Parameters\n\n| Parameter | Type | Required | Default | Description |\n|-----------|------|----------|---------|-------------|\n| `mode` | `navigation` \\| `snapshot` | No | `navigation` | `navigation` reloads & audits; `snapshot` analyzes current state |\n| `device` | `desktop` \\| `mobile` | No | `desktop` | Device emulation type |\n| `outputDirPath` | string | No | temp file | Directory for JSON reports |\n\n### Usage Workflow\n\n```mermaid\ngraph LR\n    A[Start Audit] --> B{Mode?}\n    B -->|navigation| C[Reload Page]\n    B -->|snapshot| D[Analyze Current State]\n    C --> E[Run Lighthouse]\n    D --> E\n    E --> F[Generate JSON Report]\n    F --> G[Parse Results]\n    G --> H[Return Scores & Failed Audits]\n```\n\n资料来源：[src/tools/lighthouse.ts:40-60]()\n\n## Performance Tracing\n\nThe performance tracing system captures Chrome DevTools performance data for deep analysis.\n\n### Available Tools\n\n| Tool | Purpose |\n|------|---------|\n| `performance_start_trace` | Begin recording performance trace |\n| `performance_stop_trace` | Stop recording and return trace data |\n| `performance_analyze_insight` | Get details on specific Performance Insights |\n\n### Trace Configuration\n\n| Parameter | Type | Description |\n|-----------|------|-------------|\n| `filePath` | string | Optional path to save trace file (`.gz` format) |\n| `reload` | boolean | Whether to reload the page before tracing |\n\n### LCP Analysis\n\nThe trace system integrates with LCP (Largest Contentful Paint) debugging:\n\n```javascript\nasync () => {\n  return await new Promise(resolve => {\n    new PerformanceObserver(list => {\n      const entries = list.getEntries();\n      const last = entries[entries.length - 1];\n      resolve({\n        element: last.element?.tagName,\n        id: last.element?.id,\n        className: last.element?.className,\n        url: last.url,\n        startTime: last.startTime,\n        renderTime: last.renderTime,\n        loadTime: last.loadTime,\n        size: last.size,\n      });\n    }).observe({type: 'largest-contentful-paint', buffered: true});\n  });\n};\n```\n\n资料来源：[skills/debug-optimize-lcp/references/lcp-snippets.md:1-30]()\n\n### LCP Subpart Breakdown\n\nLCP is measured across four subparts that sum to 100%:\n\n| Subpart | Target | Root Cause | Fixes |\n|---------|--------|------------|-------|\n| TTFB | ~40% | Slow server response | Minimize redirects, CDN caching, bfcache eligibility |\n| Resource Load Delay | ~10% | Late discovery | Remove lazy-loading, add preload/fetchpriority |\n| Resource Load Duration | ~40% | Large/slow resource | WebP/AVIF formats, CDN, compression |\n| Element Render Delay | <10% | Render blocking | Inline critical CSS, defer JS, break long tasks |\n\n资料来源：[skills/debug-optimize-lcp/SKILL.md:1-50]()\n\n## Memory Profiling\n\nThe memory profiling system captures and analyzes JavaScript heap snapshots.\n\n### Heap Snapshot Manager\n\nThe `HeapSnapshotManager` class handles snapshot lifecycle:\n\n```typescript\nexport class PageCollector<T> {\n  #browser: Browser;\n  protected storage = new WeakMap<Page, Array<Array<WithSymbolId<T>>>>();\n  protected maxNavigationSaved = 3;\n  \n  async init(pages: Page[]) {\n    for (const page of pages) {\n      this.addPage(page);\n    }\n  }\n}\n```\n\n资料来源：[src/PageCollector.ts:1-50]()\n\n### Snapshot Operations\n\n| Operation | CLI Command | Description |\n|-----------|-------------|-------------|\n| Capture | `take_memory_snapshot \"./path.snap\"` | Capture heap snapshot to file |\n| Format | `HeapSnapshotFormatter` | Parse and format snapshot data |\n| Analyze | Manual inspection | View node counts, shallow sizes, retainer paths |\n\n### Heap Snapshot Data Structure\n\nThe system processes snapshots with the following structure:\n\n| Field | Type | Description |\n|-------|------|-------------|\n| nodes | Node[] | Array of heap nodes |\n| edges | Edge[] | References between nodes |\n| strings | string[] | String table for node names |\n| trace_tree | TraceNode | Sampling profile data |\n\n资料来源：[src/formatters/HeapSnapshotFormatter.ts:1-30]()\n\n## Trace Processing\n\nThe trace processing module parses Chrome DevTools trace events.\n\n### Parser Functions\n\n```typescript\ninterface ParsedTraceEvent {\n  name: string;\n  cat: string;\n  ph: string;\n  ts: number;\n  dur?: number;\n  args?: Record<string, unknown>;\n}\n```\n\n资料来源：[src/trace-processing/parse.ts:1-20]()\n\n### Supported Event Types\n\n| Event Type | Phase Code | Description |\n|------------|------------|-------------|\n| Duration | B/E | Begin/End of an operation |\n| Complete | X | Operation with known duration |\n| Instant | i | Point-in-time event |\n| Counter | C | Numeric value at a point |\n| Async | b/n/t | Asynchronous operations |\n| Sample | P | CPU sampling profile |\n\n### Trace File Format\n\nTrace files can be saved in two formats:\n\n| Format | Extension | Compression |\n|--------|-----------|-------------|\n| JSON | `.json` | None |\n| Perfetto | `.gz` | gzip |\n\n## CLI Commands\n\nThe performance tools are accessible via the `chrome-devtools` CLI:\n\n### Performance Commands\n\n```bash\n# Start tracing with optional reload\nchrome-devtools performance_start_trace true false\n\n# Start trace and save to file\nchrome-devtools performance_start_trace true true --filePath trace.gz\n\n# Stop trace and optionally save\nchrome-devtools performance_stop_trace\nchrome-devtools performance_stop_trace --filePath \"t.json\"\n\n# Analyze Performance Insights\nchrome-devtools performance_analyze_insight \"1\" \"LCPBreakdown\"\n```\n\n资料来源：[skills/chrome-devtools-cli/SKILL.md:1-100]()\n\n### Memory Commands\n\n```bash\n# Capture heap snapshot\nchrome-devtools take_memory_snapshot \"./snap.heapsnapshot\"\n```\n\n### Emulation Commands\n\nFor realistic performance testing under constrained conditions:\n\n```bash\n# Network throttling\nchrome-devtools emulate --networkConditions \"Fast 3G\"\n\n# CPU throttling\nchrome-devtools emulate --cpuThrottlingRate 4\n\n# Combined emulation\nchrome-devtools emulate --networkConditions \"Slow 3G\" --cpuThrottlingRate 4\n```\n\n资料来源：[skills/chrome-devtools-cli/SKILL.md:80-120]()\n\n## Common Performance Issues\n\n### LCP Issues Checklist\n\n| Issue | Detection | Fix |\n|-------|-----------|-----|\n| Lazy-loaded LCP image | `loading=\"lazy\"` on viewport images | Remove lazy-loading |\n| Missing fetchpriority | `<img>` without `fetchpriority` | Add `fetchpriority=\"high\"` |\n| Missing preload | LCP image not in HTML | Add `<link rel=\"preload\">` |\n| Render-blocking CSS | Stylesheets in `<head>` | Inline critical CSS |\n| Large LCP resource | Slow load duration | Compress, use WebP/AVIF |\n\n资料来源：[skills/debug-optimize-lcp/references/optimization-strategies.md:1-50]()\n\n### JavaScript Snippet for Issue Detection\n\n```javascript\n() => {\n  const issues = [];\n\n  // Check for lazy-loaded images in viewport\n  document.querySelectorAll('img[loading=\"lazy\"]').forEach(img => {\n    const rect = img.getBoundingClientRect();\n    if (rect.top < window.innerHeight) {\n      issues.push({\n        issue: 'lazy-loaded image in viewport',\n        element: img.outerHTML.substring(0, 200),\n        fix: 'Remove loading=\"lazy\" from this image'\n      });\n    }\n  });\n\n  return issues;\n};\n```\n\n资料来源：[skills/debug-optimize-lcp/references/lcp-snippets.md:35-55]()\n\n## Test Scenarios\n\nThe repository includes test scenarios for performance tools:\n\n```typescript\nexport const scenario: TestScenario = {\n  prompt: 'Check the performance of https://developers.chrome.com',\n  maxTurns: 2,\n  expectations: calls => {\n    assert.strictEqual(calls.length, 2);\n    assert.ok(\n      calls[0].name === 'navigate_page' || calls[0].name === 'new_page',\n    );\n    assert.ok(calls[1].name === 'performance_start_trace');\n  },\n};\n```\n\n资料来源：[scripts/eval_scenarios/performance_test.ts:1-25]()\n\n## Related Documentation\n\n- [Lighthouse Documentation](https://developer.chrome.com/docs/lighthouse)\n- [Chrome DevTools Performance Panel](https://developer.chrome.com/docs/devtools/performance)\n- [Memory Profiling](https://developer.chrome.com/docs/devtools/memory-problems)\n- [LCP Web.dev Guide](https://web.dev/articles/lcp)\n\n---\n\n<a id='cli-reference'></a>\n\n## CLI Reference\n\n### 相关页面\n\n相关主题：[Configuration Reference](#configuration), [Installation and Setup](#installation), [System Architecture](#system-architecture)\n\n<details>\n<summary>相关源码文件</summary>\n\n以下源码文件用于生成本页说明：\n\n- [src/bin/chrome-devtools.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/bin/chrome-devtools.ts)\n- [src/bin/chrome-devtools-cli-options.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/bin/chrome-devtools-cli-options.ts)\n- [src/tools/slim/tools.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/tools/slim/tools.ts)\n- [docs/cli.md](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/docs/cli.md)\n- [docs/slim-tool-reference.md](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/docs/slim-tool-reference.md)\n</details>\n\n# CLI Reference\n\nThe `chrome-devtools-mcp` CLI provides a command-line interface for interacting with Chrome DevTools, enabling browser automation, page manipulation, performance analysis, and network inspection directly from the terminal.\n\n## Overview\n\nThe CLI is built on top of the Model Context Protocol (MCP) and serves as the primary interface for users who prefer terminal-based workflows over programmatic SDK integration. It wraps the MCP server functionality into a user-friendly command structure.\n\n```mermaid\ngraph TD\n    A[User Terminal] -->|chrome-devtools command| B[CLI Entry Point]\n    B --> C[chrome-devtools-cli-options.ts]\n    C --> D[Argument Parsing]\n    D --> E[chrome-devtools-mcp Server]\n    E --> F[Chrome Browser Instance]\n    F --> G[Page Context]\n    G --> H[Tool Execution]\n    H --> I[Response Output]\n```\n\n资料来源：[skills/chrome-devtools-cli/SKILL.md]()\n\n## Command Structure\n\nThe general command syntax follows:\n\n```bash\nchrome-devtools <tool> [arguments] [flags]\n```\n\n### Global Flags\n\n| Flag | Description |\n|------|-------------|\n| `--help` | Display help message for any command |\n| `--output-format=json` | Return output in JSON format instead of Markdown |\n| `--viaCli` | Internal flag for CLI-to-server communication |\n\n资料来源：[skills/chrome-devtools-cli/SKILL.md]()\n\n## Service Management Commands\n\nThese commands control the lifecycle of the chrome-devtools-mcp server.\n\n```bash\nchrome-devtools start   # Start or restart chrome-devtools-mcp\nchrome-devtools status  # Check if chrome-devtools-mcp is running\nchrome-devtools stop    # Stop chrome-devtools-mcp if any\n```\n\nThe background server starts implicitly on first tool call. Users should **not** run `start`/`status`/`stop` before each use.\n\n资料来源：[skills/chrome-devtools-cli/SKILL.md]()\n\n## Navigation Commands\n\n### Page Navigation\n\n| Command | Description |\n|---------|-------------|\n| `navigate_page --url \"https://example.com\"` | Navigate the currently selected page to a URL |\n| `navigate_page --type \"reload\" --ignoreCache true` | Reload page ignoring cache |\n| `navigate_page --url \"https://example.com\" --timeout 5000` | Navigate with a timeout |\n| `navigate_page --handleBeforeUnload \"accept\"` | Handle before unload dialog |\n| `navigate_page --type \"back\" --initScript \"foo()\"` | Navigate back and run an init script |\n\n### Page Management\n\n| Command | Description |\n|---------|-------------|\n| `new_page \"https://example.com\"` | Create a new page |\n| `new_page \"https://example.com\" --background true --timeout 5000` | Create new page in background |\n| `new_page \"https://example.com\" --isolatedContext \"ctx\"` | Create page with isolated context |\n| `select_page 1` | Select a page as context for future tool calls |\n| `select_page 1 --bringToFront true` | Select page and bring it to front |\n| `close_page 1` | Close a page by its index |\n| `list_pages` | List all pages open in the browser |\n\n资料来源：[skills/chrome-devtools-cli/SKILL.md]()\n\n## Input Automation Commands\n\nThese commands interact with elements identified by `uid` from snapshot operations.\n\n### Element Interaction\n\n| Command | Description |\n|---------|-------------|\n| `take_snapshot` | Take a text snapshot of the page to get UIDs |\n| `click \"id\"` | Click on the provided element |\n| `click \"id\" --dblClick true --includeSnapshot true` | Double click and return snapshot |\n| `hover \"id\"` | Hover over the provided element |\n| `hover \"id\" --includeSnapshot true` | Hover and return snapshot |\n| `drag \"src\" \"dst\"` | Drag an element onto another element |\n| `fill \"id\" \"text\"` | Type text into an input or select an option |\n\n### Keyboard and Text Input\n\n| Command | Description |\n|---------|-------------|\n| `press_key \"Enter\"` | Press a key or key combination |\n| `press_key \"Control+A\" --includeSnapshot true` | Press a key and return snapshot |\n| `type_text \"hello\"` | Type text using keyboard into a focused input |\n| `type_text \"hello\" --submitKey \"Enter\"` | Type text and press a submit key |\n\n### File Upload\n\n| Command | Description |\n|---------|-------------|\n| `upload_file \"id\" \"file.txt\"` | Upload a file through a provided element |\n| `upload_file \"id\" \"file.txt\" --includeSnapshot true` | Upload and return snapshot |\n\n### Dialog Handling\n\n| Command | Description |\n|---------|-------------|\n| `handle_dialog accept` | Accept a browser dialog |\n| `handle_dialog dismiss --promptText \"hi\"` | Dismiss a dialog with prompt text |\n\n资料来源：[skills/chrome-devtools-cli/SKILL.md]()\n\n## Emulation Commands\n\n### Network Conditions\n\n```bash\nchrome-devtools emulate --networkConditions \"Offline\"\n```\n\n### Performance Emulation\n\n```bash\nchrome-devtools emulate --cpuThrottlingRate 4 --geolocation \"0x0\"\n```\n\n### Visual Emulation\n\n```bash\nchrome-devtools emulate --colorScheme \"dark\" --viewport \"1920x1080\"\nchrome-devtools emulate --userAgent \"Mozilla/5.0...\"\nchrome-devtools resize_page 1920 1080\n```\n\n资料来源：[skills/chrome-devtools-cli/SKILL.md]()\n\n## Performance Commands\n\n### Tracing\n\n| Command | Description |\n|---------|-------------|\n| `performance_start_trace true false` | Start performance trace recording |\n| `performance_start_trace true true --filePath t.gz` | Start trace and save to compressed file |\n| `performance_stop_trace` | Stop the active performance trace |\n| `performance_stop_trace --filePath \"t.json\"` | Stop trace and save to file |\n\n### Analysis\n\n| Command | Description |\n|---------|-------------|\n| `performance_analyze_insight \"1\" \"LCPBreakdown\"` | Get details on a Performance Insight |\n| `take_memory_snapshot \"./snap.heapsnapshot\"` | Capture a memory heapsnapshot |\n\n资料来源：[skills/chrome-devtools-cli/SKILL.md]()\n\n## Extension Management Commands\n\n| Command | Description |\n|---------|-------------|\n| `list_extensions` | List all installed Chrome extensions |\n| `install_extension \"/path/to/extension\"` | Install a Chrome extension |\n| `uninstall_extension \"extension_id\"` | Uninstall a Chrome extension |\n| `reload_extension \"extension_id\"` | Reload an unpacked Chrome extension |\n| `trigger_extension_action \"extension_id\"` | Trigger the default action of an extension |\n\n资料来源：[skills/chrome-devtools-cli/SKILL.md]()\n\n## Experimental Features\n\nExperimental tools require specific flags during server startup:\n\n```bash\n--experimentalVision=true   # Enable coordinate-based clicking\n--experimentalScreencast=true # Enable screencast (requires ffmpeg)\n--categoryExperimentalWebmcp=true # Enable WebMCP tools\n```\n\n### Experimental Commands\n\n| Command | Description | Required Flag |\n|---------|-------------|---------------|\n| `click_at 100 200` | Click at coordinates | `--experimentalVision=true` |\n| `screencast_start` | Start screencast recording | `--experimentalScreencast=true` |\n| `screencast_stop` | Stop active screencast | `--experimentalScreencast=true` |\n| `list_webmcp_tools` | List all WebMCP tools | `--categoryExperimentalWebmcp=true` |\n\n资料来源：[skills/chrome-devtools-cli/SKILL.md]()\n\n## WebMCP Tools\n\nWebMCP tools are exposed by the page itself and allow pages to define custom tools that the CLI can invoke.\n\n```bash\nchrome-devtools list_webmcp_tools    # List all WebMCP tools the page exposes\nchrome-devtools execute_webmcp_tool \"toolName\" --input '{\"key\": \"value\"}'\n```\n\n资料来源：[src/tools/webmcp.ts]()\n\n## Tool Categories\n\nThe CLI tools are organized into categories that can be enabled or disabled:\n\n| Category | Description | Default |\n|----------|-------------|---------|\n| Navigation | Page navigation and management | On |\n| Interaction | Element click, fill, hover, drag | On |\n| Input | Keyboard, text input, file upload | On |\n| Emulation | Network, device, viewport emulation | On |\n| Performance | Tracing, memory, insights | On |\n| Extensions | Chrome extension management | Off |\n| Experimental | Vision, screencast, WebMCP | Off |\n| WebMCP | Page-exposed tools | Off |\n\nCategories can be enabled via CLI flags:\n\n```bash\nchrome-devtools --categoryExtensions=true <tool>\n```\n\n资料来源：[skills/chrome-devtools/SKILL.md]()\n\n## Snapshot Format\n\nThe `take_snapshot` command returns a hierarchical tree structure:\n\n```\nuid=1_0 RootWebArea \"Example Domain\" url=\"https://example.com/\"\n  uid=1_1 heading \"Example Domain\" level=\"1\"\n  uid=1_2 link \"Learn more\" href=\"https://example.com/about\"\n```\n\nEach element has a unique `uid` for interaction. The format shows:\n- Element type (RootWebArea, heading, link, etc.)\n- Text content\n- Attributes (level, href, url)\n- Unique identifier (uid) for command targeting\n\n资料来源：[skills/chrome-devtools-cli/SKILL.md]()\n\n## Workflow Patterns\n\n```mermaid\ngraph LR\n    A[navigate_page] --> B[wait_for]\n    B --> C[take_snapshot]\n    C --> D{Get uid}\n    D --> E[Interact with element]\n    E --> F[click/fill/hover]\n    F --> G[includeSnapshot?]\n    G -->|Yes| C\n    G -->|No| H[Continue]\n```\n\n### Before Interacting with a Page\n\n1. **Navigate**: Use `navigate_page` or `new_page`\n2. **Wait**: Use `wait_for` to ensure content is loaded\n3. **Snapshot**: Use `take_snapshot` to understand page structure\n4. **Interact**: Use element `uid`s from snapshot for commands\n\n### Efficient Data Retrieval\n\n- Use `filePath` parameter for large outputs (screenshots, snapshots, traces)\n- Use pagination (`pageIdx`, `pageSize`) and filtering (`types`) to minimize data\n- Set `includeSnapshot: false` on input actions unless you need updated page state\n\n资料来源：[skills/chrome-devtools/SKILL.md]()\n\n## Slim Mode\n\nThe `--slim` mode provides a minimal set of tools focused on core navigation and interaction, without additional features like performance tracing or extensions.\n\nAvailable slim tools include essential navigation and element interaction commands.\n\n资料来源：[docs/slim-tool-reference.md]()\n\n## CLI Options Configuration\n\nThe CLI accepts the following configuration options (from `src/bin/chrome-devtools-cli-options.ts`):\n\n| Option | Type | Description |\n|--------|------|-------------|\n| `--slim` | boolean | Enable slim mode with reduced toolset |\n| `--chromePath` | string | Path to Chrome executable |\n| `--userDataDir` | string | Chrome profile directory |\n| `--port` | number | Server port |\n| `--host` | string | Server host |\n| `--experimentalVision` | boolean | Enable vision-based tools |\n| `--experimentalScreencast` | boolean | Enable screencast |\n| `--categoryExtensions` | boolean | Enable extension tools |\n| `--categoryExperimentalWebmcp` | boolean | Enable WebMCP tools |\n\n资料来源：[src/bin/chrome-devtools-cli-options.ts]()\n\n## MCP Server Integration\n\n```mermaid\nsequenceDiagram\n    participant User\n    participant CLI\n    participant MCPServer\n    participant Chrome\n    \n    User->>CLI: chrome-devtools navigate_page\n    CLI->>MCPServer: Tool Request\n    MCPServer->>Chrome: CDP Command\n    Chrome-->>MCPServer: CDP Response\n    MCPServer-->>CLI: Tool Response\n    CLI-->>User: Formatted Output\n```\n\nThe CLI communicates with the MCP server using the Model Context Protocol over stdio transport. The server spawns Chrome as a child process and manages CDP (Chrome DevTools Protocol) connections.\n\n资料来源：[scripts/generate-cli.ts]()\n\n## Installation\n\n```bash\nnpm i chrome-devtools-mcp@latest -g\nchrome-devtools status  # Verify installation\n```\n\n### Troubleshooting\n\n| Issue | Solution |\n|-------|----------|\n| Command not found | Ensure global npm `bin` directory is in PATH |\n| Permission errors | Use node version manager (nvm) instead of sudo |\n| Old version running | Run `chrome-devtools stop && npm uninstall -g chrome-devtools-mcp` |\n\n资料来源：[skills/chrome-devtools-cli/references/installation.md]()\n\n## Development Scripts\n\nFrom `package.json`:\n\n| Script | Command | Purpose |\n|--------|---------|---------|\n| `build` | `tsc && test build` | Compile TypeScript and verify build |\n| `test` | `build && run all tests` | Run complete test suite |\n| `test <path>` | `build && run single test` | Run specific test file |\n| `format` | `fix formatting` | Apply formatting and show linting errors |\n| `gen` | `generate documentation` | Regenerate tool reference docs |\n\n资料来源：[AGENTS.md]()\n\n## TypeScript Rules\n\nThe codebase follows strict TypeScript guidelines:\n\n- No `any` type\n- No `as` keyword for type casting\n- No `!` operator for type assertion\n- No `// @ts-ignore` comments\n- Prefer `for..of` over `forEach`\n\n资料来源：[AGENTS.md]()\n\n---\n\n<a id='telemetry'></a>\n\n## Telemetry and Monitoring\n\n### 相关页面\n\n相关主题：[System Architecture](#system-architecture), [Configuration Reference](#configuration)\n\n# Telemetry and Monitoring\n\n## Overview\n\nThe chrome-devtools-mcp project implements a telemetry and monitoring system located in the `src/telemetry/` directory. This system is responsible for collecting, logging, and persisting usage metrics and error data from the MCP server operations.\n\n## System Architecture\n\nThe telemetry system comprises several interconnected components that work together to capture and report server behavior:\n\n```mermaid\ngraph TD\n    A[Tool Execution] --> B[Metrics Registry]\n    A --> C[Clearcut Logger]\n    B --> D[Persistence Layer]\n    C --> D\n    D --> E[Metrics Export]\n    F[Watchdog Client] --> C\n    G[Errors Module] --> C\n```\n\n## Core Components\n\n### 1. Metrics Registry (`metricsRegistry.ts`)\n\nThe metrics registry tracks tool call statistics and flag usage across the MCP server. It maintains counters and aggregations for:\n\n- Tool invocation counts\n- Flag usage patterns\n- Performance-related metrics\n\nThe registry is populated by data defined in `tool_call_metrics.json` and `flag_usage_metrics.json`, which define the specific metrics to be tracked.\n\n**资料来源:** [src/telemetry/metricsRegistry.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/telemetry/metricsRegistry.ts)\n\n### 2. Clearcut Logger (`ClearcutLogger.ts`)\n\nClearcutLogger is the primary logging mechanism for telemetry data. It handles:\n\n- Structured logging of events\n- Connection to telemetry backends\n- Batch processing of log entries\n\n**资料来源:** [src/telemetry/ClearcutLogger.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/telemetry/ClearcutLogger.ts)\n\n### 3. Watchdog Client (`WatchdogClient.ts`)\n\nThe WatchdogClient provides health monitoring functionality for the MCP server. It:\n\n- Monitors server responsiveness\n- Tracks resource utilization\n- Reports health status to external monitoring systems\n\n**资料来源:** [src/telemetry/WatchdogClient.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/telemetry/WatchdogClient.ts)\n\n### 4. Errors Module (`errors.ts`)\n\nThe errors module handles error telemetry and reporting:\n\n- Captures error conditions during tool execution\n- Categorizes errors by type and severity\n- Provides structured error data for logging\n\n**资料来源:** [src/telemetry/errors.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/telemetry/errors.ts)\n\n### 5. Persistence Layer (`persistence.ts`)\n\nThe persistence module manages storage of telemetry data:\n\n- Buffers metrics before transmission\n- Handles local caching of data\n- Manages data retention policies\n\n**资料来源:** [src/telemetry/persistence.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/telemetry/persistence.ts)\n\n### 6. Types (`types.ts`)\n\nCentral type definitions for all telemetry components including:\n\n- Metric data structures\n- Log entry formats\n- Configuration interfaces\n\n**资料来源:** [src/telemetry/types.ts](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/telemetry/types.ts)\n\n## Metrics Configuration\n\n### Tool Call Metrics (`tool_call_metrics.json`)\n\nThis JSON file defines which tools should have their invocations tracked. The format includes tool names and associated metadata for metrics collection.\n\n**资料来源:** [src/telemetry/tool_call_metrics.json](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/telemetry/tool_call_metrics.json)\n\n### Flag Usage Metrics (`flag_usage_metrics.json`)\n\nThis configuration file tracks usage patterns of command-line flags and configuration options passed to the MCP server.\n\n**资料来源:** [src/telemetry/flag_usage_metrics.json](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/telemetry/flag_usage_metrics.json)\n\n## Data Flow\n\n```mermaid\nsequenceDiagram\n    participant User as User/Tool\n    participant Registry as Metrics Registry\n    participant Logger as Clearcut Logger\n    participant Persistence as Persistence Layer\n    participant Backend as Telemetry Backend\n\n    User->>Registry: Record metric\n    Registry->>Persistence: Buffer data\n    User->>Logger: Log event\n    Logger->>Persistence: Batch events\n    Persistence->>Backend: Flush data\n    Backend-->>Persistence: Acknowledge\n```\n\n## Integration with Tool System\n\nThe telemetry system integrates with the tool definition infrastructure defined in `ToolDefinition.ts`. Tool execution flows through the telemetry system enabling automatic metrics collection.\n\n**资料来源:** [src/tools/ToolDefinition.ts:1-75](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/tools/ToolDefinition.ts)\n\n## WaitForHelper Integration\n\nThe `WaitForHelper` class handles navigation and event timing which feeds into performance telemetry. It tracks navigation events and DOM stability which are essential for understanding tool execution performance.\n\n**资料来源:** [src/WaitForHelper.ts:1-60](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/WaitForHelper.ts)\n\n## PageCollector Event Monitoring\n\nThe `PageCollector` class monitors page lifecycle events that contribute to telemetry data:\n\n- Target creation/destruction events\n- Navigation events\n- Resource loading patterns\n\n**资料来源:** [src/PageCollector.ts:1-60](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/src/PageCollector.ts)\n\n## Debug Logging\n\nFor troubleshooting telemetry issues, the project supports debug logging via the `DEBUG` environment variable. To write debug logs to a file:\n\n```sh\nnpx @modelcontextprotocol/inspector node /build/src/bin/chrome-devtools-mcp.js --log-file=/your/desired/path/log.txt\n```\n\n**资料来源:** [CONTRIBUTING.md](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/CONTRIBUTING.md)\n\n## Configuration Options\n\n| Option | Description | Default |\n|--------|-------------|---------|\n| `DEBUG` | Enable debug categories | undefined |\n| `--log-file` | Output debug logs to file | stdout |\n| Telemetry flags | Per-metric enable/disable | Enabled |\n\n## Best Practices\n\n1. **Review metrics before adding new ones** - Ensure the metric provides meaningful insight\n2. **Use structured logging** - Prefer the ClearcutLogger for consistency\n3. **Handle telemetry failures gracefully** - Telemetry should not block tool execution\n4. **Test metrics collection** - Verify metrics are recorded correctly in test scenarios\n\n**资料来源:** [CONTRIBUTING.md](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/CONTRIBUTING.md)\n\n## Related Documentation\n\n- [AGENTS.md](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/AGENTS.md) - General project instructions\n- [CONTRIBUTING.md](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/CONTRIBUTING.md) - Debugging and development guide\n- [skills/chrome-devtools/SKILL.md](https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/skills/chrome-devtools/SKILL.md) - Tool usage patterns\n\n---\n\n---\n\n## Doramagic 踩坑日志\n\n项目：ChromeDevTools/chrome-devtools-mcp\n\n摘要：发现 18 个潜在踩坑项，其中 1 个为 high/blocking；最高优先级：配置坑 - 来源证据：performance_start_trace records 'CPU throttling: none / Network throttling: none' despite emulate setting throttling —…。\n\n## 1. 配置坑 · 来源证据：performance_start_trace records 'CPU throttling: none / Network throttling: none' despite emulate setting throttling —…\n\n- 严重度：high\n- 证据强度：source_linked\n- 发现：GitHub 社区证据显示该项目存在一个配置相关的待验证问题：performance_start_trace records 'CPU throttling: none / Network throttling: none' despite emulate setting throttling — measurements come back partially or full…\n- 对用户的影响：可能增加新用户试用和生产接入成本。\n- 建议检查：来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。\n- 防护动作：不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- 证据：community_evidence:github | cevd_644cef1d4144424abe63f24528f5d082 | https://github.com/ChromeDevTools/chrome-devtools-mcp/issues/1955 | 来源讨论提到 macos 相关条件，需在安装/试用前复核。\n\n## 2. 安装坑 · 来源证据：Auto-connect doesn't work on WSL with mirrored networking (Chrome on Windows host)\n\n- 严重度：medium\n- 证据强度：source_linked\n- 发现：GitHub 社区证据显示该项目存在一个安装相关的待验证问题：Auto-connect doesn't work on WSL with mirrored networking (Chrome on Windows host)\n- 对用户的影响：可能增加新用户试用和生产接入成本。\n- 建议检查：来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。\n- 防护动作：不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- 证据：community_evidence:github | cevd_3275fc356e284918a94cf8c2c037caee | https://github.com/ChromeDevTools/chrome-devtools-mcp/issues/2004 | 来源讨论提到 windows 相关条件，需在安装/试用前复核。\n\n## 3. 安装坑 · 来源证据：Update check hardcodes registry.npmjs.org, ignoring user's npm registry configuration\n\n- 严重度：medium\n- 证据强度：source_linked\n- 发现：GitHub 社区证据显示该项目存在一个安装相关的待验证问题：Update check hardcodes registry.npmjs.org, ignoring user's npm registry configuration\n- 对用户的影响：可能阻塞安装或首次运行。\n- 建议检查：来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。\n- 防护动作：不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- 证据：community_evidence:github | cevd_1946d257bfb04c23a67250da4d584631 | https://github.com/ChromeDevTools/chrome-devtools-mcp/issues/1943 | 来源讨论提到 node 相关条件，需在安装/试用前复核。\n\n## 4. 安装坑 · 来源证据：chrome-devtools-mcp: v0.20.1\n\n- 严重度：medium\n- 证据强度：source_linked\n- 发现：GitHub 社区证据显示该项目存在一个安装相关的待验证问题：chrome-devtools-mcp: v0.20.1\n- 对用户的影响：可能增加新用户试用和生产接入成本。\n- 建议检查：来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。\n- 防护动作：不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- 证据：community_evidence:github | cevd_11700367e17048138ab79571d751cec4 | https://github.com/ChromeDevTools/chrome-devtools-mcp/releases/tag/chrome-devtools-mcp-v0.20.1 | 来源类型 github_release 暴露的待验证使用条件。\n\n## 5. 安装坑 · 来源证据：chrome-devtools-mcp: v0.22.0\n\n- 严重度：medium\n- 证据强度：source_linked\n- 发现：GitHub 社区证据显示该项目存在一个安装相关的待验证问题：chrome-devtools-mcp: v0.22.0\n- 对用户的影响：可能增加新用户试用和生产接入成本。\n- 建议检查：来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。\n- 防护动作：不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- 证据：community_evidence:github | cevd_6ff69eabdc334130b7b093706390c6c1 | https://github.com/ChromeDevTools/chrome-devtools-mcp/releases/tag/chrome-devtools-mcp-v0.22.0 | 来源类型 github_release 暴露的待验证使用条件。\n\n## 6. 配置坑 · 来源证据：chrome-devtools-mcp: v0.21.0\n\n- 严重度：medium\n- 证据强度：source_linked\n- 发现：GitHub 社区证据显示该项目存在一个配置相关的待验证问题：chrome-devtools-mcp: v0.21.0\n- 对用户的影响：可能增加新用户试用和生产接入成本。\n- 建议检查：来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。\n- 防护动作：不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- 证据：community_evidence:github | cevd_41b2681dc7ae4bbabdb071511fdc0191 | https://github.com/ChromeDevTools/chrome-devtools-mcp/releases/tag/chrome-devtools-mcp-v0.21.0 | 来源类型 github_release 暴露的待验证使用条件。\n\n## 7. 能力坑 · 能力判断依赖假设\n\n- 严重度：medium\n- 证据强度：source_linked\n- 发现：README/documentation is current enough for a first validation pass.\n- 对用户的影响：假设不成立时，用户拿不到承诺的能力。\n- 建议检查：将假设转成下游验证清单。\n- 防护动作：假设必须转成验证项；没有验证结果前不能写成事实。\n- 证据：capability.assumptions | github_repo:1054793726 | https://github.com/ChromeDevTools/chrome-devtools-mcp | README/documentation is current enough for a first validation pass.\n\n## 8. 运行坑 · 来源证据：chrome-devtools-mcp: v0.20.0\n\n- 严重度：medium\n- 证据强度：source_linked\n- 发现：GitHub 社区证据显示该项目存在一个运行相关的待验证问题：chrome-devtools-mcp: v0.20.0\n- 对用户的影响：可能增加新用户试用和生产接入成本。\n- 建议检查：来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。\n- 防护动作：不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- 证据：community_evidence:github | cevd_8bef6b0b7a80406ab00a0576f82b35a7 | https://github.com/ChromeDevTools/chrome-devtools-mcp/releases/tag/chrome-devtools-mcp-v0.20.0 | 来源类型 github_release 暴露的待验证使用条件。\n\n## 9. 运行坑 · 来源证据：chrome-devtools-mcp: v0.24.0\n\n- 严重度：medium\n- 证据强度：source_linked\n- 发现：GitHub 社区证据显示该项目存在一个运行相关的待验证问题：chrome-devtools-mcp: v0.24.0\n- 对用户的影响：可能增加新用户试用和生产接入成本。\n- 建议检查：来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。\n- 防护动作：不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- 证据：community_evidence:github | cevd_e42176fdf7da4015ac82844a46f37c08 | https://github.com/ChromeDevTools/chrome-devtools-mcp/releases/tag/chrome-devtools-mcp-v0.24.0 | 来源类型 github_release 暴露的待验证使用条件。\n\n## 10. 运行坑 · 来源证据：chrome-devtools-mcp: v0.26.0\n\n- 严重度：medium\n- 证据强度：source_linked\n- 发现：GitHub 社区证据显示该项目存在一个运行相关的待验证问题：chrome-devtools-mcp: v0.26.0\n- 对用户的影响：可能增加新用户试用和生产接入成本。\n- 建议检查：来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。\n- 防护动作：不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- 证据：community_evidence:github | cevd_a6cf1fa6206f48e6a9e88a5d9d00fd64 | https://github.com/ChromeDevTools/chrome-devtools-mcp/releases/tag/chrome-devtools-mcp-v0.26.0 | 来源类型 github_release 暴露的待验证使用条件。\n\n## 11. 维护坑 · 维护活跃度未知\n\n- 严重度：medium\n- 证据强度：source_linked\n- 发现：未记录 last_activity_observed。\n- 对用户的影响：新项目、停更项目和活跃项目会被混在一起，推荐信任度下降。\n- 建议检查：补 GitHub 最近 commit、release、issue/PR 响应信号。\n- 防护动作：维护活跃度未知时，推荐强度不能标为高信任。\n- 证据：evidence.maintainer_signals | github_repo:1054793726 | https://github.com/ChromeDevTools/chrome-devtools-mcp | last_activity_observed missing\n\n## 12. 安全/权限坑 · 下游验证发现风险项\n\n- 严重度：medium\n- 证据强度：source_linked\n- 发现：no_demo\n- 对用户的影响：下游已经要求复核，不能在页面中弱化。\n- 建议检查：进入安全/权限治理复核队列。\n- 防护动作：下游风险存在时必须保持 review/recommendation 降级。\n- 证据：downstream_validation.risk_items | github_repo:1054793726 | https://github.com/ChromeDevTools/chrome-devtools-mcp | no_demo; severity=medium\n\n## 13. 安全/权限坑 · 存在安全注意事项\n\n- 严重度：medium\n- 证据强度：source_linked\n- 发现：No sandbox install has been executed yet; downstream must verify before user use.\n- 对用户的影响：用户安装前需要知道权限边界和敏感操作。\n- 建议检查：转成明确权限清单和安全审查提示。\n- 防护动作：安全注意事项必须面向用户前置展示。\n- 证据：risks.safety_notes | github_repo:1054793726 | https://github.com/ChromeDevTools/chrome-devtools-mcp | No sandbox install has been executed yet; downstream must verify before user use.\n\n## 14. 安全/权限坑 · 存在评分风险\n\n- 严重度：medium\n- 证据强度：source_linked\n- 发现：no_demo\n- 对用户的影响：风险会影响是否适合普通用户安装。\n- 建议检查：把风险写入边界卡，并确认是否需要人工复核。\n- 防护动作：评分风险必须进入边界卡，不能只作为内部分数。\n- 证据：risks.scoring_risks | github_repo:1054793726 | https://github.com/ChromeDevTools/chrome-devtools-mcp | no_demo; severity=medium\n\n## 15. 安全/权限坑 · 来源证据：Close empty-object tool schemas for stricter MCP client validation\n\n- 严重度：medium\n- 证据强度：source_linked\n- 发现：GitHub 社区证据显示该项目存在一个安全/权限相关的待验证问题：Close empty-object tool schemas for stricter MCP client validation\n- 对用户的影响：可能增加新用户试用和生产接入成本。\n- 建议检查：来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。\n- 防护动作：不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- 证据：community_evidence:github | cevd_2af67f120a9d4486998a92da71a92cb9 | https://github.com/ChromeDevTools/chrome-devtools-mcp/issues/2049 | 来源类型 github_issue 暴露的待验证使用条件。\n\n## 16. 安全/权限坑 · 来源证据：chrome-devtools-mcp: v0.25.0\n\n- 严重度：medium\n- 证据强度：source_linked\n- 发现：GitHub 社区证据显示该项目存在一个安全/权限相关的待验证问题：chrome-devtools-mcp: v0.25.0\n- 对用户的影响：可能影响授权、密钥配置或安全边界。\n- 建议检查：来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。\n- 防护动作：不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- 证据：community_evidence:github | cevd_51ee93809f08423dbc7b6c0d3eeddc77 | https://github.com/ChromeDevTools/chrome-devtools-mcp/releases/tag/chrome-devtools-mcp-v0.25.0 | 来源类型 github_release 暴露的待验证使用条件。\n\n## 17. 维护坑 · issue/PR 响应质量未知\n\n- 严重度：low\n- 证据强度：source_linked\n- 发现：issue_or_pr_quality=unknown。\n- 对用户的影响：用户无法判断遇到问题后是否有人维护。\n- 建议检查：抽样最近 issue/PR，判断是否长期无人处理。\n- 防护动作：issue/PR 响应未知时，必须提示维护风险。\n- 证据：evidence.maintainer_signals | github_repo:1054793726 | https://github.com/ChromeDevTools/chrome-devtools-mcp | issue_or_pr_quality=unknown\n\n## 18. 维护坑 · 发布节奏不明确\n\n- 严重度：low\n- 证据强度：source_linked\n- 发现：release_recency=unknown。\n- 对用户的影响：安装命令和文档可能落后于代码，用户踩坑概率升高。\n- 建议检查：确认最近 release/tag 和 README 安装命令是否一致。\n- 防护动作：发布节奏未知或过期时，安装说明必须标注可能漂移。\n- 证据：evidence.maintainer_signals | github_repo:1054793726 | https://github.com/ChromeDevTools/chrome-devtools-mcp | release_recency=unknown\n\n<!-- canonical_name: ChromeDevTools/chrome-devtools-mcp; human_manual_source: deepwiki_human_wiki -->\n",
      "summary": "DeepWiki/Human Wiki 完整输出，末尾追加 Discovery Agent 踩坑日志。",
      "title": "Human Manual / 人类版说明书"
    },
    "pitfall_log": {
      "asset_id": "pitfall_log",
      "filename": "PITFALL_LOG.md",
      "markdown": "# Pitfall Log / 踩坑日志\n\n项目：ChromeDevTools/chrome-devtools-mcp\n\n摘要：发现 18 个潜在踩坑项，其中 1 个为 high/blocking；最高优先级：配置坑 - 来源证据：performance_start_trace records 'CPU throttling: none / Network throttling: none' despite emulate setting throttling —…。\n\n## 1. 配置坑 · 来源证据：performance_start_trace records 'CPU throttling: none / Network throttling: none' despite emulate setting throttling —…\n\n- 严重度：high\n- 证据强度：source_linked\n- 发现：GitHub 社区证据显示该项目存在一个配置相关的待验证问题：performance_start_trace records 'CPU throttling: none / Network throttling: none' despite emulate setting throttling — measurements come back partially or full…\n- 对用户的影响：可能增加新用户试用和生产接入成本。\n- 建议检查：来源问题仍为 open，Pack Agent 需要复核是否仍影响当前版本。\n- 防护动作：不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- 证据：community_evidence:github | cevd_644cef1d4144424abe63f24528f5d082 | https://github.com/ChromeDevTools/chrome-devtools-mcp/issues/1955 | 来源讨论提到 macos 相关条件，需在安装/试用前复核。\n\n## 2. 安装坑 · 来源证据：Auto-connect doesn't work on WSL with mirrored networking (Chrome on Windows host)\n\n- 严重度：medium\n- 证据强度：source_linked\n- 发现：GitHub 社区证据显示该项目存在一个安装相关的待验证问题：Auto-connect doesn't work on WSL with mirrored networking (Chrome on Windows host)\n- 对用户的影响：可能增加新用户试用和生产接入成本。\n- 建议检查：来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。\n- 防护动作：不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- 证据：community_evidence:github | cevd_3275fc356e284918a94cf8c2c037caee | https://github.com/ChromeDevTools/chrome-devtools-mcp/issues/2004 | 来源讨论提到 windows 相关条件，需在安装/试用前复核。\n\n## 3. 安装坑 · 来源证据：Update check hardcodes registry.npmjs.org, ignoring user's npm registry configuration\n\n- 严重度：medium\n- 证据强度：source_linked\n- 发现：GitHub 社区证据显示该项目存在一个安装相关的待验证问题：Update check hardcodes registry.npmjs.org, ignoring user's npm registry configuration\n- 对用户的影响：可能阻塞安装或首次运行。\n- 建议检查：来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。\n- 防护动作：不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- 证据：community_evidence:github | cevd_1946d257bfb04c23a67250da4d584631 | https://github.com/ChromeDevTools/chrome-devtools-mcp/issues/1943 | 来源讨论提到 node 相关条件，需在安装/试用前复核。\n\n## 4. 安装坑 · 来源证据：chrome-devtools-mcp: v0.20.1\n\n- 严重度：medium\n- 证据强度：source_linked\n- 发现：GitHub 社区证据显示该项目存在一个安装相关的待验证问题：chrome-devtools-mcp: v0.20.1\n- 对用户的影响：可能增加新用户试用和生产接入成本。\n- 建议检查：来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。\n- 防护动作：不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- 证据：community_evidence:github | cevd_11700367e17048138ab79571d751cec4 | https://github.com/ChromeDevTools/chrome-devtools-mcp/releases/tag/chrome-devtools-mcp-v0.20.1 | 来源类型 github_release 暴露的待验证使用条件。\n\n## 5. 安装坑 · 来源证据：chrome-devtools-mcp: v0.22.0\n\n- 严重度：medium\n- 证据强度：source_linked\n- 发现：GitHub 社区证据显示该项目存在一个安装相关的待验证问题：chrome-devtools-mcp: v0.22.0\n- 对用户的影响：可能增加新用户试用和生产接入成本。\n- 建议检查：来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。\n- 防护动作：不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- 证据：community_evidence:github | cevd_6ff69eabdc334130b7b093706390c6c1 | https://github.com/ChromeDevTools/chrome-devtools-mcp/releases/tag/chrome-devtools-mcp-v0.22.0 | 来源类型 github_release 暴露的待验证使用条件。\n\n## 6. 配置坑 · 来源证据：chrome-devtools-mcp: v0.21.0\n\n- 严重度：medium\n- 证据强度：source_linked\n- 发现：GitHub 社区证据显示该项目存在一个配置相关的待验证问题：chrome-devtools-mcp: v0.21.0\n- 对用户的影响：可能增加新用户试用和生产接入成本。\n- 建议检查：来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。\n- 防护动作：不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- 证据：community_evidence:github | cevd_41b2681dc7ae4bbabdb071511fdc0191 | https://github.com/ChromeDevTools/chrome-devtools-mcp/releases/tag/chrome-devtools-mcp-v0.21.0 | 来源类型 github_release 暴露的待验证使用条件。\n\n## 7. 能力坑 · 能力判断依赖假设\n\n- 严重度：medium\n- 证据强度：source_linked\n- 发现：README/documentation is current enough for a first validation pass.\n- 对用户的影响：假设不成立时，用户拿不到承诺的能力。\n- 建议检查：将假设转成下游验证清单。\n- 防护动作：假设必须转成验证项；没有验证结果前不能写成事实。\n- 证据：capability.assumptions | github_repo:1054793726 | https://github.com/ChromeDevTools/chrome-devtools-mcp | README/documentation is current enough for a first validation pass.\n\n## 8. 运行坑 · 来源证据：chrome-devtools-mcp: v0.20.0\n\n- 严重度：medium\n- 证据强度：source_linked\n- 发现：GitHub 社区证据显示该项目存在一个运行相关的待验证问题：chrome-devtools-mcp: v0.20.0\n- 对用户的影响：可能增加新用户试用和生产接入成本。\n- 建议检查：来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。\n- 防护动作：不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- 证据：community_evidence:github | cevd_8bef6b0b7a80406ab00a0576f82b35a7 | https://github.com/ChromeDevTools/chrome-devtools-mcp/releases/tag/chrome-devtools-mcp-v0.20.0 | 来源类型 github_release 暴露的待验证使用条件。\n\n## 9. 运行坑 · 来源证据：chrome-devtools-mcp: v0.24.0\n\n- 严重度：medium\n- 证据强度：source_linked\n- 发现：GitHub 社区证据显示该项目存在一个运行相关的待验证问题：chrome-devtools-mcp: v0.24.0\n- 对用户的影响：可能增加新用户试用和生产接入成本。\n- 建议检查：来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。\n- 防护动作：不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- 证据：community_evidence:github | cevd_e42176fdf7da4015ac82844a46f37c08 | https://github.com/ChromeDevTools/chrome-devtools-mcp/releases/tag/chrome-devtools-mcp-v0.24.0 | 来源类型 github_release 暴露的待验证使用条件。\n\n## 10. 运行坑 · 来源证据：chrome-devtools-mcp: v0.26.0\n\n- 严重度：medium\n- 证据强度：source_linked\n- 发现：GitHub 社区证据显示该项目存在一个运行相关的待验证问题：chrome-devtools-mcp: v0.26.0\n- 对用户的影响：可能增加新用户试用和生产接入成本。\n- 建议检查：来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。\n- 防护动作：不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- 证据：community_evidence:github | cevd_a6cf1fa6206f48e6a9e88a5d9d00fd64 | https://github.com/ChromeDevTools/chrome-devtools-mcp/releases/tag/chrome-devtools-mcp-v0.26.0 | 来源类型 github_release 暴露的待验证使用条件。\n\n## 11. 维护坑 · 维护活跃度未知\n\n- 严重度：medium\n- 证据强度：source_linked\n- 发现：未记录 last_activity_observed。\n- 对用户的影响：新项目、停更项目和活跃项目会被混在一起，推荐信任度下降。\n- 建议检查：补 GitHub 最近 commit、release、issue/PR 响应信号。\n- 防护动作：维护活跃度未知时，推荐强度不能标为高信任。\n- 证据：evidence.maintainer_signals | github_repo:1054793726 | https://github.com/ChromeDevTools/chrome-devtools-mcp | last_activity_observed missing\n\n## 12. 安全/权限坑 · 下游验证发现风险项\n\n- 严重度：medium\n- 证据强度：source_linked\n- 发现：no_demo\n- 对用户的影响：下游已经要求复核，不能在页面中弱化。\n- 建议检查：进入安全/权限治理复核队列。\n- 防护动作：下游风险存在时必须保持 review/recommendation 降级。\n- 证据：downstream_validation.risk_items | github_repo:1054793726 | https://github.com/ChromeDevTools/chrome-devtools-mcp | no_demo; severity=medium\n\n## 13. 安全/权限坑 · 存在安全注意事项\n\n- 严重度：medium\n- 证据强度：source_linked\n- 发现：No sandbox install has been executed yet; downstream must verify before user use.\n- 对用户的影响：用户安装前需要知道权限边界和敏感操作。\n- 建议检查：转成明确权限清单和安全审查提示。\n- 防护动作：安全注意事项必须面向用户前置展示。\n- 证据：risks.safety_notes | github_repo:1054793726 | https://github.com/ChromeDevTools/chrome-devtools-mcp | No sandbox install has been executed yet; downstream must verify before user use.\n\n## 14. 安全/权限坑 · 存在评分风险\n\n- 严重度：medium\n- 证据强度：source_linked\n- 发现：no_demo\n- 对用户的影响：风险会影响是否适合普通用户安装。\n- 建议检查：把风险写入边界卡，并确认是否需要人工复核。\n- 防护动作：评分风险必须进入边界卡，不能只作为内部分数。\n- 证据：risks.scoring_risks | github_repo:1054793726 | https://github.com/ChromeDevTools/chrome-devtools-mcp | no_demo; severity=medium\n\n## 15. 安全/权限坑 · 来源证据：Close empty-object tool schemas for stricter MCP client validation\n\n- 严重度：medium\n- 证据强度：source_linked\n- 发现：GitHub 社区证据显示该项目存在一个安全/权限相关的待验证问题：Close empty-object tool schemas for stricter MCP client validation\n- 对用户的影响：可能增加新用户试用和生产接入成本。\n- 建议检查：来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。\n- 防护动作：不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- 证据：community_evidence:github | cevd_2af67f120a9d4486998a92da71a92cb9 | https://github.com/ChromeDevTools/chrome-devtools-mcp/issues/2049 | 来源类型 github_issue 暴露的待验证使用条件。\n\n## 16. 安全/权限坑 · 来源证据：chrome-devtools-mcp: v0.25.0\n\n- 严重度：medium\n- 证据强度：source_linked\n- 发现：GitHub 社区证据显示该项目存在一个安全/权限相关的待验证问题：chrome-devtools-mcp: v0.25.0\n- 对用户的影响：可能影响授权、密钥配置或安全边界。\n- 建议检查：来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。\n- 防护动作：不得脱离来源链接放大为确定性结论；需要标注适用版本和复核状态。\n- 证据：community_evidence:github | cevd_51ee93809f08423dbc7b6c0d3eeddc77 | https://github.com/ChromeDevTools/chrome-devtools-mcp/releases/tag/chrome-devtools-mcp-v0.25.0 | 来源类型 github_release 暴露的待验证使用条件。\n\n## 17. 维护坑 · issue/PR 响应质量未知\n\n- 严重度：low\n- 证据强度：source_linked\n- 发现：issue_or_pr_quality=unknown。\n- 对用户的影响：用户无法判断遇到问题后是否有人维护。\n- 建议检查：抽样最近 issue/PR，判断是否长期无人处理。\n- 防护动作：issue/PR 响应未知时，必须提示维护风险。\n- 证据：evidence.maintainer_signals | github_repo:1054793726 | https://github.com/ChromeDevTools/chrome-devtools-mcp | issue_or_pr_quality=unknown\n\n## 18. 维护坑 · 发布节奏不明确\n\n- 严重度：low\n- 证据强度：source_linked\n- 发现：release_recency=unknown。\n- 对用户的影响：安装命令和文档可能落后于代码，用户踩坑概率升高。\n- 建议检查：确认最近 release/tag 和 README 安装命令是否一致。\n- 防护动作：发布节奏未知或过期时，安装说明必须标注可能漂移。\n- 证据：evidence.maintainer_signals | github_repo:1054793726 | https://github.com/ChromeDevTools/chrome-devtools-mcp | release_recency=unknown\n",
      "summary": "用户实践前最可能遇到的身份、安装、配置、运行和安全坑。",
      "title": "Pitfall Log / 踩坑日志"
    },
    "prompt_preview": {
      "asset_id": "prompt_preview",
      "filename": "PROMPT_PREVIEW.md",
      "markdown": "# chrome-devtools-mcp - Prompt Preview\n\n> Copy the prompt below into your AI host before installing anything.\n> Its purpose is to let you safely feel the project's workflow, not to claim the project has already run.\n\n## Copy this prompt\n\n```text\nYou are using an independent Doramagic capability pack for ChromeDevTools/chrome-devtools-mcp.\n\nProject:\n- Name: chrome-devtools-mcp\n- Repository: https://github.com/ChromeDevTools/chrome-devtools-mcp\n- Summary: Chrome DevTools for coding agents\n- Host target: mcp_host\n\nGoal:\nHelp me evaluate this project for the following task without installing it yet: Chrome DevTools for coding agents\n\nBefore taking action:\n1. Restate my task, success standard, and boundary.\n2. Identify whether the next step requires tools, browser access, network access, filesystem access, credentials, package installation, or host configuration.\n3. Use only the Doramagic Project Pack, the upstream repository, and the source-linked evidence listed below.\n4. If a real command, install step, API call, file write, or host integration is required, mark it as \"requires post-install verification\" and ask for approval first.\n5. If evidence is missing, say \"evidence is missing\" instead of filling the gap.\n\nPreviewable capabilities:\n- Capability 1: Use the source-backed project context to guide one small, checkable workflow step.\n\nCapabilities that require post-install verification:\n- Capability 1: Use the source-backed project context to guide one small, checkable workflow step.\n- Capability 2: Use the source-backed project context to guide one small, checkable workflow step.\n\nCore service flow:\n1. overview: Project Overview. Produce one small intermediate artifact and wait for confirmation.\n2. configuration: Configuration Reference. Produce one small intermediate artifact and wait for confirmation.\n3. system-architecture: System Architecture. Produce one small intermediate artifact and wait for confirmation.\n4. mcp-protocol: MCP Protocol Integration. Produce one small intermediate artifact and wait for confirmation.\n5. automation-tools: Input and Navigation Automation Tools. Produce one small intermediate artifact and wait for confirmation.\n\nSource-backed evidence to keep in mind:\n- https://github.com/ChromeDevTools/chrome-devtools-mcp\n- https://github.com/ChromeDevTools/chrome-devtools-mcp#readme\n- skills/a11y-debugging/SKILL.md\n- skills/chrome-devtools/SKILL.md\n- skills/chrome-devtools-cli/SKILL.md\n- skills/debug-optimize-lcp/SKILL.md\n- skills/memory-leak-debugging/SKILL.md\n- skills/troubleshooting/SKILL.md\n- README.md\n- package.json\n\nFirst response rules:\n1. Start Step 1 only.\n2. Explain the one service action you will perform first.\n3. Ask exactly three questions about my target workflow, success standard, and sandbox boundary.\n4. Stop and wait for my answers.\n\nStep 1 follow-up protocol:\n- After I answer the first three questions, stay in Step 1.\n- Produce six parts only: clarified task, success standard, boundary conditions, two or three options, tradeoffs for each option, and one recommendation.\n- End by asking whether I confirm the recommendation.\n- Do not move to Step 2 until I explicitly confirm.\n\nConversation rules:\n- Advance one step at a time and wait for confirmation after each small artifact.\n- Write outputs as recommendations or planned checks, not as completed execution.\n- Do not claim tests passed, files changed, commands ran, APIs were called, or the project was installed.\n- If the user asks for execution, first provide the sandbox setup, expected output, rollback, and approval checkpoint.\n```\n",
      "summary": "不安装项目也能感受能力节奏的安全试用 Prompt。",
      "title": "Prompt Preview / 安装前试用 Prompt"
    },
    "quick_start": {
      "asset_id": "quick_start",
      "filename": "QUICK_START.md",
      "markdown": "# Quick Start / 官方入口\n\n项目：ChromeDevTools/chrome-devtools-mcp\n\n## 官方安装入口\n\n### Node.js / npx · 官方安装入口\n\n```bash\nnpx chrome-devtools-mcp@latest\n```\n\n来源：https://github.com/ChromeDevTools/chrome-devtools-mcp#readme\n\n## 来源\n\n- repo: https://github.com/ChromeDevTools/chrome-devtools-mcp\n- docs: https://github.com/ChromeDevTools/chrome-devtools-mcp#readme\n",
      "summary": "从项目官方 README 或安装文档提取的开工入口。",
      "title": "Quick Start / 官方入口"
    }
  },
  "validation_id": "dval_4bf0f41c618044f5bad63623dbb605c1"
}
