Debugger MCP Server
A development tool for real-time debugging, code quality monitoring, and AI insights for React/Next.js applications.
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
π¦ Installation
# Clone the repository
git clone <repository-url>
cd debugger-mcp
# Install dependencies
npm install
# Build the project
npm run build
π― Quick Start
1. Start the MCP Server
# Development mode (with hot reload)
npm run dev
# Production mode
npm start
2. Connect to Claude Desktop
Add this to your Claude Desktop MCP configuration:
{
"mcpServers": {
"debugger": {
"command": "node",
"args": ["/path/to/debugger-mcp/dist/index.js"],
"env": {}
}
}
}
3. Test the Connection
In Claude Desktop, try these commands:
# Get current debugging session info
Use the get-debug-session tool
# Check for errors
Use the get-errors tool
# Analyze code complexity
Use the analyze-complexity tool with filePath: "src/components/MyComponent.tsx"
π Available MCP Tools
| Tool | Description | Parameters |
|---|---|---|
get-debug-session | Get current debugging session information | None |
get-errors | Get current errors and exceptions | severity?, timeframe? |
get-violations | Get code quality rule violations | severity?, filePath? |
analyze-complexity | Analyze complexity metrics for a file | filePath |
get-performance | Get performance metrics and insights | timeframe? |
manage-breakpoints | Set, remove, and manage debugging breakpoints | action, location?, options?, breakpointId?, active? |
update-config | Update debugger configuration | config |
π‘ Available MCP Resources
| Resource | Description | URI |
|---|---|---|
| Error Stream | Real-time stream of errors | stream://errors |
| Violation Stream | Real-time code quality violations | stream://violations |
| Performance Stream | Real-time performance metrics | stream://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
βοΈ Configuration
The debugger creates a .debugger-mcp.json configuration file with these options:
{
"complexity": {
"maxFileLines": 300,
"maxFunctionComplexity": 10,
"maxFunctionParams": 5,
"maxNestingDepth": 4
},
"patterns": {
"namingConventions": {
"components": "^[A-Z][a-zA-Z0-9]*$",
"hooks": "^use[A-Z][a-zA-Z0-9]*$"
}
},
"watching": {
"paths": ["src", "pages", "components"],
"ignored": ["node_modules", ".git", "dist"]
},
"browser": {
"autoConnect": true,
"port": 9222
},
"breakpoints": {
"maxRecentHits": 100,
"autoRemoveAfterHits": null,
"enableAnalytics": true,
"persistBreakpoints": true,
"logpointTimeout": 5000,
"enableConditionalBreakpoints": true,
"enableLogpoints": true
}
}
π§ 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
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests
- 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
Servidores relacionados
Scout Monitoring MCP
patrocinadorPut performance and error data directly in the hands of your AI assistant.
Alpha Vantage MCP Server
patrocinadorAccess financial market data: realtime & historical stock, ETF, options, forex, crypto, commodities, fundamentals, technical indicators, & more
Local Logs MCP Server
MCP for monitoring local application logs with real-time tailing, error tracking, and log search capabilities.
MCP System Monitor Server
A cross-platform server for real-time monitoring of CPU, GPU, memory, disk, network, and process information.
Overture
Visual plan approval for AI coding agents. See your agent's plan as an interactive graph, attach context, choose approaches, then approve before any code is written.
Unified.to MCP Server
Unified MCP Server is a remote MCP connector for AI agents and vertical AI products that provides access to 22,000+ authorized SaaS tools across 400+ integrations and 24 categories directly inside LLMs.
OAuth 2.1 MCP Server
A Next.js template for building MCP servers with OAuth 2.1 authentication, supporting PostgreSQL and Redis.
MCP Image Extractor
Extracts images from files, URLs, or base64 strings and converts them to base64 for LLM analysis.
Geo Location Demo
Retrieves user geolocation information using EdgeOne Pages Functions and integrates it with large language models via MCP.
MCP Terminal Server
A secure command-line interface server for the Model Context Protocol (MCP) that allows AI models to interact with a user's terminal.
Learn MCP
A sample project for learning MCP development, featuring a calculator for math operations and a prompt flow server for various templates.
MCP Aggregator
An MCP (Model Context Protocol) aggregator that allows you to combine multiple MCP servers into a single endpoint allowing to filter specific tools.