Roasbeef/mcp-debug
If you are the rightful owner of mcp-debug and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
The MCP Debug Server is a comprehensive debugging server that bridges the Debug Adapter Protocol (DAP) with the Model Context Protocol (MCP), enabling AI-powered debugging workflows for Go applications.
create_debug_session
Initialize new debugging sessions.
launch_program
Start Go programs for debugging.
set_breakpoints
Manage source code breakpoints.
continue_execution
Control program execution.
get_threads
Inspect program threads.
MCP Debug Server
A comprehensive debugging server that bridges the Debug Adapter Protocol (DAP) with the Model Context Protocol (MCP), enabling AI-powered debugging workflows for Go applications.
Quick Start
π₯οΈ Interactive TUI Console (Recommended)
go build -o tui-console ./cmd/tui
./tui-console
π§ Headless MCP Server
go build -o mcp-server ./cmd/mcp-server
./mcp-server
Features
π― TUI Console
Interactive terminal interface with real-time monitoring:
- Dashboard: Server metrics, uptime, request/error tracking
- Sessions: Active debugging session management with tables
- Clients: MCP client connection monitoring
- Commands: Interactive MCP tool execution with history
- Logs: Real-time log streaming with auto-scroll
- Help: Integrated keyboard shortcuts and documentation
π MCP Server Integration
14 debugging tools accessible via Model Context Protocol:
create_debug_session
- Initialize new debugging sessionslaunch_program
- Start Go programs for debuggingset_breakpoints
- Manage source code breakpointscontinue_execution
,step_next
,step_in
,step_out
- Execution controlget_threads
,get_stack_frames
,get_variables
- Program inspectionevaluate_expression
- Runtime expression evaluation
β‘ Actor-Based Architecture
- LND Actor System with router pattern for scalable concurrency
- Round-robin load balancing for multiple debugger instances
- Type-safe message interfaces with comprehensive error handling
- Clean separation between protocol layers and business logic
Package Architecture
The project is organized into focused packages that compose together cleanly:
mcp-debug/
βββ agent_planning/ π Documentation & implementation notes
βββ debugger/ π§ DAP/Delve integration with actor system
βββ mcp/ π MCP server exposing debugging as AI tools
βββ tui/ π₯οΈ Bubble Tea TUI for interactive debugging
βββ cmd/ π¦ Production command-line applications
βββ internal/test/ π§ͺ Development & validation utilities
βββ daemon.go ποΈ Clean API with lifecycle management
Service-Oriented Design
// Clean lifecycle management
service := mcpdebug.NewMCPDebugService()
defer service.Stop()
// Get components as needed
mcpServer := service.GetMCPServer()
actorSystem := service.GetActorSystem()
// Convenience functions for simple usage
mcpdebug.RunTUI() // Interactive TUI
mcpServer, service := mcpdebug.NewMCPServer() // Headless server
Architecture Flow
βββββββββββββββββββ ββββββββββββββββββββ βββββββββββββββββββ
β TUI Package β β MCP Package β β Debugger Packageβ
β β β β β β
β β’ Dashboard βββββΊβ β’ JSON-RPC 2.0 βββββΊβ β’ DAP Protocol β
β β’ Sessions β β β’ 14 Tools β β β’ Delve Backend β
β β’ Commands β β β’ Actor Router β β β’ Type Wrappers β
β β’ Logs β β β’ Type Safety β β β’ Session Mgmt β
βββββββββββββββββββ ββββββββββββββββββββ βββββββββββββββββββ
β² β² β²
β β β
βββββββββββββββββββββββββΌββββββββββββββββββββββββ
β
ββββββββββββββββββββ
β Root Package β
β β
β β’ MCPDebugServiceβ
β β’ Lifecycle Mgmt β
β β’ Clean API β
β β’ Composition β
ββββββββββββββββββββ
Technology Stack
- Backend: Go with Lightning Network's actor system
- Protocols: DAP (Debug Adapter Protocol) + MCP (Model Context Protocol)
- TUI: Bubble Tea with native components (tables, viewports, textinput)
- Debugging: Delve debugger integration
- Architecture: Actor model with router pattern for concurrency
Development
Build All
go mod tidy
go build -o tui-console ./cmd/tui
go build -o mcp-server ./cmd/mcp-server
Test Components
# Test TUI components
go build -o tui-test ./internal/test/tui-validation
./tui-test
# Run test suite
go test -v ./...
Package Details
π agent_planning/
- Documentation Archive
Contains all incremental implementation notes and milestone documentation:
ACTOR.md
- Actor system patterns and usageTUI_DESIGN.md
- TUI architecture decisionsCLEANUP_SUMMARY.md
- Project restructuring notes- Implementation summaries and development history
π§ debugger/
- DAP Integration
Core debugging functionality with actor-based message handling:
dap_*.go
- Debug Adapter Protocol implementationsdebug_types.go
- Type-safe wrappers for debugging operationssession.go
- Debug session lifecycle managementmessages.go
- Actor message definitions
π mcp/
- AI Tool Server
Model Context Protocol server exposing debugging as standardized tools:
mcp_server.go
- 14 debugging tools for AI clients- JSON-RPC 2.0 over stdio transport
- Type-safe argument structures for all operations
π₯οΈ tui/
- Interactive Interface
Bubble Tea terminal user interface:
tui.go
- Complete dashboard with real-time metrics- Multi-tab navigation (Dashboard, Sessions, Clients, Commands, Logs)
- Interactive command execution with history
π¦ cmd/
- Applications
Production command-line programs:
cmd/
βββ mcp-server/ # Headless MCP server for AI integration
βββ tui/ # Interactive TUI console for monitoring
π§ͺ internal/test/
- Development Tools
Validation and testing utilities:
internal/test/
βββ tui-validation/ # TUI component validation without TTY
Usage Examples
TUI Console Workflow
- Start TUI:
./tui-console
- Navigate with Tab key between views
- Use Commands tab to execute:
create_debug_session {"session_id": "debug1"}
- Monitor sessions in Sessions tab
- View logs in Logs tab
- Press
?
for help
MCP Server Integration
# Start server
./mcp-server
# MCP client can now send JSON-RPC requests:
{
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"name": "create_debug_session",
"arguments": {"session_id": "debug1"}
}
}
Documentation
- - Complete TUI user guide
- - TUI architecture and design patterns
- - Actor system usage patterns
- - Process attachment implementation
- - Binary descriptions and usage
- - Package restructuring summary
Key Features
β
Clean Package Architecture - Focused packages with clear separation of concerns
β
Service-Oriented Design - Proper lifecycle management with MCPDebugService
β
Type-Safe Composition - All packages properly import and compose together
β
Production Ready - Comprehensive error handling and clean APIs
β
Actor-Based Concurrency - LND's proven actor system with router patterns
β
Modern TUI Framework - Bubble Tea with official components
β
AI Integration Ready - MCP server exposes debugging as standardized tools
β
Real-Time Monitoring - Live metrics, session tracking, and log streaming
Development Philosophy
This project demonstrates best practices for building composable, service-oriented Go applications:
- Package Boundaries: Each package has a single responsibility and clean interfaces
- Lifecycle Management: Proper service initialization, cleanup, and resource management
- Type Safety: Strong typing throughout with exported interfaces between packages
- Actor Patterns: Proven concurrency patterns from Lightning Network development
- API Design: Clean, discoverable APIs that hide complexity while enabling power users
Perfect for learning modern Go architecture patterns, actor-based concurrency, and building AI-integrated development tools.