Skip to content

Adonis0123/adonis-skills / skills/chrome-dev-mcp

chrome-dev-mcp

Verified

Use this skill when the user invokes /chrome-dev-mcp or asks for Chrome DevTools MCP, CDP, list_pages/select_page, UXC packaging for Chrome DevTools, DOM snapshots, Console, Network, Performance, Lighthouse, heap analysis, browser-internal debugging, connection recovery, or correct-Chrome validation across Claude Code, Codex, Grok Build/Grok002, Cursor CLI, Hermes, or WorkBuddy. Use it when the evidence is Chrome-specific (Lighthouse, a full trace, heap data) or the caller has no page session yet; a page already open in ego-browser keeps its own Console and request diagnosis. Also use it as the verification step right after the user or this session changes a web UI or asks to accept or check a page: collect a screenshot, Console, and Network evidence before calling it done. Do not use it for ordinary navigation, form filling, scraping, or desktop UI unless browser-internal signals or UI-change acceptance are required. A passing readiness or list_pages check proves the connection only, never the change.

scripts/ensure-connection.zsh

View on GitHub
#!/bin/zsh

set -euo pipefail

script_dir="${0:A:h}"
source "$script_dir/lib/load-config.zsh"

if [[ "${1:-}" == "--help" || "${1:-}" == "-h" ]]; then
  print -- "usage: zsh ensure-connection.zsh [--check|--recover]"
  print -- "  --check: identity check only; --recover (default): launch the configured isolated profile when the endpoint is absent"
  exit 0
fi

mode="${1:---recover}"
check_reason="CHECK_FAILED"

die() {
  print -u2 -- "chrome-dev-mcp: $1"
  exit 69
}

[[ "$mode" == "--check" || "$mode" == "--recover" ]] || die "expected --check or --recover"
[[ $# -le 1 ]] || die "unexpected arguments"
chrome_dev_mcp_load_config || die "local configuration missing; run configure-local.zsh"

wrapper="${CHROME_DEV_MCP_WRAPPER:-}"
launcher="${CHROME_DEV_MCP_LAUNCHER:-}"
[[ -x "$wrapper" ]] || die "missing configured wrapper"
[[ -x "$launcher" ]] || die "missing configured launcher"

check_connection() {
  local check_error structured_reason

  if check_error="$("$wrapper" --check 2>&1)"; then
    check_reason="READY"
    return 0
  fi

  structured_reason="$(
    print -r -- "$check_error" |
      /usr/bin/awk -F= '$1 == "CHROME_DEVTOOLS_MCP_SAFE_REASON" { print $2; exit }'
  )"
  case "$structured_reason" in
    ENDPOINT_UNAVAILABLE|LISTENER_COUNT|WRONG_BINARY|WRONG_PROFILE|WEBSOCKET_MISMATCH|NOT_CHROME)
      check_reason="$structured_reason"
      return 1
      ;;
  esac

  case "$check_error" in
    *"endpoint unavailable"*) check_reason="ENDPOINT_UNAVAILABLE" ;;
    *"expected exactly one Chrome listener"*) check_reason="LISTENER_COUNT" ;;
    *"not the expected official Google Chrome binary"*) check_reason="WRONG_BINARY" ;;
    *"not using the shared isolated Chrome profile"*) check_reason="WRONG_PROFILE" ;;
    *"mismatched WebSocket address"*) check_reason="WEBSOCKET_MISMATCH" ;;
    *"did not identify itself as Google Chrome"*) check_reason="NOT_CHROME" ;;
    *) check_reason="CHECK_FAILED" ;;
  esac

  return 1
}

report_not_ready() {
  print -- "CHROME_DEV_MCP_CONNECTION=NOT_READY"
  print -- "REASON=$check_reason"
}

if check_connection; then
  print -- "CHROME_DEV_MCP_CONNECTION=READY"
  print -- "RECOVERY=NOT_NEEDED"
  exit 0
fi

if [[ "$mode" == "--check" ]]; then
  report_not_ready
  exit 69
fi

if [[ "$check_reason" != "ENDPOINT_UNAVAILABLE" ]]; then
  report_not_ready
  die "connection identity check failed closed"
fi

"$launcher" >/dev/null || die "configured launcher could not recover the connection"
if ! check_connection; then
  report_not_ready
  die "connection failed verification after recovery"
fi

print -- "CHROME_DEV_MCP_CONNECTION=READY"
print -- "RECOVERY=PERFORMED"
brainstormingobra/superpowersYou MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).Stars: 322kUpdated Claude CodeCodexVerifiedInstall
brand-guidelinesanthropics/skillsApplies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
frontend-designanthropics/skillsGuidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
mcp-builderanthropics/skillsGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).Stars: 198kUpdated Claude CodeCodexVerifiedInstall