Labsco
Phoenixrr2113 logo

Debugger MCP Server

β˜… 1

from Phoenixrr2113

A development tool for real-time debugging, code quality monitoring, and AI insights for React/Next.js applications.

πŸ”₯πŸ”₯πŸ”₯βœ“ VerifiedFreeAdvanced setup

Debugger MCP Server

A comprehensive development companion tool that provides real-time debugging, code quality monitoring, and AI-enhanced insights for React/Next.js applications via the Model Context Protocol (MCP).

πŸš€ Features

Traditional Debugging

  • Error Capture: Caught/uncaught errors, console errors, promise rejections
  • Chrome DevTools Integration: Full browser debugging capabilities via Puppeteer
  • Breakpoint Management: Set, remove, and manage breakpoints with analytics
  • Conditional Breakpoints: Advanced breakpoint conditions and hit count tracking
  • Logpoints: Non-intrusive debugging with dynamic log messages
  • Network Monitoring: Track API calls, failed requests, performance
  • Real-time Streaming: Live error and performance data

Code Quality Monitoring

  • Complexity Analysis: Cyclomatic complexity, function metrics, nesting depth
  • Rule Enforcement: ESLint-style rules without running separate tools
  • Pattern Detection: Naming conventions, import patterns, architecture compliance
  • File Watching: Real-time analysis on code changes

React/Next.js Specific

  • Component Analysis: State tracking, prop drilling detection
  • Hook Monitoring: useEffect dependencies, hook rule compliance
  • Performance Insights: Render times, bundle analysis, SSR monitoring
  • Build Integration: Real-time feedback during development

πŸ›  Available MCP Tools

ToolDescriptionParameters
get-debug-sessionGet current debugging session informationNone
get-errorsGet current errors and exceptionsseverity?, timeframe?
get-violationsGet code quality rule violationsseverity?, filePath?
analyze-complexityAnalyze complexity metrics for a filefilePath
get-performanceGet performance metrics and insightstimeframe?
manage-breakpointsSet, remove, and manage debugging breakpointsaction, location?, options?, breakpointId?, active?
update-configUpdate debugger configurationconfig

πŸ“‘ Available MCP Resources

ResourceDescriptionURI
Error StreamReal-time stream of errorsstream://errors
Violation StreamReal-time code quality violationsstream://violations
Performance StreamReal-time performance metricsstream://performance

πŸ” Breakpoint Management

The debugger provides comprehensive breakpoint management capabilities through the manage-breakpoints tool:

Setting Breakpoints

# Set a simple breakpoint
Use the manage-breakpoints tool with:
- action: "set"
- location: { "filePath": "src/components/App.tsx", "lineNumber": 25 }

# Set a conditional breakpoint
Use the manage-breakpoints tool with:
- action: "set"
- location: { "filePath": "src/utils/api.ts", "lineNumber": 15 }
- options: { "condition": "response.status >= 400" }

# Set a logpoint (non-intrusive debugging)
Use the manage-breakpoints tool with:
- action: "set"
- location: { "filePath": "src/hooks/useAuth.ts", "lineNumber": 30 }
- options: { "logMessage": "User login attempt: ${user.email}" }

Managing Breakpoints

# List all breakpoints
Use the manage-breakpoints tool with action: "list"

# Remove a specific breakpoint
Use the manage-breakpoints tool with:
- action: "remove"
- breakpointId: "bp-123"

# Clear all breakpoints
Use the manage-breakpoints tool with action: "clear"

# Toggle breakpoints on/off
Use the manage-breakpoints tool with:
- action: "toggle"
- active: false

Breakpoint Analytics

# Get breakpoint analytics and hit statistics
Use the manage-breakpoints tool with action: "analytics"

This provides detailed information about:

  • Total breakpoints and hit counts
  • Most frequently hit breakpoints
  • Hit statistics by file and time
  • Recent breakpoint activity

πŸ”§ Development

# Run in development mode
npm run dev

# Build the project
npm run build

# Run tests
npm test

# Lint code
npm run lint

# Format code
npm run format

πŸ“‹ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                 Debugger MCP Server                     β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚  MCP Interface                                          β”‚
β”‚  β€’ Tools for querying data   β”‚  β€’ SSE streaming         β”‚
β”‚  β€’ Configuration management  β”‚  β€’ Real-time updates     β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚  Core Debugging Engine                                  β”‚
β”‚  β€’ Chrome DevTools Protocol  β”‚  β€’ File System Watcher   β”‚
β”‚  β€’ Code Quality Analysis     β”‚  β€’ Performance Monitor   β”‚
β”‚  β€’ Error Tracking           β”‚  β€’ Stream Management     β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚  Real-time Communication                               β”‚
β”‚  β€’ Live error streaming     β”‚  β€’ Configuration updates β”‚
β”‚  β€’ Performance metrics      β”‚  β€’ Code quality alerts   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

🎯 Use Cases

During Development

  • Real-time feedback on code quality as you type
  • Immediate error detection without waiting for builds
  • Performance monitoring of your React components
  • Architecture compliance checking

Code Review

  • Complexity analysis of changed files
  • Pattern compliance verification
  • Performance impact assessment

Debugging

  • Live error tracking across browser and build
  • Network request monitoring
  • Component state inspection
  • Performance bottleneck identification

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests
  5. Submit a pull request

πŸ“„ License

MIT License - see LICENSE file for details

πŸ†˜ Support

  • Issues: Report bugs and feature requests on GitHub
  • Documentation: Check the docs/ directory for detailed guides
  • Examples: See examples/ directory for usage examples

Built with ❀️ for the React/Next.js development community