Chrome Invocation: Preparing the Chrome CDP Runtime for the Agent

Preface

When letting an AI operate a browser, the common approach is to directly call Playwright, Puppeteer, or various MCP browser tools. These solutions often come with their own browser launch logic, which may not align with an already-running local Chrome instance or a fixed debugging port 9222. If you want the Agent to first confirm the debugging port, take over an existing Chrome instance, or launch an instance with CDP from a known executable path before performing tab selection and page scripting, you need a layer of “runtime preparation” instructions rather than scattered ad-hoc commands.

Below we introduce Chrome Invoke (coordinate @user_2a19425c/chrome-cdp-runtime, version 1.0.0) on SkillHub. It uses a generic SKILL.md to constrain the Agent’s behavior: it only uses Chrome CDP, focuses exclusively on 9222, and provides reusable connection and tab operation prerequisites for higher-level business Skills.

What Is This

Chrome Invoke (Display Name within the package: Chrome CDP Runtime) is maintained by the community publisher user_2a19425c, categorized under dev-programming, and sourced from the community. The SkillHub page is marked with requires_api_key=false, meaning installation and usage do not depend on any additional API Key.

In one sentence: it standardizes the runtime preparation of Chrome DevTools Protocol (CDP) on the Agent side—checking 9222, taking over an existing instance or launching a debug Chrome from a known path, and completing basic page connection and tab operations.

Core Functions

The following capabilities all come from the Skill’s SKILL.md and the SkillHub description; no interfaces or script names not present in the documentation are included.

  1. Check 9222: Determine whether the local debugging port is already listening and accessible.
  2. Take over an existing instance: If 9222 is already in use, prioritize connecting to the existing Chrome CDP; no Chrome executable path is required.
  3. Launch a debug instance by path: If 9222 is not listening and the caller provides a confirmed chromeExecutablePath, launch Chrome from that path with 9222 enabled.
  4. Basic tab and page operations: After connecting to CDP, list tabs, select target pages, and support basic page reading, navigation, and script execution.
  5. Explicit failure when the environment is not satisfied: When the Chrome path is unknown, not installed, or 9222 is unavailable, only report the blocking reason; do not switch browsers or guess paths.

Hard constraints (explicitly required by the documentation)

  • Only use Chrome CDP; the debugging port is exclusively 9222 (debugPort is optional, defaulting to 9222).
  • Do not use Edge or any other unauthorized browser as a substitute.
  • When auto-launching Chrome, paths must not be hardcoded; the path must be provided by the input and already confirmed.

Optional input fields

Field Description
chromeExecutablePath Path to the Chrome executable; may be omitted only when taking over an existing CDP
targetUrl Target URL (optional)
userDataDir User data directory (optional)
debugPort Debugging port, default 9222

Suggested trigger scenarios (When to use)

  • Environment preparation before Chrome CDP debugging and browser automation
  • Taking over an existing 9222 instance
  • Launching a Chrome debug instance
  • Listing/selecting browser tabs
  • Executing page scripts via CDP

Installation and Activation

The installation method given on the official SkillHub page is: let the Agent install the coordinate @user_2a19425c/chrome-cdp-runtime according to the SkillHub installation instructions.

If the skillhub CLI is already installed on the local machine, you can first confirm the version, then install it into the current Agent’s skills directory (the --dir flag must be used during installation; otherwise the default directory may not be loaded by the Agent):

command -v skillhub && skillhub --version

If the CLI is not installed, follow the SkillHub documentation to perform a complete installation (excerpt):

curl -fsSL https://skillhub-1388575217.cos.ap-guangzhou.myqcloud.com/install/install.sh | bash

Install this Skill into the skills directory of the corresponding client; for example, the common Cursor path is ~/.cursor/skills/:

skillhub install chrome-cdp-runtime --namespace user_2a19425c --dir ~/.cursor/skills/

The skills paths for other clients follow section four of skillhub.cn/install/skillhub.md (e.g., Claude Code: ~/.claude/skills/, Codex: ~/.codex/skills/, etc.). After installation, refresh or restart according to each client’s requirements so that the new Skill takes effect.

You can also send the following prompt to an AI that supports Skill installation, letting it complete the installation according to the official documentation:

Please install `@user_2a19425c/chrome-cdp-runtime` according to https://skillhub.cn/install/skillhub.md.

Typical Usage

This Skill does not include a standalone CLI script; its usage is reflected in the Agent following the execution flow in SKILL.md. Below, reproducible logic is explained in the order of the documentation (specific CDP commands are chosen by the Agent under compliant prerequisites; this article does not fabricate tool names that do not appear).

Flow 1: Prioritize taking over an existing Chrome

  1. Check whether 9222 is already listening.
  2. If accessible, connect to the existing Chrome CDP, list tabs, and select the target tab.
  3. Perform reading, navigation, or script execution on the target page.

In this case, chromeExecutablePath is not needed.

Flow 2: The Agent needs to launch Chrome

  1. Check that 9222 is not listening.
  2. The caller provides a confirmed chromeExecutablePath (as well as optional userDataDir and targetUrl).
  3. Launch Chrome from the path, enable 9222, then connect to the tab and operate on the page.

If the path is not provided and 9222 is unavailable, the Agent should stop and explain that the environment is not satisfied, rather than guessing the system Chrome location or switching to Edge.

Flow 3: Provide a runtime for higher-level Skills

The completion criteria are the four points in the documentation: successfully taking over or launching Chrome CDP; 9222 is accessible; the target tab can be listed and connected to; basic page operations can be performed. Once satisfied, other business Skills that depend on the browser can continue working on top of this runtime.

Use Cases and Notes

Who it is for

  • Those already using 9222 for Chrome remote debugging locally and want the Agent to first “connect” before doing work.
  • Those who need unified constraints: only use Chrome CDP, fixed 9222, avoiding the Agent switching browsers or writing paths at will.
  • Developers who want to split “browser environment preparation” and “business automation” into two layers of Skills.

Limitations and notes

  • The port policy is hardcoded as 9222; if this port is occupied locally or blocked by a firewall, the environment must be resolved first. The Skill will not automatically change the port policy (unless debugPort is explicitly used in the input and remains consistent with the documentation’s default).
  • It cannot replace a complete E2E framework: it focuses on CDP runtime and basic tab/page capabilities; complex scenarios still need to be handled by upper-layer logic or dedicated tools.
  • Auto-launching depends on the caller providing a real Chrome path; on CI or machines without a graphical environment, it is usually more suitable to pre-launch Chrome with 9222 and then follow the takeover flow.
  • SkillHub statistics (based on page scraping): rating 100000, approximately 2991 downloads, approximately 8 installations; the data changes over time, so refer to the SkillHub page.

Conclusion

Chrome Invoke writes the preparation steps of Chrome CDP on the Agent side into a Skill: first 9222, then take over or launch by path, and finally connect to tabs and perform basic page operations, explicitly prohibiting switching browsers and hardcoding paths. If your automation needs to start from a “local debugging Chrome”, you can install @user_2a19425c/chrome-cdp-runtime on SkillHub.

  • SkillHub page: https://www.skillhub.cn/skills/user_2a19425c/chrome-cdp-runtime
  • API coordinate page: https://api.skillhub.cn/user_2a19425c/chrome-cdp-runtime
  • Installation instructions: https://skillhub.cn/install/skillhub.md
羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye