home / mcp / mcp js debugger mcp server
Provides Chrome DevTools Protocol-based debugging for JavaScript and TypeScript apps with breakpoints, stepping, and source map support.
Configuration
View docs{
"mcpServers": {
"johngrimes-mcp-js-debugger": {
"command": "npx",
"args": [
"mcp-js-debugger"
]
}
}
}You use the MCP JS Debugger to attach Chrome DevTools Protocol debugging capabilities to CDP-compatible targets (like Node.js or Chrome). This enables you to set breakpoints, inspect call stacks with source maps, evaluate expressions, and step through code to diagnose and fix issues in JavaScript and TypeScript applications.
Connect to a CDP-compatible debugger from your MCP client to start debugging sessions. You can attach to a running target, set breakpoints in original or generated sources, and control execution (pause, resume, step over, step into, step out). When source maps are available, you’ll see original source locations in call stacks and can map generated positions back to the original files.
Prerequisites: you need Node.js 18.0.0 or later and npm. Make sure you have a working Node.js environment before proceeding.
Install dependencies and build the MCP JS Debugger locally.
npm install
npm run buildTo integrate with Claude Code, add the MCP server as a tool in your Claude Code configuration. You have two options:
claude mcp add mcp-js-debugger -- npx mcp-js-debuggerOr declare the MCP server in your project configuration file with the following snippet:
{
"mcpServers": {
"mcp-js-debugger": {
"command": "npx",
"args": ["mcp-js-debugger"]
}
}
}1) Start your Node.js application with the inspector enabled.
node --inspect-brk=9229 app.js2) Retrieve the WebSocket URL for the inspector (example):
curl http://localhost:9229/json3) Connect the debugger from your MCP client using the WebSocket URL you obtained.
connect_debugger(websocket_url: "ws://localhost:9229/<id>")4) Manage breakpoints and execution as needed, for example: set breakpoints, resume, pause, step over/into/out, and inspect call stacks and variables.
The server automatically loads source maps for transpiled code. When available, you can:
- View original source locations in call stacks
- Set breakpoints on original source files
- Map generated positions back to original sources with get_original_location
Use these commands to develop and test locally:
# Build
npm run build
# Run tests
npm test
# Run tests with coverage
npm run test:coverage
# Watch mode for development
npm run devKey components include a Chrome DevTools Protocol client wrapper, a session manager for multiple debugging sessions, a source map manager for position mapping, the MCP server itself, and TypeScript type definitions.
Requires Node.js 18.0.0 or later and a CDP-compatible debug target (Node.js, Chrome, Edge, etc.). The server is released under the Apache-2.0 license.
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