gdb
A GDB/MI protocol server based on the MCP protocol, providing remote application debugging capabilities.
Added on 3/28/2025
MCP Server GDB
A GDB/MI protocol server based on the MCP protocol, providing remote application debugging capabilities.
Features
- Create and manage GDB debug sessions
- Set and manage breakpoints
- View stack information and variables
- Control program execution (run, pause, step, etc.)
- Support concurrent multi-session debugging
Supported MCP Tools
Session Management
create_session
- Create a new GDB debugging session- Parameters:
executable_path
(optional) - Path to the executable to debug
- Parameters:
get_session
- Get specific session information- Parameters:
session_id
- GDB session ID
- Parameters:
get_all_sessions
- Get all sessions- Parameters: none
close_session
- Close session- Parameters:
session_id
- GDB session ID
- Parameters:
Debug Control
start_debugging
- Start debugging- Parameters:
session_id
- GDB session ID
- Parameters:
stop_debugging
- Stop debugging- Parameters:
session_id
- GDB session ID
- Parameters:
continue_execution
- Continue execution- Parameters:
session_id
- GDB session ID
- Parameters:
step_execution
- Step into next line- Parameters:
session_id
- GDB session ID
- Parameters:
next_execution
- Step over next line- Parameters:
session_id
- GDB session ID
- Parameters:
Breakpoint Management
get_breakpoints
- Get breakpoint list- Parameters:
session_id
- GDB session ID
- Parameters:
set_breakpoint
- Set breakpoint- Parameters:
session_id
- GDB session IDfile
- Source file pathline
- Line number
- Parameters:
delete_breakpoint
- Delete breakpoint- Parameters:
session_id
- GDB session IDbreakpoint_id
- Breakpoint ID
- Parameters:
Debug Information
get_stack_frames
- Get stack frame information- Parameters:
session_id
- GDB session ID
- Parameters:
get_local_variables
- Get local variables- Parameters:
session_id
- GDB session IDframe_id
- Stack frame ID
- Parameters:
Usage
- Install Rust and Cargo
- Clone this repository
- Run
cargo run
to start the server - The server supports two transport modes:
- Stdio (default): Standard input/output transport
- SSE: Server-Sent Events transport, default at
http://127.0.0.1:8080
Configuration
You can adjust server configuration by modifying the src/config.rs
file or by environment variables:
- Server port
- GDB path
- Temporary file directory
License
MIT
Similar Resources
Developer Tools