UNPKG

@ai-capabilities-suite/mcp-debugger-server

Version:

Enterprise-grade MCP server providing advanced debugging capabilities for Node.js and TypeScript applications. Features 25+ debugging tools including breakpoints, variable inspection, execution control, CPU/memory profiling, hang detection, source map sup

203 lines (202 loc) 5.77 kB
/** * MCP Debugger Server * Provides debugging capabilities for Node.js and TypeScript applications * through the Model Context Protocol */ export declare class McpDebuggerServer { private server; private sessionManager; private hangDetector; private shutdownHandler; constructor(); /** * Setup graceful shutdown handlers */ private setupShutdownHandlers; /** * Register all MCP tools */ private registerTools; /** * Tool: debugger_start * Start a new debug session * Requirements: 2.1, 9.1 */ private registerDebuggerStart; /** * Tool: debugger_set_breakpoint * Set a breakpoint in the debug session * Requirements: 1.1, 1.2, 9.1 */ private registerDebuggerSetBreakpoint; /** * Tool: debugger_continue * Resume execution of a paused debug session * Requirements: 2.2, 9.1 */ private registerDebuggerContinue; /** * Tool: debugger_step_over * Step over the current line * Requirements: 2.3, 9.1 */ private registerDebuggerStepOver; /** * Tool: debugger_inspect * Evaluate an expression in the current execution context * Requirements: 3.4, 9.1, 9.3 */ private registerDebuggerInspect; /** * Tool: debugger_get_stack * Get the current call stack * Requirements: 4.1, 9.1, 9.4 */ private registerDebuggerGetStack; /** * Tool: debugger_detect_hang * Detect if a process hangs or enters an infinite loop * Requirements: 5.1, 5.2, 5.3, 5.4, 9.1 */ private registerDebuggerDetectHang; /** * Tool: debugger_step_into * Step into the current line * Requirements: 2.4, 9.1 */ private registerDebuggerStepInto; /** * Tool: debugger_step_out * Step out of the current function * Requirements: 2.5, 9.1 */ private registerDebuggerStepOut; /** * Tool: debugger_pause * Pause running execution * Requirements: 2.6, 9.1 */ private registerDebuggerPause; /** * Tool: debugger_remove_breakpoint * Remove a breakpoint from the session * Requirements: 1.4, 9.1 */ private registerDebuggerRemoveBreakpoint; /** * Tool: debugger_toggle_breakpoint * Toggle a breakpoint's enabled state * Requirements: 1.5, 9.1 */ private registerDebuggerToggleBreakpoint; /** * Tool: debugger_list_breakpoints * List all breakpoints in the session * Requirements: 1.3, 9.1 */ private registerDebuggerListBreakpoints; /** * Tool: debugger_get_local_variables * Get all local variables in the current scope * Requirements: 3.1, 9.1, 9.3 */ private registerDebuggerGetLocalVariables; /** * Tool: debugger_get_global_variables * Get global variables accessible from the current scope * Requirements: 3.2, 9.1, 9.3 */ private registerDebuggerGetGlobalVariables; /** * Tool: debugger_inspect_object * Inspect an object's properties with nested resolution * Requirements: 3.3, 9.1, 9.3 */ private registerDebuggerInspectObject; /** * Tool: debugger_add_watch * Add a watched expression * Requirements: 3.5, 9.1 */ private registerDebuggerAddWatch; /** * Tool: debugger_remove_watch * Remove a watched expression * Requirements: 3.5, 9.1 */ private registerDebuggerRemoveWatch; /** * Tool: debugger_get_watches * Get all watched expressions with their current values * Requirements: 3.5, 9.1 */ private registerDebuggerGetWatches; /** * Tool: debugger_switch_stack_frame * Switch context to a different stack frame * Requirements: 4.2, 9.1 */ private registerDebuggerSwitchStackFrame; /** * Tool: debugger_stop_session * Stop a debug session and cleanup resources * Requirements: 8.2, 9.1 */ private registerDebuggerStopSession; /** * Tool: debugger_set_logpoint * Set a logpoint (non-breaking breakpoint) in the debug session */ private registerDebuggerSetLogpoint; /** * Tool: debugger_set_exception_breakpoint * Set an exception breakpoint to pause on caught/uncaught exceptions */ private registerDebuggerSetExceptionBreakpoint; /** * Tool: debugger_set_function_breakpoint * Set a function breakpoint to pause when a function is called */ private registerDebuggerSetFunctionBreakpoint; /** * Tool: debugger_set_hit_count_condition * Set a hit count condition for an existing breakpoint */ private registerDebuggerSetHitCountCondition; /** * Tool: debugger_start_cpu_profile * Start CPU profiling for a debug session */ private registerDebuggerStartCPUProfile; /** * Tool: debugger_stop_cpu_profile * Stop CPU profiling and return the profile data with analysis */ private registerDebuggerStopCPUProfile; /** * Tool: debugger_take_heap_snapshot * Take a heap snapshot for memory analysis */ private registerDebuggerTakeHeapSnapshot; /** * Tool: debugger_get_performance_metrics * Get performance metrics including memory usage and timeline data */ private registerDebuggerGetPerformanceMetrics; /** * Start the MCP server */ start(): Promise<void>; /** * Stop the MCP server and cleanup all sessions */ stop(): Promise<void>; /** * Check if server is shutting down */ isShuttingDown(): boolean; } /** * Create and start the MCP debugger server */ export declare function startMcpDebuggerServer(): Promise<McpDebuggerServer>;