프로토타입 · 미리 보기: 공식 레지스트리의 모든 서버를 담고 있으며 30분마다 동기화해요. Google로 로그인하면 리뷰를 쓸 수 있어요.프로토타입 · 30분마다 업데이트
PopNx MCPAI를 쓰는 사람을 위한 MCP 서버 · 쉬운 말로 설명해요

Chrome Debugger MCP

제작자: BitePro버전 1.0.4i★ 1i내 컴퓨터에서 실행
레지스트리 이름io.github.BitePro/chrome-debugger-mcp

설치 방법

What it does

Chrome breakpoint debugging MCP server for inspecting runtime values and stepping through code

  • Connects 내 컴퓨터에서 실행
  • Account or key No key needed
  • Category 웹 및 브라우저

설치

쓰고 있는 AI 앱을 고른 다음 설정을 복사하세요.

검사 2/3 통과 · 내 컴퓨터에서 실행돼요 · ✓ 명령 확인 2026년 11월 13일

먼저: 어떤 AI를 쓰시나요?

쓰는 앱을 고르면 아래에 단계가 나옵니다.

Claude에 연결할 수 있지만 먼저 준비가 필요해요

먼저 컴퓨터에 Node.js를 설치하세요 (한 번만) · 컴퓨터용 Claude 앱(Windows 또는 Mac)에서만 되고 웹이나 모바일은 안 돼요

  1. Node.js 설치

    한 번만 하면 Node.js가 필요한 모든 서버에 쓸 수 있어요

    Node.js 다운로드 페이지 열기 ↗

  2. 컴퓨터용 Claude 앱 설정 파일 열기

    SettingsDeveloperEdit Config

  3. 이 설정을 붙여 넣고 저장

    {
      "mcpServers": {
        "chrome-debugger": {
          "command": "npx",
          "args": [
            "-y",
            "chrome-debugger-mcp"
          ]
        }
      }
    }
  4. Claude를 끄고 다시 열기

  5. 해 보기

    Chrome Debugger MCP을 써서 나에게 무엇을 해 줄 수 있는지 알려 주고, 하나 해 봐

    ✓ Claude가 Chrome Debugger MCP을 쓰고 있다고 하거나 답에 Chrome Debugger MCP 도구 이름이 나오면 연결된 거예요

메뉴 이름은 2026년 11월 11일에 Anthropic 도움말에서 확인 · 앱 버전에 따라 화면이 조금 다를 수 있어요

ChatGPT는 아직 Chrome Debugger MCP에 연결할 수 없어요

Chrome Debugger MCP는 내 컴퓨터에 설치해서 쓰지만 ChatGPT는 웹에서 도는 서버만 연결할 수 있어요

대신 이렇게 할 수 있어요

A · Chrome Debugger MCP에 연결되는 앱 쓰기

  • 먼저 컴퓨터에 Node.js를 설치하세요 (한 번만) · 컴퓨터용 Claude 앱(Windows 또는 Mac)에서만 되고 웹이나 모바일은 안 돼요
  • 먼저 컴퓨터에 Node.js를 설치하세요 (한 번만)
  • 먼저 컴퓨터에 Node.js를 설치하세요 (한 번만)
  • 먼저 컴퓨터에 Node.js를 설치하세요 (한 번만)

B · 웹 및 브라우저에서 ChatGPT에 연결되는 다른 서버

같은 분류에서 많이 쓰는 것 중 키 없이 주소만으로 연결되는 것을 골랐어요

Claude Code에 연결할 수 있지만 먼저 준비가 필요해요

먼저 컴퓨터에 Node.js를 설치하세요 (한 번만)

  1. Node.js 설치

    한 번만 하면 Node.js가 필요한 모든 서버에 쓸 수 있어요

    Node.js 다운로드 페이지 열기 ↗

  2. 터미널 열기

    Mac: Command+스페이스를 누르고 Terminal 입력 · Windows: PowerShell 열기

  3. 이 명령을 붙여 넣고 Enter

    claude mcp add --scope user chrome-debugger -- npx -y chrome-debugger-mcp
  4. Claude Code에서 /mcp 입력

    Chrome Debugger MCP이 목록에 있고 연결됨으로 보이면 돼요

  5. 해 보기

    Chrome Debugger MCP을 써서 나에게 무엇을 해 줄 수 있는지 알려 주고, 하나 해 봐

    ✓ Claude Code가 Chrome Debugger MCP을 쓰고 있다고 하거나 답에 Chrome Debugger MCP 도구 이름이 나오면 연결된 거예요

메뉴 이름은 2026년 11월 11일에 Anthropic 도움말에서 확인 · 앱 버전에 따라 화면이 조금 다를 수 있어요

Cursor에 연결할 수 있지만 먼저 준비가 필요해요

먼저 컴퓨터에 Node.js를 설치하세요 (한 번만)

  1. Node.js 설치

    한 번만 하면 Node.js가 필요한 모든 서버에 쓸 수 있어요

    Node.js 다운로드 페이지 열기 ↗

  2. 이 버튼으로 Cursor 열기

    Cursor에서 열기

    Cursor가 설치를 확인하면 Install을 누르세요

  3. Cursor에서 AI 채팅을 Agent 모드로 열기

  4. 해 보기

    Chrome Debugger MCP을 써서 나에게 무엇을 해 줄 수 있는지 알려 주고, 하나 해 봐

    ✓ Cursor가 Chrome Debugger MCP을 쓰고 있다고 하거나 답에 Chrome Debugger MCP 도구 이름이 나오면 연결된 거예요

메뉴 이름은 2026년 11월 11일에 Cursor 도움말에서 확인 · 앱 버전에 따라 화면이 조금 다를 수 있어요

VS Code에 연결할 수 있지만 먼저 준비가 필요해요

먼저 컴퓨터에 Node.js를 설치하세요 (한 번만)

  1. Node.js 설치

    한 번만 하면 Node.js가 필요한 모든 서버에 쓸 수 있어요

    Node.js 다운로드 페이지 열기 ↗

  2. 이 버튼으로 VS Code 열기

    VS Code에서 열기

    VS Code가 설치를 확인하면 Install을 누르세요

  3. VS Code에서 AI 채팅을 Agent 모드로 열기

  4. 해 보기

    Chrome Debugger MCP을 써서 나에게 무엇을 해 줄 수 있는지 알려 주고, 하나 해 봐

    ✓ VS Code가 Chrome Debugger MCP을 쓰고 있다고 하거나 답에 Chrome Debugger MCP 도구 이름이 나오면 연결된 거예요

메뉴 이름은 2026년 11월 11일에 VS Code 도움말에서 확인 · 앱 버전에 따라 화면이 조금 다를 수 있어요

Windsurf, Zed, Gemini CLI 같은 다른 MCP 앱은 추가 방법이 저마다 달라요. 앱 목록에서 확인하세요

MCP를 쓰는 앱 모두 보기 →

JSON 설정은 아래 “개발자용”에 있어요

막혔나요? Chrome Debugger MCP을 쓰는 사람에게 물어보세요💬 토론 →
개발자용: 터미널 명령과 JSON 설정

컴퓨터에 설치

Claude Code

claude mcp add --scope user chrome-debugger -- npx -y chrome-debugger-mcp

Claude Desktop (claude_desktop_config.json)

{
  "mcpServers": {
    "chrome-debugger": {
      "command": "npx",
      "args": [
        "-y",
        "chrome-debugger-mcp"
      ]
    }
  }
}

Cursor (~/.cursor/mcp.json)

{
  "mcpServers": {
    "chrome-debugger": {
      "command": "npx",
      "args": [
        "-y",
        "chrome-debugger-mcp"
      ]
    }
  }
}

VS Code (mcp.json)

{
  "servers": {
    "chrome-debugger": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "chrome-debugger-mcp"
      ]
    }
  }
}

이 설정은 제작자의 레지스트리 정보로 만들었어요. README와 다르면 README를 따르세요.

한눈에 보기

주간 다운로드i
53/주
연결 방식
내 컴퓨터에서 실행
최신 버전i
1.0.4
레지스트리 공개i
2026년 3월 16일
코드 마지막 변경i
2026년 3월 15일
제작자
BitePro
패키지
npm: chrome-debugger-mcp
레지스트리 상태
활성

어떤 앱에서 쓸 수 있나요

이 서버의 연결 방식과 각 앱의 공식 문서를 바탕으로 했어요. 2026년 11월 10일 확인.

내 컴퓨터에서 실행하는 앱

ClaudeGooseLM StudioMsty StudioCherry StudioCursorVS Code + GitHub CopilotVisual StudioWindsurf (Devin Desktop)ZedKiroClineContinueJetBrains AI AssistantClaude CodeCodex CLIGemini CLIOpenCodenodecodeWarpLibreChatRaycast

모든 앱과 장단점 →

할 수 있는 일

내 컴퓨터에서 실행돼요. 설치하면 AI 앱에 도구 목록이 나타나요.

기본 점검i

누구나 볼 수 있는 정보를 점검했고, 코드는 읽지 않았어요. 해당하지 않는 항목은 개수에서 뺐어요. · 2026년 11월 14일 점검

  • ✓ 통과

    제작자와 저장소 일치

    레지스트리 이름이 GitHub 계정 BitePro 기준으로 확인되었고, 이 계정이 저장소를 소유하고 있어요

  • ! 주의

    계속 관리되고 있음

    코드 마지막 변경: 8개월 전, 6개월 넘게 지났어요

  • ✓ 통과

    라이선스 있음

    MIT 사용

  • – 해당 없음

    엔드포인트 응답

    내 컴퓨터에서 실행되는 서버라 인터넷 엔드포인트가 없어요

  • – 해당 없음

    OAuth로 로그인

    내 컴퓨터에서 실행되며, 대신 로컬 설정을 사용해요

  • … 아직 점검 안 함

    도구 설명에 숨겨진 지시 없음

    내 컴퓨터에서 실행돼요. 도구 목록은 인터넷 엔드포인트가 있는 서버에서만 읽을 수 있어요

토론

질문하고, 팁을 나누고, 안 되는 점을 알려 주세요. "도움이 됨"이 많은 순서예요.

아직 글이 없어요. 처음으로 질문하거나 공유해 보세요.

이곳의 글은 사용자가 쓴 것으로, PopNx 팀의 글이 아니에요.

Google로 로그인하고 글쓰기

사용자 리뷰

아직 리뷰가 없어요

Google로 로그인하고 리뷰 쓰기

웹 및 브라우저 카테고리의 다른 서버와 비교i

  • 이 카테고리의 다른 서버 1509개 중 78%보다 스타가 많아요
  • 이 카테고리의 다른 서버 1509개 중 3%보다 최근에 레지스트리에 공개됐어요
  • 기본 점검 결과가 이 카테고리의 다른 서버 1509개 중 52%와 같거나 더 좋아요

레지스트리에서 이 카테고리의 활성 서버 전체와 비교했어요. 스타는 게시자가 저장소를 소유한 경우에만 세요.

자주 묻는 질문

Chrome Debugger MCP, 안전한가요?

해당하는 기본 점검 3개 중 2개를 통과했어요. 코드는 읽지 않았어요. 키나 토큰을 넣기 전에 서버가 어떤 권한을 요구하는지 확인하고, 꼭 필요한 권한만 있는 키를 쓰세요.

어떤 키나 코드가 필요한가요?

레지스트리에 필수 키가 나와 있지 않아요. 다만 처음 쓸 때 로그인을 요구하는 서버도 있어요.

내 컴퓨터에서 실행되나요, 클라우드에서 실행되나요?

내 컴퓨터에서 실행돼요. AI 앱이 필요할 때 실행하고, 데이터는 제작자의 서버를 거치지 않아요(서버 자체가 온라인 서비스를 호출하는 경우는 제외).

아직 관리되고 있나요?

GitHub 저장소는 마지막으로 8개월 전 변경됐고, 최신 버전(1.0.4)은 8개월 전 레지스트리에 올라왔어요.

어떤 앱에서 쓸 수 있나요?

Claude Desktop, Claude Code, Cursor, VS Code처럼 MCP를 지원하는 앱에서 쓸 수 있어요. 내 컴퓨터에 Node.js도 있어야 해요.

대신 쓸 수 있는 건 뭐가 있나요?

같은 카테고리에는: Browser Use, Scrapling MCP Server, Chrome DevTools MCP

같은 카테고리의 다른 것

같은 카테고리에서 다른 제작자가 만든 서버예요. 스타 순으로 정렬했어요.

카드 보는 법:↓ 주간 다운로드i★ GitHub 스타i세 기둥: 리뷰 · 점검 · 사용 정도i업데이트 = 최신 버전을 레지스트리에 공개한 날i

Browser Use

Browser agents and stealth cloud browsers for AI: run web tasks, fill forms, extract data.

제작자: browser-use널리 사용됨↓ 167.3만/주★ 12.1만24일 전 업데이트

컴퓨터 또는 클라우드✓ 서비스 회사 · browser-use.com

Scrapling MCP Server

Web scraping with stealth HTTP, real browsers, and Cloudflare bypass. CSS selectors supported.

제작자: D4Vinci널리 사용됨↓ 39.7만/주★ 10.2만9일 전 업데이트

내 컴퓨터에서 실행

Chrome DevTools MCP

MCP server for Chrome DevTools

제작자: ChromeDevTools널리 사용됨↓ 186.9만/주★ 5.5만3일 전 업데이트

내 컴퓨터에서 실행

제작자의 README

README 열기

제작자의 저장소에서 쓰인 그대로 가져왔어요. PopNx MCP가 검토하거나 보증한 내용이 아니에요. HTML, 이미지, 스크립트는 제거했어요. 링크를 누르면 이 사이트를 벗어나요.

chrome-debugger-mcp

English | 中文

English

An MCP server for breakpoint-driven Chrome debugging.

chrome-debugger-mcp exposes Chrome DevTools Protocol primitives as MCP tools so an AI agent can attach to a real Chrome tab, pause execution, inspect scope values, evaluate expressions inside the current call frame, and step through code with runtime facts instead of guessing from static source.

It is not a general browser automation server. The focus is runtime debugging.

Core Capabilities
  • Attach to a real Chrome tab over CDP after explicit user confirmation
  • Pause at breakpoints or debugger; statements and wait for the exact pause you expect
  • Read local, closure, and module scope values from the paused frame
  • Evaluate JavaScript in the current call frame and step execution forward
  • Resume cleanly so the agent can continue with actual runtime values
Demo

*Demo: the agent launches Chrome, waits for a breakpoint, inspects real scope variables, and resumes with runtime facts instead of guessing.*

MCP Client Configuration
Use the published package
{

"mcpServers": { "chrome-debugger": { "command": "npx", "args": ["-y", "chrome-debugger-mcp"] } } }

Installation
From npm
npx -y chrome-debugger-mcp

Or install it globally:

npm install -g chrome-debugger-mcp
From source
pnpm install

pnpm build node dist/index.js

Other Highlights
  • Launch a dedicated Chrome instance with remote debugging enabled
  • Set and remove DevTools breakpoints without editing source code
  • Reload the page through CDP so breakpoints reliably bind after navigation
  • Poll debugger state when the MCP client has short request timeouts
  • Emit _ui payloads and logging messages that clients can surface to the user
Why It Helps

Many browser-focused MCP tools are strong at DOM interaction and network inspection, but weak at runtime debugging. This server gives an MCP client the missing loop you would normally use in Chrome DevTools: attach to the right tab, pause at the right time, inspect real values, step if needed, and resume cleanly.

It also adds guardrails that prevent common agent mistakes:

  • guessing which tab to attach to
  • concluding behavior without inspecting runtime values
  • ending the turn between reloadPage() and waitForSpecificPause()
Requirements
  • Google Chrome installed locally
  • An MCP client that supports stdio servers and tool calling
  • Access to the application you want to debug
  • Local source access if you plan to insert temporary debugger; statements
Tooling Model

The server runs over stdio and exposes MCP tools. The most important tools are:

  • startDebuggingSession: returns the recommended debugging workflow and critical rules for agent behavior
  • launchChrome: launches a dedicated Chrome instance with remote debugging enabled
  • listTargets: lists available Chrome tabs and requires the user to pick one
  • connect: attaches to the confirmed tab
  • setBreakpoint: creates a CDP breakpoint without modifying source files
  • removeBreakpoint: removes a breakpoint created by setBreakpoint
  • reloadPage: reloads the current page through CDP
  • waitForSpecificPause: waits for the next pause and checks whether it matches a target file and line
  • waitForPause: waits for any pause without location matching
  • getScopeVariables: reads local, closure, and module scope values from the paused frame
  • evaluate: executes JavaScript in the paused call frame
  • stepInto, stepOver, stepOut: standard execution control
  • resume: resumes execution after inspection
  • getStatus: non-blocking polling for connected or paused state
  • forcePause: requests a pause at the next JavaScript statement
Recommended Workflow

For AI clients, the intended flow is:

  1. Call startDebuggingSession().
  2. Call launchChrome() or use an already-running Chrome instance with a CDP port.
  3. Call listTargets() and show the full tab list to the user.
  4. Wait for the user to confirm the exact page URL.
  5. Call connect({ targetUrl }).
  6. Insert a temporary debugger; statement in local source code, or call setBreakpoint().
  7. Call reloadPage().
  8. Immediately call waitForSpecificPause() in the same turn.
  9. Call getScopeVariables() and evaluate() to inspect runtime values.
  10. Step if necessary with stepInto(), stepOver(), or stepOut().
  11. Call resume().
  12. Remove any temporary debugger; statements from source code.
Important Rules For Agent Authors

This server is designed for tool-using agents, not only for humans. If you are integrating it into an MCP client, keep these rules:

  • Never skip listTargets().
  • Never guess the target URL, even if only one tab is open.
  • Always wait for explicit user confirmation before connect().
  • After reloadPage(), immediately call waitForSpecificPause() or waitForPause() in the same turn.
  • Do not explain behavior from static code when runtime values can be inspected directly.
  • Always resume() after inspection.
  • If you added temporary debugger; statements to source code, remove them before finishing.
How waitForSpecificPause Matches

waitForSpecificPause is the preferred waiting primitive because it is more reliable than waiting for an arbitrary pause.

It matches a pause using two strategies:

  1. URL fragment plus line tolerance
  2. URL fragment plus debugger-statement pause reason

The second path matters when source maps, transpilation, or bundling shift compiled line numbers away from editor line numbers.

Example Tool Sequence

An agent debugging a local Vite app might do something like this:

  1. launchChrome({ dryRun: true })
  2. launchChrome()
  3. listTargets()
  4. Wait for the user to confirm http://127.0.0.1:5173
  5. connect({ targetUrl: "127.0.0.1:5173" })
  6. Insert debugger; in App.jsx
  7. reloadPage()
  8. waitForSpecificPause({ urlFragment: "App.jsx", line: 62, actionHint: "click the Refetch payloads button" })
  9. getScopeVariables()
  10. evaluate({ expression: "payload.modules" })
  11. resume()
Chrome Launch Behavior

launchChrome() uses a dedicated profile so it does not interfere with the user's normal browser session.

Defaults:

  • remote debugging port: 9222
  • profile directory: ~/.chrome-debug-profile

Expected Chrome binary locations:

  • macOS: /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
  • Linux: google-chrome
  • Windows: C:\Program Files\Google\Chrome\Application\chrome.exe

If automatic launch fails, the tool returns a command the user can run manually.

Local Playground

This repository includes a disposable test app under test/ so you can exercise the debugger server against a realistic browser workflow.

Start the mock service
cd test/service

node src/server.js

The service listens on http://127.0.0.1:3030.

Start the web app
cd test/web

pnpm install pnpm dev

The web app runs on http://127.0.0.1:5173.

Useful places to pause:

  • test/web/src/App.jsx inside loadWorkbench
  • test/web/src/App.jsx inside loadModuleDetail
  • test/web/src/App.jsx around the unfinished detail sections

Runtime payload areas worth inspecting:

  • summaryCards
  • modules
  • apiContracts
  • nextActions
  • responseShape
Troubleshooting
No targets found

Make sure Chrome is running with --remote-debugging-port=9222 and the target page is open.

More than one tab matches targetUrl

Pass a more specific substring so the match becomes unique.

waitForPause or waitForSpecificPause times out

This can happen when:

  • the page action was never triggered
  • the wrong breakpoint was set
  • the MCP client itself has a shorter request timeout than the tool call

If your client times out quickly, use getStatus() to poll or increase the client timeout.

The paused line number does not match the editor line

Bundlers and transpilers can shift compiled line numbers. Use waitForSpecificPause() and rely on URL fragment matching plus debugger-statement semantics.

Chrome does not launch automatically

The machine may use a non-default Chrome install path. Run the returned launch command manually or adjust the implementation to match your environment.

Development
pnpm install

pnpm build node dist/index.js

The implementation lives in:

License

MIT

中文

一个面向 Chrome 断点调试的 MCP Server。

chrome-debugger-mcp 把 Chrome DevTools Protocol 的核心调试能力暴露为 MCP 工具,让 AI agent 可以连接真实的 Chrome 标签页,在运行时暂停执行、读取作用域变量、在当前调用帧中执行表达式、单步跟踪代码,并基于真实值继续任务,而不是只靠静态源码猜测行为。

它不是通用浏览器自动化工具。它的重点是运行时调试。

核心能力
  • 在用户明确确认后,通过 CDP 连接真实的 Chrome 标签页
  • 在断点或 debugger; 命中时暂停,并等待指定文件和行附近的 pause
  • 读取当前暂停帧中的 local、closure、module 作用域变量
  • 在当前调用帧里执行 JavaScript,并继续单步跟踪
  • 检查完成后恢复执行,让 agent 基于真实运行时值继续工作
功能演示

*演示流程:agent 拉起 Chrome,等待断点命中,读取真实作用域变量,再基于运行时事实继续执行,而不是靠猜测推进。*

MCP 客户端配置
使用已发布包
{

"mcpServers": { "chrome-debugger": { "command": "npx", "args": ["-y", "chrome-debugger-mcp"] } } }

安装方式
从 npm 使用
npx -y chrome-debugger-mcp

也可以全局安装:

npm install -g chrome-debugger-mcp
从源码运行
pnpm install

pnpm build node dist/index.js

其他特点
  • 启动带远程调试端口的独立 Chrome 实例
  • 无需修改源码即可设置和移除断点
  • 通过 CDP 重载页面,确保跳转后断点可靠绑定
  • 当 MCP 客户端请求超时较短时,可轮询调试器状态
  • 输出 _ui 结果和 logging 消息,方便客户端展示给用户
为什么适合这个场景

很多浏览器方向的 MCP 工具更擅长 DOM 操作和网络请求观察,但不擅长回答运行时调试问题。这个服务补上的是 Chrome DevTools 里最关键的那条链路:连接正确标签页、在正确时机暂停、读取真实值、必要时单步跟踪、最后恢复执行。

它也内置了几条 guardrails,避免 agent 出现这些常见错误:

  • 猜测应该连接哪个标签页
  • 没看运行时值就直接下结论
  • 在 reloadPage() 和 waitForSpecificPause() 之间错误地结束当前轮次
运行要求
  • 本机安装了 Google Chrome
  • 使用支持 stdio MCP server 和工具调用的 MCP 客户端
  • 可以访问你要调试的应用
  • 如果要插入临时 debugger;,需要能访问本地源码
工具模型

这个服务通过 stdio 运行,并暴露一组 MCP tools。最核心的工具有:

  • startDebuggingSession:返回推荐调试流程和 agent 行为约束
  • launchChrome:启动带远程调试能力的独立 Chrome 实例
  • listTargets:列出可调试标签页,并要求用户做选择
  • connect:连接到已确认的目标标签页
  • setBreakpoint:在不改源码的情况下通过 CDP 设置断点
  • removeBreakpoint:移除通过 setBreakpoint 创建的断点
  • reloadPage:通过 CDP 重载当前页面
  • waitForSpecificPause:等待下一次暂停,并判断是否命中目标文件和行
  • waitForPause:不做位置匹配,等待任意暂停
  • getScopeVariables:读取当前暂停帧中的局部、闭包、模块作用域变量
  • evaluate:在暂停调用帧中执行 JavaScript
  • stepInto、stepOver、stepOut:标准单步控制
  • resume:检查完毕后恢复执行
  • getStatus:非阻塞方式查询是否已连接、是否已暂停
  • forcePause:请求在下一条 JavaScript 语句处暂停
推荐工作流

对于 AI 客户端,建议流程是:

  1. 调用 startDebuggingSession()。
  2. 调用 launchChrome(),或直接复用已经开启 CDP 端口的 Chrome。
  3. 调用 listTargets(),并把完整标签页列表展示给用户。
  4. 等待用户明确确认要调试的页面 URL。
  5. 调用 connect({ targetUrl })。
  6. 在本地源码插入临时 debugger;,或者调用 setBreakpoint()。
  7. 调用 reloadPage()。
  8. 在同一轮里立刻调用 waitForSpecificPause()。
  9. 调用 getScopeVariables() 和 evaluate() 检查运行时值。
  10. 必要时使用 stepInto()、stepOver()、stepOut() 继续跟踪。
  11. 调用 resume()。
  12. 删除源码里临时加入的 debugger;。
给 Agent 作者的重要规则

这个服务首先是为会调用工具的 agent 设计的,而不仅仅是给人手动点工具用。如果你要把它接入自己的 MCP 客户端,建议遵守这些规则:

  • 不要跳过 listTargets()。
  • 即使只看到一个标签页,也不要猜测目标 URL。
  • 一定要等用户明确确认后再调用 connect()。
  • 调用 reloadPage() 后,必须在同一轮里立刻调用 waitForSpecificPause() 或 waitForPause()。
  • 能读取运行时值时,不要只根据静态代码解释行为。
  • 检查完之后一定要 resume()。
  • 如果向源码里插入了临时 debugger;,结束前要清理掉。
waitForSpecificPause 如何匹配

waitForSpecificPause 是首选的等待工具,因为它比“等待任意暂停”更可靠。

它有两层匹配策略:

  1. URL 片段加行号容差
  2. URL 片段加 debugger-statement 暂停原因

第二层匹配对经过 source map、转译、打包后的代码尤其重要,因为编译后的行号可能和编辑器行号不完全一致。

调用序列示例

앞부분만 보여 드려요. 나머지는 저장소에서 읽어 보세요