MCP JS Debugger
Enables debugging of Node.js applications through the Chrome DevTools Protocol, allowing breakpoint management, code stepping, call stack inspection, variable examination, and expression evaluation with source map support for transpiled code.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MCP JS Debugger set a breakpoint at line 25 in app.js and step through the function"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MCP JS Debugger
An MCP (Model Context Protocol) server that exposes Chrome DevTools Protocol debugging capabilities, enabling AI assistants to debug JavaScript and TypeScript applications.
Features
Connect to any CDP-compatible debugger (Node.js, Chrome, Edge)
Set, list, and remove breakpoints
Step through code (over, into, out)
Inspect call stacks with source map support
Evaluate expressions in any stack frame
View and modify variables
Pause on exceptions
Full source map support for debugging transpiled code
Related MCP server: MCP Debugger
Installation
npm install
npm run buildClaude Code integration
Add to your Claude Code configuration:
claude mcp add mcp-js-debugger -- npx mcp-js-debuggerOr add to .mcp.json:
{
"mcpServers": {
"mcp-js-debugger": {
"command": "npx",
"args": ["mcp-js-debugger"]
}
}
}Usage
Starting a debug target
Start your Node.js application with the inspector:
# Pause on first line (recommended for setting initial breakpoints)
node --inspect-brk=9229 your-script.js
# Or start without pausing
node --inspect=9229 your-script.jsAvailable tools
Tool | Description |
| Connect to a CDP endpoint via WebSocket URL |
| Disconnect from a debugging session |
| Set a breakpoint by URL and line number |
| Remove a breakpoint by ID |
| List all breakpoints in a session |
| Resume execution after pause |
| Step over the current statement |
| Step into a function call |
| Step out of the current function |
| Pause running execution |
| Get the current call stack with source locations |
| Evaluate a JavaScript expression |
| Get variables in a scope |
| Modify a variable's value |
| Configure exception handling |
| Map generated to original source location |
| Get script source code |
| List loaded scripts |
Example workflow
Start your application with
--inspect-brk:node --inspect-brk=9229 app.jsGet the WebSocket URL:
curl http://localhost:9229/jsonConnect the debugger:
connect_debugger(websocket_url: "ws://localhost:9229/<id>")Set breakpoints:
set_breakpoint(session_id: "...", url: "file:///path/to/app.js", line_number: 10)Resume execution to hit the breakpoint:
resume_execution(session_id: "...")Inspect state when paused:
get_call_stack(session_id: "...") get_scope_variables(session_id: "...", call_frame_id: "...", scope_index: 0) evaluate_expression(session_id: "...", expression: "myVariable")Continue debugging:
step_over(session_id: "...") resume_execution(session_id: "...")
Source map support
The server automatically loads source maps for transpiled code (TypeScript, bundled JavaScript, etc.). When source maps are available:
Call stacks show original source locations
Breakpoints can be set on original source files
get_original_locationmaps generated positions to original sourceget_script_sourcecan return original source content
Development
# Build
npm run build
# Run tests
npm test
# Run tests with coverage
npm run test:coverage
# Watch mode for development
npm run devArchitecture
cdp-client.ts - Low-level Chrome DevTools Protocol client wrapper
session-manager.ts - Manages multiple debugging sessions
source-map-manager.ts - Handles source map loading and position mapping
server.ts - MCP server implementation with tool handlers
types.ts - TypeScript type definitions
Requirements
Node.js 18.0.0 or later
A CDP-compatible debug target (Node.js, Chrome, Edge, etc.)
Licence
Apache-2.0
Available Tools
18 toolsconnect_debuggerA
Establishes a new debugging session by connecting to a Chrome DevTools Protocol (CDP) endpoint. Use this to connect to Node.js (started with --inspect), Chrome, Edge, or other CDP-compatible runtimes. Returns a session_id that must be used in all subsequent debugging operations.
Inputs: websocket_url (required), session_name.
disconnect_debuggerA
Closes an active debugging session and releases all resources. Any breakpoints set in the session will be removed.
Inputs: session_id (required).
evaluate_expressionA
Evaluates a JavaScript expression in the context of a specific call frame or global context. Use this to inspect variables, test expressions, or understand the program state. The expression is evaluated in the JavaScript runtime, so you can call methods, access properties, etc.
Inputs: session_id (required), expression (required), call_frame_id, return_by_value.
get_call_stackA
Retrieves the current call stack when execution is paused. Shows the chain of function calls that led to the current location, including function names, file locations, and scope information. If source maps are available, original source locations are included.
Inputs: session_id (required), include_async.
get_original_locationA
Maps a generated code location back to the original source location using source maps. Essential for debugging bundled or transpiled code (TypeScript, Babel, webpack, esbuild, etc.).
Inputs: session_id (required), script_id (required), line_number (required), column_number (required).
get_scope_variablesA
Retrieves all variables in a specific scope. Use this to see all local variables, closure variables, or global variables at a given point in execution.
Inputs: session_id (required), call_frame_id (required), scope_index.
get_script_sourceA
Retrieves the source code for a script. If source maps are available, can return the original source instead of the generated/bundled code.
Inputs: session_id (required), script_id (required), prefer_original.
list_breakpointsA
Lists all breakpoints set in a debugging session, including their locations and conditions.
Inputs: session_id (required).
list_scriptsA
Lists all scripts loaded in the debugging session. Includes source map information where available, showing which original sources are mapped.
Inputs: session_id (required), include_internal.
pause_executionA
Pauses execution at the next possible opportunity. Use this when the program is running and you want to inspect its state.
Inputs: session_id (required).
remove_breakpointA
Removes a previously set breakpoint. Use list_breakpoints to find breakpoint IDs.
Inputs: session_id (required), breakpoint_id (required).
resume_executionA
Resumes execution after being paused at a breakpoint or by pause_execution. Execution continues until the next breakpoint or the program ends.
Inputs: session_id (required).
set_breakpointB
Sets a breakpoint at a specific location in the code. The breakpoint will pause execution when the specified line is reached. You can set conditional breakpoints that only trigger when an expression evaluates to true.
Inputs: session_id (required), url (required), line_number (required), column_number, +1 more.
set_pause_on_exceptionsB
Configures whether the debugger should pause when exceptions are thrown. Useful for catching errors as they occur.
Inputs: session_id (required), state (required).
set_variable_valueA
Modifies the value of a variable in a specific call frame. Use this to test different scenarios or fix values during debugging.
Inputs: session_id (required), call_frame_id (required), scope_index (required), variable_name (required), +1 more.
step_intoA
Steps into a function call if the current line contains one, otherwise steps to the next statement. Use this to examine what happens inside a function. The session must be paused.
Inputs: session_id (required).
step_outA
Steps out of the current function and pauses at the calling code. Use this to quickly exit a function you've stepped into. The session must be paused.
Inputs: session_id (required).
step_overA
Steps over the current statement to the next line in the same function. If the current line contains a function call, the entire function executes without stepping into it. The session must be paused.
Inputs: session_id (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 18 tools
Each tool maps to a distinct debugging operation—session lifecycle, breakpoint management, stepping, execution control, state inspection, and source mapping—so there is no meaningful overlap between tools. Even similar stepping tools are clearly differentiated by whether they step over, into, or out of function calls.
All tool names consistently follow a verb_noun pattern using clear, predictable verbs like connect, disconnect, set, remove, list, get, resume, pause, step, and evaluate. This makes the toolset easy to navigate and anticipate.
At 18 tools, the server is slightly above the typical 3–15 sweet spot, but the count is well justified for a debugger covering session management, breakpoints, stepping, inspection, and source maps. The tools are organized around the complete debugging workflow rather than being redundant.
The toolset covers the full debugging lifecycle: connect/disconnect sessions, breakpoint CRUD, execution control, call stack and scope inspection, variable mutation, exception handling, and source map support. There are no obvious dead ends or missing operations for standard JavaScript debugging via CDP.
Maintenance
Related MCP Connectors
Live browser debugging for AI assistants — DOM, console, network via MCP.
Build, run, debug, test and ship Chrome, Firefox, Edge and Safari extensions from your AI agent.
Build, run, inspect, and continue AgentScript workflows on connected Super Chrome and Mac clients.
Give AI agents a real cloud Chrome: open sessions, navigate, read pages, click, type and screenshot.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to debug Node.js applications using Chrome DevTools Protocol. Provides comprehensive debugging capabilities including breakpoints, stepping, variable inspection, expression evaluation, and console monitoring.4,585 npm351MIT
- AlicenseAqualityAmaintenanceEnables AI agents to perform step-through debugging of Python, JavaScript/Node.js, and Rust programs using the Debug Adapter Protocol, with support for breakpoints, variable inspection, and stack traces.29193MIT
- AlicenseNot gradedqualityCmaintenanceWraps Chrome DevTools Protocol to provide AI agents with low-level browser debugging tools including breakpoints, stack traces, stepping, network interception, and source maps.79 npm1MIT
- AlicenseBqualityBmaintenanceEnables AI agents to debug code and automate browsers using Chrome DevTools Protocol, supporting breakpoints, variable inspection, and replayable interaction recording.35611 npm19MIT