Labsco
johngrimes logo

MCP JS Debugger

โ˜… 2

from johngrimes

Debug JavaScript and TypeScript applications through the Chrome DevTools Protocol with full source map support.

๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅโœ“ VerifiedFreeQuick setup

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

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_location maps generated positions to original source
  • get_script_source can 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 dev

Architecture

  • 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

Licence

Apache-2.0