Labsco
MCP SERVER

MCP JS Debugger

by johngrimes

Gives the assistant a real debugger: attach to a running Node or Chrome process, set a breakpoint, step through it, and read — or change — the variables at the point where it broke.

Runtime Debugging & Crash AnalysisVerified
Summary
Ends the print-statement loop, because the assistant can look at the actual state.

The usual pattern — add a log line, rerun, read the output, repeat — collapses when the assistant can stop the program at the line in question and evaluate expressions against the live frame. Two things are worth setting up first: start with --inspect-brk so nothing important has run before you attach, and use conditional breakpoints on anything inside a loop, or you will spend the session resuming. Source-map support is what makes it usable on TypeScript and bundled code rather than only on plain JavaScript.

What it is

A Chrome DevTools Protocol client. It attaches to any CDP-capable runtime over a WebSocket URL and exposes the normal debugger operations as tools, with source maps resolved so transpiled code maps back to what you wrote.

What you get
  • A session against any CDP endpoint — Node.js started with the inspector, Chrome, Edge — returning a session id that every later call carries
  • Breakpoints set by file URL and line, optionally conditional so they only fire when an expression is true, then listed and removed by id
  • Execution control: resume, pause a running program at the next opportunity, and step over, into or out of the current statement
  • The call stack while paused, with function names, file locations and scope information, and original source locations when source maps allow, including async frames on request
  • Expressions evaluated in a chosen call frame or in the global context, so you can call methods and read state rather than guess it
  • All variables in a scope read at any frame, and a variable's value changed in place to test a different path without editing the file
  • Pausing on thrown exceptions, configured for the session, so an error stops where it happens
  • Source-map support as first-class tools: the scripts loaded listed with their mapping information, a generated location mapped back to the original, and a script's source fetched as either the bundled or the original code
Requirements

A process to attach to, started with the inspector — node --inspect-brk=9229 pauses on the first line, which is what you want if the bug happens during startup, and node --inspect=9229 does not. The WebSocket URL comes from the runtime's own endpoint listing, and it is what the connect call takes. The server runs as npx mcp-js-debugger. Debugging is stateful: most tools need the session paused, and disconnecting drops every breakpoint set in that session. The debugger can change variables in the running program, so it acts on the process, not just observes it.

Setup effort

One command — npx mcp-js-debugger