mcp-gdb
v0.1.3
Published
MCP server for GDB debugging functionality
Readme
MCP GDB Server
A Model Context Protocol (MCP) server that provides GDB debugging functionality for use with Claude or other AI assistants.
Features
- Start and manage GDB debugging sessions
- Load programs and core dumps for analysis
- Set breakpoints, step through code, and examine memory
- View call stacks, variables, and registers
- View source code with VS Code integration
- Execute arbitrary GDB commands
Installation
Claude Code
claude mcp add gdb -- npx -y mcp-gdbClaude Desktop
Add the following to your Claude Desktop MCP configuration:
{
"mcpServers": {
"gdb": {
"command": "npx",
"args": ["-y", "mcp-gdb"]
}
}
}Install from Source
git clone https://github.com/signal-slot/mcp-gdb.git
cd mcp-gdb
npm install
npm run buildUsage
Example Commands
Here are some examples of using the GDB MCP server through Claude:
Starting a GDB session
Use gdb_start to start a new debugging sessionLoading a program
Use gdb_load to load /path/to/my/program with the sessionId that was returned from gdb_startSetting a breakpoint
Use gdb_set_breakpoint to set a breakpoint at main in the active GDB sessionRunning the program
Use gdb_continue to start executionExamining variables
Use gdb_print to evaluate the expression "my_variable" in the current contextGetting a backtrace
Use gdb_backtrace to see the current call stackTerminating the session
Use gdb_terminate to end the debugging sessionSupported GDB Commands
gdb_start: Start a new GDB sessiongdb_load: Load a program into GDBgdb_command: Execute an arbitrary GDB commandgdb_terminate: Terminate a GDB sessiongdb_list_sessions: List all active GDB sessionsgdb_attach: Attach to a running processgdb_load_core: Load a core dump filegdb_set_breakpoint: Set a breakpointgdb_continue: Continue program executiongdb_step: Step program executiongdb_next: Step over function callsgdb_finish: Execute until the current function returnsgdb_backtrace: Show call stackgdb_print: Print value of expressiongdb_examine: Examine memorygdb_info_registers: Display registersgdb_list_source: List source code at current location or specified location with VS Code integration
License
MIT
