
Devcdp
io.github.Dayananda-D由 GitHub 账号 Dayananda-D 发布v5.0.1更新于 Oct 24, 2026
Chrome DevTools for AI assistants: console, network, DOM, source maps, breakpoints, live variables.
概览
本地 MCP 服务器,让 AI 助手获得真实的 Chrome DevTools 能力:控制台、网络、DOM、source map、断点和实时变量。
- 可以做什么
- 读取控制台日志、警告和未捕获异常,含文件、行号和调用栈;监视网络请求的状态、耗时,并按需获取响应体。查询 DOM,获得真实可见性与几何信息、计算样式、变更历史和 iframe 支持。列出已加载脚本以及从 source map 还原的打包前原始文件,并在两者中全文搜索。在原始文件或按函数名设置断点、单步执行,并展开查看暂停时的作用域变量。探测应用的框架、路由、可用选择器和后端 API 范围,并读取用户在交接期间点击、选择或输入的内容。
- 适用场景
- 适合在真实浏览器中调试 Web 应用,让助手找到真正出错的行、请求或变量值,而不是根据粘贴的报错猜测。适用于不依赖特定框架的前端调试、大量使用 source map 的构建,以及同一台机器上的多代理会话。
- 运行要求
- 通过 npx 以 stdio 在本地运行(Node 18+),需要 Chrome 和支持 MCP 的助手。Chrome 须以远程调试方式启动,例如使用独立配置在 9222 端口。可选环境变量 DEVCDP_CHROME_PATH 和 DEVCDP_LOG_LEVEL,设置文件均为可选。仅支持桌面端。
安装
在 SourceWeft 中
- 打开 控制台中的 Devcdp,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
DevCDP
Real Chrome DevTools access for an AI assistant, over MCP. Your assistant reads the console, watches the network, queries the DOM, resolves source maps, sets breakpoints and inspects live variables — so it can tell you why something broke instead of guessing from a pasted error.
Works with any assistant that speaks MCP, and with any web app: nothing about a particular framework, product or company is built in.
74 tools — see docs/TOOLS.md for the full reference, generated from the server itself, and docs/PERFORMANCE.md for measured token costs and how to lower them.
What it does
Four things it is careful about
It never fakes success. A breakpoint that cannot bind says bound: false and
explains why. A body Chrome has discarded says so. A capture from a pause that has
already resumed is marked stale. Every failure is {ok: false, code, message, hint}
with the next action named.
It tells you where its knowledge ends. Chrome cannot replay console history to a debugger that attaches later, so attaching reports exactly that rather than presenting an empty buffer as "no errors".
It cannot be stranded. Every call into the page is bounded on our side —
Runtime.evaluate's own timeout is enforced by the renderer, which is useless when
the renderer is what is stuck. A page wedged in an infinite loop fails in seconds
with the recovery path named, and DevCDP will abort the runaway script and retry by
itself.
It never leaves your app frozen. Breakpoints capture what you need and then
resume on their own. A pause held deliberately is still released after
maxPauseMs, and everything is cleaned up on disconnect.
Install
Requirements: Node 18+, Chrome, and an MCP-capable assistant.
Pick whichever fits your client. All of them run the same server on your machine; nothing is hosted.
Any MCP client, from npm. Add to the client's MCP config:
On native Windows some clients need "command": "cmd", "args": ["/c", "npx", "-y", "devcdp"].
Claude Code, as a plugin (server plus a skill that tells Claude when to reach for which tool):
Cursor: [Install in Cursor],
or add the JSON above to ~/.cursor/mcp.json.
Gemini CLI, as an extension that also carries the usage guidance:
opencode: opencode mcp add, or in opencode.json:
Codex (CLI, desktop, VS Code extension), as a plugin:
VS Code: Install in VS Code, or run MCP: Add Server, choose NPM Package,
and enter devcdp. Copilot CLI: /mcp add with command npx -y devcdp. DevCDP is in
the official MCP Registry; the picker
inside VS Code shows GitHub's curated subset of that registry, which is a separate listing.
From source, with the setup wizard that also writes usage guidance into your assistant's instructions file: see Setup, next.
Then launch Chrome with remote debugging (debug-chrome.bat, or
chrome --remote-debugging-port=9222 --user-data-dir=<a separate profile>), open your
app, and describe the bug.
Setup
The wizard detects installed editors, writes the right config shape for each, and drops a launcher. It never overwrites a config file it cannot parse — it prints the snippet to paste instead — every write is atomic with one timestamped backup, and duplicate registrations from older installs are removed. That path is covered by 23 tests, because getting it wrong damages your machine rather than just failing.
Settings
Everything is optional. Ask the assistant to run devcdp_settings to see the
effective values and where each came from, or devcdp_settings_init to write an
annotated file you can edit.
Files are merged, later winning, so an install-wide baseline can be overridden per project:
then DEVCDP_* environment variables, then tool arguments. Comments and trailing
commas are tolerated.
docsRoot and sharedMemoryDir are the two worth setting: the first lets the
assistant learn your domain vocabulary, the second is what makes "the team's fixes
accumulate" actually true.
Multiple sessions at once
Several agents can debug on one machine safely. Each session claims a tab in a
registry under ~/.devcdp/registry/, taken atomically so two processes cannot win
the same tab. A session that dies stops heartbeating and its claim is reaped, so
nothing stays wedged.
- A new session gets an unclaimed tab; if all are taken it opens its own — on the page you wanted, not blank, and it says why.
- Reloading your assistant briefly overlaps two server processes, so a short grace period lets the departing one release its tab and the new one simply reattaches.
browser: 'new'launches a separate Chrome, own port and profile.window: 'new'gives the session its own browser window.sessions_listshows which session holds which tab.
Knowing which tab is in use
Every claimed tab carries a 1px edge border and a small identity chip. The border tells you who is driving:
- breathing blue glow — DevCDP is working
- still, green — it has handed control to you
- still, red — something failed
Three states, three colours, and each colour means exactly one thing regardless of how many sessions are running. Sessions are told apart by the chip text and by their own Chrome tab group — not by hue, which would turn the border into a puzzle when the only thing worth knowing at a glance is whether the tab is waiting for you.
Tabs the app opens for itself — window.open, target="_blank", a detail screen
in its own window — are marked and held too, labelled "opened tab". devtools_status
lists them under tabsAppOpened, with the call that switches to one.
The indicator cannot outlive the session that drew it. A normal finish — you close
the assistant, it disconnects, the session ends — removes the border immediately. If the
server is killed and never gets to clean up, the overlay notices it has stopped hearing
from its session and removes itself within ownerTimeoutMs (45s), taking the tab out of
its group with it. Either way, a border on screen means a session is genuinely there. For
one left behind by an older build, node scripts/sweep.mjs clears any that no live
session owns (--dry to look first).
Status messages appear as translucent, self-fading toasts. A ring follows pointer activity and a ripple marks each click, so an agent's actions are followable. When the debugger pauses, Chrome's own "Paused in debugger" banner appears — browser UI, adding nothing to your page.
None of it can intercept a click: the whole layer is pointer-events: none except
the confirmation button during a handover, which is 91×24px. There is a test that
fires real mouse events through it.
Real Chrome tab groups are drawn by the bundled extension, which puts each session's
tabs in a titled blue group. Chrome will not let a tool install an extension for you —
branded Google Chrome ignores --load-extension ("not allowed in Google Chrome", from its
own log) and does not expose Extensions.loadUnpacked over the debugging port — so pick
one of:
- No manual step: point
chromePathat Chromium or Chrome for Testing. Those builds allow the switch, so the extension loads itself and grouping just works. If such a binary is already on your machine,devtools_statustells you where it is. - Branded Chrome: install it once —
chrome://extensions→ Developer mode → Load unpacked → selectextension/. The debug profile is persistent and shared bydebug-chrome.batand DevCDP's own launcher, so once is once.
devtools_status.tabGrouping reports whether the tab is actually in a group, and when it
is not, whether that is because no extension is installed or because an installed one
failed — with the error. Nothing else depends on grouping: the border, the chip and
window:'new' all work without it.
Working with the assistant
You do not have to wait to be asked. Click, type, choose — it is recorded, and the
assistant reads it with session_get_user_actions: which element, which option,
and the value you typed.
Ctrl+Shift+D in the tab hands control to you explicitly. That also opens the window in which typed values are captured, so "use this reference" reaches the assistant. Outside that window values stay private, and password-like fields are redacted either way.
When the assistant needs something only you can do, it asks on the page and waits for the I've done it ✓ button. That button is the only unambiguous signal — Chrome reports automation input as trusted too, so an action cannot be proven human, and the tools say so rather than pretending.
A typical investigation
devtools_connect— attaches, claims the tab, marks itsource_search("save")— finds the handler by content, no path neededdebugger_set_breakpoint(file, line)— repliesbound: true- the click is triggered
debugger_get_capture— scope, console and network from the pause, one call- the answer is a value that was actually observed, at a line that actually exists
Breakpoints resume themselves, so the click that tripped one still completes.
When you know the function but not the file — which is the usual case with a framework —
debugger_set_breakpoint_at_function("app.store.save") asks the engine where that
function was defined and breaks at its first statement. Searching for a name in source
text is unreliable: a function assigned as Foo.bar = function cannot be found by
searching "bar: function", and that query happily returns unrelated methods on other
classes instead.
A capture stays small even on a framework object graph: the variable that matters is
printed, and anything too large says what it is ("constructor", 77747 bytes expanded)
so you can read just the part you want with debugger_evaluate_at_frame.
Security
The launcher uses a separate Chrome profile, so your everyday browsing is untouched, and leaves web security enabled — disabling it hides exactly the cross-origin failures you would be debugging.
Typed values are not recorded unless you enable it or are actively collaborating, and password-like fields stay redacted regardless.
Remote debugging gives full control of the browser profile to anything that can reach the port. Use the debug profile for development, not for personal accounts.
Layout
Working on DevCDP
Breakpoints, logs, and the traps this codebase has already fallen into: docs/DEBUGGING.md.
Tests
199 checks. The integration suite attaches to a page that has already finished
loading, because that is the case the previous version got wrong. npm run validate fails if docs/TOOLS.md is out of date, so the reference cannot drift.
Troubleshooting
Tools not appearing — fully quit the assistant (tray/menu, not just the window) and reopen. Re-run the wizard if still missing.
"Chrome is not reachable" — launch via debug-chrome.bat, then check
http://localhost:9222/json/version. Only one Chrome can own a port.
A breakpoint never fires — debugger_list_breakpoints and look at bound. An
unbound breakpoint reports why.
Support the project
DevCDP is free and MIT-licensed, built and maintained by one person. If it saved you a debugging afternoon, sponsoring on GitHub keeps it moving. Teams wanting a hosted setup, shared learned memory across engineers, or an onboarding workshop can open an issue to start the conversation.
Privacy and license
DevCDP runs locally and sends nothing anywhere except to the MCP client you connected it to: PRIVACY.md. MIT licensed: LICENSE.
A selector finds nothing — dom_list_frames; the content may be in an iframe.
Retry with frame: 'all'.
Empty console or network right after attaching — expected. Capture starts at
attach; page_reload replays the page with DevCDP watching.
The page stops responding — its main thread is blocked, usually a loop in app
JS. page_interrupt aborts the running script; reloading will not free it.
A tab is unavailable — sessions_list shows which session holds it.
来源:Readme.md,提交 4898d06
工具
0版本历史
1- v5.0.1最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分