mcp-debugger-node

mcp-debugger-node

MCP server for debugging Node.js programs through the V8 Inspector Protocol, allowing AI agents to set breakpoints, inspect variables, and step through code.

Category
访问服务器

README

mcp-debugger-node

MCP server for debugging Node.js programs through the V8 Inspector Protocol.

This server gives an AI agent debugger-style tools: start a Node process under --inspect-brk, set breakpoints, continue execution, wait for pauses, step, inspect variables, and evaluate expressions in the current call frame.

[!WARNING] This server starts whatever command is provided in the reset target config. Only use it in trusted local development environments. A target config can run arbitrary commands with your user permissions.

Run

This package is meant to be started by an MCP client over stdio:

npx -y mcp-debugger-node

You usually do not run that command by hand. Instead, add it to your agent or editor MCP configuration.

Codex

Add this to ~/.codex/config.toml:

[mcp_servers.node-debugger]
command = "npx"
args = ["-y", "mcp-debugger-node"]

Claude Code

Use the Claude Code MCP CLI:

claude mcp add node-debugger -- npx -y mcp-debugger-node

For a project-local config, run that command from the project you want to configure.

GitHub Copilot in VS Code

Create or update .vscode/mcp.json:

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

Other MCP Clients

Use a stdio server entry with:

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

Quick Start

Start a debug session by calling reset with an explicit target:

{
  "target": {
    "cwd": "/path/to/project",
    "command": "node",
    "args": ["--inspect-brk=0", "server.js"]
  }
}

For a CommonJS TypeScript project using ts-node:

{
  "target": {
    "cwd": "/path/to/project",
    "command": "node",
    "args": ["--inspect-brk=0", "-r", "ts-node/register", "src/index.ts"]
  }
}

For an ESM TypeScript project:

{
  "target": {
    "cwd": "/path/to/project",
    "command": "node",
    "args": ["--inspect-brk=0", "--loader", "ts-node/esm", "src/index.ts"]
  }
}

The target must include --inspect-brk=0. The server reads the inspector URL from the target process stderr and connects to it.

Common Workflow

For simple scripts:

  1. Call reset with a target.
  2. Call set_breakpoint.
  3. Call resume.
  4. Call getvariables or evaluate.
  5. Use stepover or stepinto as needed.

For event-driven servers:

  1. Call reset with a target.
  2. Call set_breakpoint in the endpoint or handler.
  3. Call continue.
  4. Trigger the event with curl, a browser, a test runner, or another tool.
  5. Call wait_for_pause.
  6. Inspect runtime state with getvariables and evaluate.
  7. Call continue again to let the request finish.

Example endpoint debugging flow:

{
  "urlRegex": "server\\.js$",
  "lineNumber": 42
}

Then:

continue
curl http://localhost:3000/api/users
wait_for_pause
evaluate {"expression":"req.url"}
getvariables
continue

Tools

reset

Restart the debug session with a fresh Node inspector process.

Input:

{
  "target": {
    "cwd": "/path/to/project",
    "command": "node",
    "args": ["--inspect-brk=0", "server.js"],
    "env": {
      "NODE_ENV": "development"
    }
  }
}

env is optional and is merged with the MCP server environment.

set_breakpoint

Set a breakpoint by matching a script URL with a regex.

Input:

{
  "urlRegex": "server\\.js$",
  "lineNumber": 10
}

lineNumber is zero-based, matching the Chrome DevTools Protocol.

set_pause_on_exceptions

Configure exception pause behavior.

Input:

{
  "state": "uncaught"
}

Allowed states:

  • none
  • uncaught
  • all

The default is uncaught.

continue

Resume execution and return immediately.

Use this when some external action needs to trigger the breakpoint, such as a curl request or browser interaction.

wait_for_pause

Wait until the debugged process pauses and return the current location.

Useful after continue when another tool is triggering the application.

resume

Resume execution and wait for the next pause.

This is convenient for scripts where the next pause will happen without an external trigger.

stepover

Step over the current statement and wait for the next pause.

stepinto

Step into the next function call and wait for the next pause.

getvariables

Get variables for the latest paused call frame scope.

evaluate

Evaluate JavaScript in the latest paused call frame.

Input:

{
  "expression": "JSON.stringify(req.body)"
}

Exception Reporting

The debugger pauses on uncaught exceptions by default. When an exception pause happens, the pause result includes exception metadata:

{
  "reason": "exception",
  "lineNumber": 8,
  "columnNumber": 3,
  "exception": {
    "className": "Error",
    "description": "Error: file is not a database ..."
  }
}

This lets agents diagnose startup crashes and runtime failures without reading server logs.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选