@debugmcp/mcp-debugger

中文文档
0.26.0发布于 2026/10/31MITES Module零依赖构建来源已验证近 30 天下载 1.1万

Step-through debugging MCP server for LLMs

原始使用文档
文档目录18 节
  1. Installation
  2. Agent skill and pi package
  3. Usage
  4. STDIO mode (default)
  5. SSE mode
  6. HTTP mode (recommended)
  7. Diagnose your setup
  8. Batteries-Included Adapters
  9. Useful environment variables
  10. Check Rust binary compatibility
  11. Options
  12. Server options ( stdio , sse , http )
  13. SSE and HTTP options
  14. HTTP options
  15. doctor options
  16. check-rust-binary options
  17. Documentation
  18. License

@debugmcp/mcp-debugger

Step-through debugging MCP server for LLMs across ten languages — 29 tools covering breakpoints (line, statement-anchored, function, logpoints), stepping, stack/variable inspection, expression evaluation, buffered program output, launch/attach/restart lifecycle, and a read-only IDE mirror of the live session.

Installation

You can use this package without installation via npx:

npx @debugmcp/mcp-debugger stdio

Or install it globally:

npm install -g @debugmcp/mcp-debugger

Agent skill and pi package

The package ships the mcp-debugger agent skill at skills/debugging/ (when to debug, the session golden path, root-cause discipline, per-language references). It is also a pi coding-agent package: pi install npm:@debugmcp/mcp-debugger installs the skill and an extension (extensions/mcp-debugger.js) that registers the server with pi's built-in MCP support (pi 0.99 or later), running the CLI installed alongside it.

Usage

STDIO mode (default)

mcp-debugger stdio

SSE mode

Deprecated: SSE transport is deprecated and will be removed in a future release. Use mcp-debugger http --port 3001 instead.

mcp-debugger sse --port 3001
mcp-debugger http --port 3001

Diagnose your setup

mcp-debugger doctor                # report every adapter (informational, always exits 0)
mcp-debugger doctor python go      # gate the exit code on the named languages
mcp-debugger doctor --json

doctor probes each adapter's runtime and debug backend in one pass, then prints a verdict per language plus the fixes for anything that needs attention. Run it first whenever a language is reported unavailable or a launch fails before your program starts. With language arguments it exits 1 when any requested language is broken, missing, disabled, or unknown (and 2 when doctor itself fails); with no arguments it always exits 0. --timeout <ms> caps each language's probe (default 10000).

See the diagnostics guide for per-language prerequisites and failure signatures.

Batteries-Included Adapters

All language adapters are bundled into the CLI package. No separate installation is needed. The following adapters are included:

  • Python (@debugmcp/adapter-python) - Python debugging via debugpy
  • Ruby (@debugmcp/adapter-ruby) - Ruby debugging via rdbg
  • JavaScript (@debugmcp/adapter-javascript) - JavaScript/Node.js debugging via js-debug
  • Rust (@debugmcp/adapter-rust) - Rust debugging via CodeLLDB
  • Go (@debugmcp/adapter-go) - Go debugging via Delve
  • Java (@debugmcp/adapter-java) - Java debugging via JDI bridge
  • .NET (@debugmcp/adapter-dotnet) - .NET debugging via netcoredbg
  • C/C++ (@debugmcp/adapter-cpp) - C/C++ debugging via CodeLLDB
  • COBOL (@debugmcp/adapter-cobol) - COBOL debugging via GnuCOBOL + CodeLLDB (a DAP shim adds COBOL-shaped scopes and values)
  • Dart/Flutter (@debugmcp/adapter-dart) - Dart and Flutter debugging via the SDK's own debug adapters (dart debug_adapter, flutter debug-adapter) behind a TCP-to-stdio bridge
  • Mock (@debugmcp/adapter-mock) - Mock adapter for testing

System Requirements: Node.js 22+ is required to run mcp-debugger. Launching a program also needs that language's toolchain on the machine:

  • Python: Python 3.7+ with debugpy (pip install debugpy)
  • Ruby: Ruby with the debug gem (rdbg)
  • JavaScript/TypeScript: nothing extra — js-debug is bundled
  • Rust: the Rust toolchain (rustc/cargo; GNU toolchain on Windows). CodeLLDB itself is vendored — no system LLDB needed
  • Go: Go + Delve (go install github.com/go-delve/delve/cmd/dlv@latest)
  • Java: JDK 21+ (compile targets with javac -g)
  • .NET: netcoredbg + a compatible .NET runtime (Portable PDBs)
  • C/C++: none for prebuilt binaries (CodeLLDB vendored); a compiler (g++/clang++) only for lone-source-file launch
  • COBOL: GnuCOBOL 3.1.2+ (cobc: apt install gnucobol3, brew install gnucobol, MSYS2 mingw-w64-ucrt-x86_64-gnucobol) for source launch and COBOL-shaped variables; CodeLLDB vendored
  • Dart/Flutter: the Dart SDK (dart on PATH, or DART_SDK) or Flutter (flutter on PATH, or FLUTTER_ROOT), which bundles Dart; the debug adapter ships with the SDK, nothing is vendored. Flutter runners need flutter --version run once so the tool cache is built

CodeLLDB platform note: the CodeLLDB debug engine ships via per-platform optional dependencies (@debugmcp/codelldb-<platform>) — npm installs exactly the one matching your os/cpu, so Rust, C/C++ and COBOL debugging work out of the box on Windows, macOS, and Linux. Installs with --omit=optional skip it; point CODELLDB_PATH at a CodeLLDB binary instead, or use the Docker image.

Attach without a toolchain: only Python (debugpy --listen) and Ruby (rdbg --open) attach direct-connect — the debug engine already runs inside the target, so the debugger host needs no Python or Ruby. JavaScript, Java, .NET, C/C++, COBOL and Dart/Flutter spawn a local adapter for attach (modes.attach: 'spawn') and so do need their toolchain on the debugger host — the Java JDI bridge, for instance, runs locally on the host JDK and connects out over JDWP, and the Dart SDK's adapter connects out to the target's VM-service URI. list_supported_languages reports per-mode availability with reasons.

Useful environment variables

VariableEffect
DEBUG_MCP_NO_REDACT=1Disable default-on secret redaction in variable/evaluate/output results
DEBUG_MCP_VARIABLE_ACCESS=explicitLeast-privilege mode: get_variables requires explicit names: [...]
DEBUG_MCP_BP_ADDRESSING=line|assert|contentBreakpoint addressing mode (default content: statement anchors + content assertions)
CODELLDB_PATHPath to a CodeLLDB binary when the platform packages are unavailable (see note above)
CPP_MSVC_BEHAVIOR=warn|error|continueWhat to do when a C/C++ target looks MSVC-built (partial PDB fidelity)
COBC_PATHPin the GnuCOBOL compiler (cobc) when it is not on PATH or in a known install directory
DART_SDKDart SDK root (or its bin/dart) when dart is not on PATH; DART_PATH is an alias
FLUTTER_ROOTFlutter SDK root when flutter is not on PATH — its bundled Dart is used when no standalone SDK is found; FLUTTER_PATH is an alias
MCP_HTTP_STALE_SESSION_MSHTTP mode: reap a crash-abandoned MCP session that never opened an SSE stream after this idle time (default 30 min)
MCP_HTTP_STREAM_LOST_SESSION_MSHTTP mode: reap a session whose SSE stream dropped and never returned after this idle time (default 2 min) — releases a dead client's paused attach target
MCP_HTTP_ALLOWED_HOSTSHTTP and (deprecated) SSE modes: comma-separated Host (and browser Origin) hostnames to accept besides localhost, 127.0.0.1, [::1] — only when another access control fronts the server; same as repeating --allowed-host
MCP_HTTP_BINDHTTP and (deprecated) SSE modes: IP address to listen on (default 127.0.0.1, loopback only); same as --bind. The Docker image sets 0.0.0.0 so a published port works. An empty value refuses to start

Check Rust binary compatibility

mcp-debugger check-rust-binary <path-to-binary>
mcp-debugger check-rust-binary --json <path-to-binary>

Analyzes a Rust executable to determine whether it was built with the GNU or MSVC toolchain and reports CodeLLDB debugging compatibility. Use --json for machine-readable output.

Options

Server options (stdio, sse, http)

  • -l, --log-level <level> - Set log level (error, warn, info, debug; default: info)
  • --log-file <path> - Log to file instead of console

SSE and HTTP options

  • -p, --port <number> - Port for SSE or HTTP mode (default: 3001)
  • --bind <address> - IP address to listen on (default: 127.0.0.1, loopback only; or MCP_HTTP_BIND). 0.0.0.0 listens on every interface and is reachable from other machines — pair it with --allowed-host <name> for the name those clients dial, and front the server with another access control. localhost means 127.0.0.1; hostnames and an empty value are refused. GET /health reports the bound address and port under listening.

HTTP options

  • --allowed-host <host> - Additional Host/Origin hostname to accept (repeatable; or MCP_HTTP_ALLOWED_HOSTS, comma-separated). Implies another access control fronts this server. No wildcard. Default: localhost, 127.0.0.1, [::1]. The deprecated sse command takes the same option.

doctor options

  • [languages...] - Languages to check and gate the exit code on (default: report all, exit 0)
  • --json - Emit a machine-readable report
  • --timeout <ms> - Per-language probe timeout in milliseconds (default: 10000)

check-rust-binary options

  • --json - Emit a machine-readable report

Documentation

See the main repository for full documentation.

License

MIT

版本与发布记录

@debugmcp/mcp-debugger 共发布 25 个版本,首次发布于 2025/07/15;过去 12 个月发布了 16 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.26.0latest2026/10/3111 天前
0.26.0-beta.1beta2026/10/3111 天前
0.25.12026/10/011 个月前
0.25.02026/09/301 个月前
0.25.0-beta.12026/09/301 个月前
0.24.22026/08/202 个月前

关于 @debugmcp/mcp-debugger 的常见问题

@debugmcp/mcp-debugger 是什么?

Step-through debugging MCP server for LLMs

如何安装 @debugmcp/mcp-debugger?

在项目目录运行 npm install @debugmcp/mcp-debugger,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 mcp-debugger,可以用 npx mcp-debugger 直接运行。

@debugmcp/mcp-debugger 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/debugmcp__mcp-debugger 是否存在。

@debugmcp/mcp-debugger 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@debugmcp/mcp-debugger 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=22.0.0。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@debugmcp/mcp-debugger 可以商用吗?

@debugmcp/mcp-debugger 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@debugmcp/mcp-debugger 的下载量有多少?

根据 npm 官方下载统计,@debugmcp/mcp-debugger 在 2026/10/12 – 2026/11/10 这 30 天内被下载 11,267 次,日均约 376 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@debugmcp/mcp-debugger 还在维护吗?

最新版本 0.26.0 发布于 2026/10/31(11 天前);至今共发布 25 个版本,其中过去 12 个月发布了 16 个;首次发布于 2025/07/15。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。