list_targets
List targets
List the debuggable targets on the DevTools endpoint — pages, webviews and Electron windows — with their id, type, title and URL. Start here to find the target id every other tool needs.
无需输入参数。

io.github.dockndevai由 GitHub 账号 dockndevai 发布v0.2.3更新于 Oct 26, 2026
Safe-by-default MCP that drives an Electron/Chrome app over CDP: DOM, console, network, input.
默认安全的 MCP 服务器,通过 Chrome DevTools 协议驱动 Electron 或 Chrome/Chromium 应用,提供 DOM、控制台、网络与输入工具。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
参照 仓库 中的启动说明。
A safe-by-default Model Context Protocol server that drives an Electron or Chrome/Chromium app over the Chrome DevTools Protocol (CDP) — instead of pixel-level GUI automation. Point it at the app's --remote-debugging-port and an agent gets the DOM, console, network requests, real input (click / type / navigate), and — gated — JavaScript evaluation.
Why this beats computer-use for a desktop/web app:
Part of the dockndevai MCP server suite — one governance model across all of them.
Starts read-only (see Safe by default); higher-capability tools are only registered when you raise the mode.
Start your app (or a worktree's dev build) with an explicit port — one per agent:
your-app --remote-debugging-port=9222, or in main-process code
app.commandLine.appendSwitch('remote-debugging-port', '9222') before app.whenReady().chrome --headless=new --remote-debugging-port=9222 --user-data-dir=/tmp/p1 <url>.Check it's up: curl http://127.0.0.1:9222/json/version.
See docs/CLIENTS.md for Claude Code / Cursor / Codex / VS Code / Windsurf, and .env.example for every variable.
Enforced by src/security.ts. The browser process is the real boundary — this keeps an agent inside the targets and actions you intend:
CDP_MODE — read-only (default) → read-write → admin. Tools above the mode aren't registered, so in read-only the agent cannot click, type or navigate at all.CDP_TARGET_ALLOWLIST — confine interactions to targets whose URL matches your patterns (empty = all). Reads (inspection) are always allowed.CDP_PROTECTED_TARGETS — targets that can be inspected but never interacted with. Defaults protect sign-in pages (accounts.google.com, login.microsoftonline.com, …) and browser internals (chrome://, devtools://, extensions).CDP_ALLOW_EVAL — evaluate is arbitrary code execution in the renderer: admin mode plus this flag, refused on protected targets, with a human confirmation.CDP_DRY_RUN — interactions log their intent and return without dispatching.evaluate and navigate also prompt a human via MCP elicitation.127.0.0.1 unless CDP_ALLOW_REMOTE=true.Optional AI risk guard. Set CDP_GUARD_MODE=monitor|enforce to have the evaluate tool consult a local laya-guard daemon (pipx install laya-guard && laya-guard) that classifies the JS expression allow/confirm/block before it runs. It runs after the eval gate and can only tighten, never grant; fails closed.
There is a bundled skill, cdp-safe-operations, that teaches an agent how to expose a port, read the DOM/console/network instead of screenshots, the safety rules, and the "why did this fail?" workflow. See also SECURITY.md.
MIT
来源:README.md,提交 a533f1b
List targets
List the debuggable targets on the DevTools endpoint — pages, webviews and Electron windows — with their id, type, title and URL. Start here to find the target id every other tool needs.
无需输入参数。
DOM snapshot
Return the rendered HTML of a target — the whole document, or just the subtree of the first element matching a CSS selector. This is the DOM the agent should read instead of a screenshot: it carries far more information and is exact.
selectortarget_id必填Query DOM
Return the outer HTML of every element matching a CSS selector (capped). Use to locate the exact elements to click or type into, and to confirm what is actually on the page.
limitselector必填target_id必填Console logs
Return recent console output and uncaught exceptions captured from the target since it was first inspected. The fastest way to see why something failed — errors that never appear on screen.
limittarget_id必填Network requests
Return recent network requests captured from the target — method, URL, status, MIME type, failures. Headers are never captured and sensitive URL query values are redacted.
limittarget_id必填url_filterScreenshot
Capture a PNG screenshot of the target's viewport. Prefer dom_snapshot for reading content; use this for visual layout, rendering and image checks.
target_id必填已满足适用检查项的 90%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
npx -y @dockndevai/mcp-cdp{ "mcpServers": { "cdp": { "command": "npx", "args": ["-y", "@dockndevai/mcp-cdp"], "env": { "CDP_PORT": "9222", "CDP_MODE": "read-only" } } }}npm installnpm run build# list the tools:echo '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}' | CDP_PORT=9222 node dist/index.jsnpm test