devharness 标志

devharness

社区
InDate

MCP server that connects AI assistants to Chrome DevTools Protocol for runtime debugging - set breakpoints, inspect variables, monitor network traffic, and automate browser interactions

发布者InDate
代码仓库devharness
语言TypeScript
复刻数
5
星标数
16
可用工具
36
传输类型stdio
分类
许可协议MIT
链接
  • 将工具接入 AI 工作流

    devharness 提供 MCP 功能,可供兼容的 AI 客户端和智能体使用。

  • 36 个可用工具

    浏览下方可调用的操作;如果服务器提供了名称和描述,也会一并显示。

  • 可直接复制的配置

    使用安装配置片段,在您首选的 MCP 客户端中配置此服务器。

  • 开源社区热度

    关联的代码仓库有 16 个 Star 和 5 个 Fork。

devharness

npm version license

MCP server. Your agent runs the app, sees what happened, and redoes none of it by hand.

bash
npx devharness@latest

Was cdp-tools-mcp. That name described the transport. CDP is now one of three things this does. Migrating.

Why

Three things burn a debugging session, and only the first is about seeing.

You are the eyes. You start the app, click the thing, paste the stack trace back into chat, reload and report whether it worked.

Everything gets re-driven by hand. Relaunch the browser, log in again, refill the form, click back to the screen where the bug lives — every iteration. Slow, and the retyped arguments drift from what actually ran.

One failure stalls the whole session. A dead dev server, a missing parameter, a wedged tool: the agent stops and waits for you.

devharness closes all three. Real execution instead of guesses. Every call it has already made is replayable by index. Failures have recovery paths the agent takes itself.

What it does

24 tool modules. 802 tests across 57 files, ~7s.

See — pause real execution and read the real frame: breakpoints (line, conditional, logpoint, DOM mutation, event, XHR), call stack and scope, source maps so TypeScript breakpoints hit TypeScript lines. Chrome and Node.js (node --inspect), both at once. Console, network, storage, DOM. content verify reports dead buttons, dead links, small touch targets, and overflow clipping from CDP facts, not heuristics.

Repeat — every tool response carries its own history index:

**Repeat:** replay({ action: 'repeat', indices: [58] })

indices takes a list, so four steps re-run in one call. Whatever the agent already did, it redoes by reference rather than by retyping. Worth keeping? replay({ action: 'create', ... }) promotes it to a named sequence, exportable as a Playwright or Puppeteer test.

Recover — a call that fails validation comes back with a continuationToken and the list of what was missing; the retry sends only the missing field. A validated call blocked by a guard is already recorded, so acknowledging the block and replaying resumes the exact call. If the server itself wedges, config({ action: 'restart' }) respawns it and replays the MCP handshake, so the host session never reconnects.

Prove — dev servers run under management (npm, flask, docker, compose) with port monitoring. Issues bind a bug to its reproduction: workOn navigates back to the failing state, resolve replays the sequence against the fix.

Design decisions

  • A dead server blocks tools rather than warning. An agent clicking away at a dead server produces a long, confident, entirely fictional debugging session. Configurable: inform, error, block.
  • Closing an issue needs a human click. resolve waits on a browser overlay no agent can dismiss. Recording findings is automated; declaring something actually fixed stays a human judgement.
  • Repeat is on every response, not just failures. Recovery and ordinary re-running are the same mechanism, so there's nothing extra to reach for when the session gets long.
  • getVariables degrades, never errors. full → reduced depth → names → counts. A truncated answer that says it truncated beats a tool error.
  • Connections are named. Every tool takes connectionReason, so nested agents each drive their own tab in one Chrome without fighting over "the current page".
  • Text beats screenshots. extractText costs a fraction of an image and answers most page questions. Screenshot when the question is genuinely visual.

Setup

Claude Code:

bash
claude mcp add devharness -- npx devharness@latest

Claude Desktop:

json
{
  "mcpServers": {
    "devharness": {
      "command": "npx",
      "args": ["-y", "devharness@latest"]
    }
  }
}

Other clients — npx devharness@latest over stdio.

As a Claude Code plugin — this registers the server for you:

/plugin marketplace add InDate/indate-tools
/plugin install devharness@indate-tools

The plugin pins an exact server version rather than tracking @latest, so what you installed is what runs until you update it.

Skill

Bundled Agent Skill at plugin/skills/devharness/. Same guidance as docs/instructions.md, split for progressive disclosure: name and description at session start, full catalogue only when debugging starts.

bash
mkdir -p .claude/skills
ln -s ../../node_modules/devharness/plugin/skills/devharness .claude/skills/devharness

Installing as a Claude Code plugin does this for you.

Example

Node service:

1. node --inspect=9229 app.js
2. connectDebugger({ reference: "api", port: 9229 })
3. breakpoint({ action: 'set', connectionReason: "api", file: "user.ts", line: 42 })
4. Trigger the request.
5. inspect({ action: 'getVariables', connectionReason: "api" })
   → real frame: what userId and userRole actually were

Browser fix:

1. launchChrome({ reference: "app" })   # launches and connects
2. Record the five clicks that reproduce it.
3. Fix the code.
4. Replay → pass or fail, against the real app

docs/GUIDE.md for depth, docs/instructions.md for the tool reference. examples/test-app ships eight seeded bugs to exercise it against known-wrong code.

Command line

devharness <command>, run from a shell inside an editor session, executes the tool in that session's own server process - against the browser and dev servers it already has open. Only sessions rooted at the shell's directory or above it are candidates, because issues, config and sequences resolve against the answering server's root; process ancestry picks among those. Nothing needs to be passed in.

sh
devharness which                                  # which session this shell belongs to
devharness call config '{"action":"status"}'      # any tool, arguments as one JSON object
devharness sessions                               # who else is reachable
devharness send a1b2c3d4 "check this" --wait=60000
devharness bug "Title" Body words here            # files an issue; feature does the same

--session=<id> targets a session explicitly, --json prints the unrendered response, and the exit code is 1 when the tool returns an error. Each session listens on a unix socket under ~/.devharness/endpoints/, mode 0600 - not a TCP port, because the tools reachable through it evaluate JavaScript in that session's browser.

devharness run <sequenceName> is separate: it starts its own headless Chrome and replays a saved sequence, with no session involved.

vs Chrome DevTools MCP

Chrome DevTools MCP is better at performance tracing, device emulation, advanced browser automation.

devharness adds breakpoint debugging with variable inspection, Node.js targets, simultaneous connections, logpoints, server lifecycle, and — the part that compounds over a long session — replayable call history and self-service recovery.

Browser-only and performance-shaped → theirs. Backend code, stepping execution, long sessions where the agent keeps re-driving the same setup → this.

Migrating

cdp-tools-mcp is deprecated on npm and points here. Tools unchanged. Package, repo, and skill renamed.

diff
-"args": ["-y", "cdp-tools-mcp@latest"]
+"args": ["-y", "devharness@latest"]

Your MCP server name (devharness, or whatever you called it) is yours and keeps working. Renaming it is cosmetic — but tools are addressed as mcp__<server-name>__<tool>, so update project docs if you do.

State moved .cdp-tools/ → .devharness/ in 0.9.0. Migrates itself on first run; profiles, config, sequences, and issues carry over. DEVHARNESS_DIR supersedes CDP_TOOLS_DIR, which still works.

From source

bash
git clone https://github.com/InDate/devharness.git
cd devharness
npm install && npm run build && npm test

Contributing

Issues and PRs welcome. Reporting a bug? Attach a recorded reproduction sequence.

License

MIT

安装

TypingMind
{
  "mcpServers": {
    "devharness": {
      "command": "npx",
      "args": [
        "devharness@latest"
      ]
    }
  }
}

可用工具

  • launchChrome

    Launch Chrome with debugging

  • killChrome

    Kill Chrome process

  • resetChromeLauncher

    Reset Chrome launcher

  • getChromeStatus

    Get Chrome status

  • setDebugLogging

    Toggle debug logging

  • getDebugLoggingStatus

    Check debug logging status

  • connectDebugger

    Connect to debugger

  • disconnectDebugger

    Disconnect debugger

  • loadSourceMaps

    Load source maps

  • getDebuggerStatus

    Get debugger status

  • listConnections

    List debugger connections

  • switchConnection

    Switch debugger connection

  • tab

    Manage browser tabs. Actions: list (show all open tabs), create (open new tab with reference), rename (change tab reference), switch (switch active tab), close (close a tab)

  • breakpoint

    Manage breakpoints and logpoints. Actions: set (line breakpoint), remove (remove by ID), list (list all), setLogpoint (log without pausing), validate (test expressions), resetCounter (reset logpoint counter), waitForScript (wait for script load), setDOMBreakpoint (pause when element changes), setEventBreakpoint (pause when event fires), setXHRBreakpoint (pause on network requests), await (set breakpoint and wait for hit - user can abort)

  • execution

    Control execution flow when paused at breakpoints. Actions: pause (pause execution), resume (resume execution), stepOver (step to next line), stepInto (step into function call), stepOut (step out of current function), acknowledge (acknowledge breakpoint pause to allow other tools to run while paused)

  • inspect

    Inspect and debug code. Actions: getCallStack (get call stack when paused), getVariables (get variables in call frame), evaluateExpression (evaluate JavaScript), searchCode (search code by pattern), searchFunctions (find function definitions)

  • getSourceCode

    Get source code at line range

  • console

    Monitor and manage console messages. Actions: list, get, recent, search, clear, setObjectDepth

  • network

    Monitor and manage network requests. Actions: list (list requests with optional type filter and pagination), get (get specific request by ID), search (search requests by regex pattern), enable (enable network monitoring), disable (disable network monitoring), setConditions (set network throttling conditions)

  • navigate

    Navigate and control browser pages. Actions: goto (navigate to URL), reload (reload page), back (navigate back), forward (navigate forward), info (get page information)

  • dom

    Inspect and query the DOM. Actions: querySelector (find element by CSS selector and get basic info), getProperties (get detailed properties of an element), snapshot (get full DOM structure snapshot)

  • screenshot

    Visual verification only. Use extractText for content. Actions: fullPage (full page screenshot), viewport (viewport screenshot), element (element screenshot), pdf (print to PDF with Chrome or WeasyPrint engines)

  • input

    Perform browser input actions. Actions: click (click element), type (type text into element), press (press keyboard key), hover (hover over element), focus (focus element by selector), focusNext (Tab to next focusable element), focusPrevious (Shift+Tab to previous focusable element), drag (drag from one point to another), scroll (scroll wheel at position), mousemove (move mouse to position), pinch (pinch zoom gesture), tap (real touch tap - selector or x/y), swipe (real touch drag - selector + direction, or raw from/to - for touch-only gestures the mouse cannot drive)

  • content

    Primary tool for page content. Prefer over screenshots. Actions: extractText (extract webpage text with outline/full/section modes), findInteractive (find all interactive elements like links, buttons, inputs with summary or filtered view), verify (run CDP-based UI verification for dead buttons, viewport issues, touch targets, overflow clipping), parse (run a page-parser plugin from .cdp-tools/parsers/ against the current page — omit name to list available plugins)

  • detectModals

    Detect modals

  • dismissModal

    Dismiss modal

  • storage

    Access and manage browser storage (cookies, localStorage, sessionStorage, IndexedDB). Cookies: getCookies, setCookie. localStorage: getLocalStorage (omit key to read the whole store), setLocalStorage, removeLocalStorage (delete one key). sessionStorage: getSessionStorage, setSessionStorage, removeSessionStorage - a full peer of localStorage. IndexedDB: idbListDatabases, idbListStores({db}), idbGet({db,store,key}), idbGetAll({db,store,limit}), idbPut({db,store,record,key?}), idbDelete({db,store,key}). IndexedDB reads return values that JSON cannot represent as typed descriptors instead of dropping them - e.g. {__type:"CryptoKey",keyType,algorithm,extractable,usages}, and the same for Blob/File, ArrayBuffer and typed arrays, Map, Set, Date, RegExp and BigInt; cycles come back as {__type:"Circular",path}. That makes a non-extractable key assertable even though its material cannot be read. Very large values are bounded rather than returned whole: an oversized read is marked with {__type:"B

  • saveToDisk

    Download file to disk

  • request

    Make an HTTP request as a sequence step. destination "node" sends it from the MCP server process directly (no browser, no CORS/cookies). destination "browser" runs fetch() inside a connected tab (uses that page's cookies/session/origin).

  • assert

    Assert a condition as a sequence step. Fails the sequence (isError, executor stops) if the condition is false. Two forms: a VALUE check against {{var:name.path}} templates captured by a prior request({saveAs}) or inspect({saveAs}) step; or a DOM check via selector + condition, which polls the page until it holds and reports what it actually found - use that instead of hand-writing a wait loop inside inspect({evaluateExpression}), which invites acting on the page from the same step.

  • wait

    Wait as a sequence step - the primitive for "the previous step kicked off async work". Exactly one of: selector (element appears), selectorGone (element disappears), expression (synchronous JS predicate polls truthy), ms (fixed sleep, last resort). Condition forms poll from the MCP side, so they survive navigations mid-wait and never depend on in-page timers or promises; on timeout the step fails cleanly instead of hanging.

  • replay

    Record and replay command sequences for testing and automation. Actions: repeat (immediately re-execute commands by history index - use this to repeat recent actions), history (view command history), recordInteraction (record real mouse/keyboard/navigation via a browser overlay - BLOCKS until the person finishes, so do not call it unattended; tune the capture with simplifyEvents/includeHovers/preferCoordinates/preferSelectors, and add outputFormat: events|commands|review|playwright|puppeteer to dump the recording - review is a human-readable walkthrough of the captured events), create (create sequence from history indices), list (list in-memory sequences), get (get sequence details; outputFormat: commands|playwright|puppeteer returns the raw command JSON or generated test code), delete (delete from memory), export (write a sequence to disk as sequence/playwright/puppeteer), load (load sequence from disk), listSaved (list saved files), deleteSaved (delete saved file), run (start executi

  • server

    Manage development servers. Actions: start (start a server from npm script; pass watch: true to auto-restart it on file changes instead of --watch/nodemon - coordinates with a paused breakpoint debugger by deferring the restart), stop (stop a running server), restart (restart a server), list (list running servers with status), logs (get log file paths or docker command), stopAll (stop all servers), setAutoRun (enable/disable auto-start on MCP startup), cancelPendingRestart (discard a watch-mode restart that's queued behind a paused debugger, to keep debugging)

  • config

    Manage cdp-tools configuration. Actions: status (show where config is loaded from), useLocal (switch to project-local config), useGlobal (switch to global ~/.cdp-tools config), reset (reset to defaults), backup (create timestamped backup), cloneFromGlobal (copy global config to local), show (display current settings), listTools (list all toggleable tools with their status and dependencies), reload (re-read config.json now; edits also hot-reload automatically within ~250ms), restart (restart cdp-tools itself if stuck or broken), listProfiles (list named persistent Chrome profiles and where they live), resetProfile (wipe and recreate a named persistent Chrome profile, clearing its cookies/localStorage/IndexedDB)

  • issues

    Track and manage bugs and features as Markdown issues (title, Markdown body, labels, comments). Actions: list (show all issues with optional filters), create (create new issue with title/body/labels, optionally linking a sequence), workOn (start working on issue with auto-replay), resolve (HUMAN-ONLY interactive verification: opens a browser overlay and waits for a person to confirm the fix before marking fixed/implemented - agents are refused immediately, use comment instead), acknowledge (acknowledge pending bugs to unblock tools), comment (append a Markdown comment to an issue)

  • dashboard

    Manage the cdp-tools web dashboard. Actions: open (get URL to open in browser), status (show whether this session is hub or client), stop (stop the hub server if this session is the hub)

将 devharness MCP 与多个 AI 模型配合使用

TypingMind 在工作区级别连接 MCP 工具,因此连接 devharness 后,您就可以在 TypingMind 中搭配不同的 AI 模型使用,无需为每个模型单独设置。 此 MCP 通过您设备上的 TypingMind MCP 连接器在本地运行。

本地连接器设置指南

如果 MCP 服务器需要访问您电脑上的本地文件、应用或私有资源,请选择此方式。

1

打开 MCP 设置

在 TypingMind 中,依次前往“设置”、“高级设置”和“模型上下文协议”,然后选择“设置连接器”。

  1. 在您的浏览器中打开 TypingMind。
  2. 点击“设置”图标。
  3. 进入“高级设置”。
  4. 打开“模型上下文协议”部分。
  5. 点击“设置连接器”,然后选择“此设备”。
TypingMind MCP 连接器设置界面,已选择“此设备”
2

运行连接器命令

选择“此设备”,从 TypingMind 复制命令并在终端中运行。使用 MCP 时,请保持该进程运行。

  1. 复制 TypingMind 显示的设置命令。
  2. 在 macOS 上打开“终端”,或在 Windows 上打开 Windows Terminal。
  3. 粘贴并运行命令。
  4. 如果终端询问您是否继续,请确认安装软件包。
  5. 使用 MCP 工具时,请保持终端窗口及其中的进程运行。
3

将 devharness 添加为服务器

当连接器状态为“就绪”时,点击“编辑服务器”,然后粘贴 MCP 服务器配置。

  1. 等待连接器状态显示为“就绪”。
  2. 点击“编辑服务器”。
  3. 粘贴 devharness MCP 服务器配置。
  4. 保存服务器列表。
  5. 如需确认连接器是否仍处于就绪状态,请刷新。
TypingMind MCP 设置界面,显示正在运行的服务器和“编辑服务器”按钮
{
  "mcpServers": {
    "devharness": {
      "command": "npx",
      "args": [
        "-y",
        "devharness"
      ]
    }
  }
}
4

在不同模型中使用同一连接

保存服务器列表,打开“插件”,启用 devharness MCP 工具,然后在 TypingMind 中选择任意受支持的 AI 模型,即可在聊天中使用这些工具,或将其分配给智能体。

  1. 在 TypingMind 中打开“插件”页面。
  2. 启用 devharness MCP 工具。
  3. 开始聊天并选择您想使用的 AI 模型。
  4. 在聊天中使用 MCP 工具,或将其分配给 AI 智能体。
  5. 根据需要随时切换到其他 AI 模型,无需重新连接 MCP。
在 TypingMind 聊天中使用已启用的 MCP 工具和选定的 AI 模型
您能使用 devharness 帮我完成这项任务吗?
devharness
当然。我已阅读。
以下是我使用 devharness 得到的结果。

常见问题

devharness MCP 服务器有什么用途?

devharness 是一个 MCP 服务器,可让兼容的 AI 客户端连接外部工具并获取上下文。在 TypingMind 中,只需添加一次此 MCP 服务器,即可在您的 AI 工作区中使用其工具。

可以在 TypingMind 中让多个 AI 模型使用 devharness MCP 吗?

可以。TypingMind 在工作区层面连接 MCP 工具,因此您可以让 Claude、ChatGPT、Gemini 等不同 AI 模型,或您在 TypingMind 中配置的其他模型使用 devharness,而无需为每个模型单独配置 MCP 服务器。

为什么在 TypingMind 中使用 devharness MCP?

TypingMind 将多个 AI 模型、提示词、插件、AI 智能体、API 密钥和 MCP 工具整合到同一个工作区中,是优秀的大语言模型聊天前端之一。连接 devharness 后,您可以在偏好的不同模型中使用其 MCP 工具,同时在 TypingMind 中井然有序地管理聊天工作流程。

如何将 devharness MCP 连接到 TypingMind?

devharness 通过 TypingMind 本地 MCP 连接器运行。当 MCP 服务器需要访问您计算机上的本地文件、桌面应用、命令行工具或私有资源时,这种方式最合适。

devharness MCP 在 TypingMind 中提供哪些工具?

devharness 提供 36 个 MCP 工具,您可以在 TypingMind 的插件页面启用这些工具,然后在聊天中使用,或将其分配给 AI 智能体。

使用 devharness MCP 需要向 TypingMind 提供我的 API 密钥吗?

不需要。TypingMind 采用本地优先的设计,让您自行掌控模型提供商、API 密钥、提示词和 MCP 配置。如果 devharness 需要身份验证,请在创建连接时,为该 MCP 服务器添加所需的请求头、OAuth 设置或本地配置。

相关 MCP 服务器

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇