mcp-gdb

v0.1.3
mcp-gdb Checked 4 days ago Published 10 months ago

MCP server for GDB debugging functionality

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

gdb_start

Start a new GDB session

ParameterTypeDescription
gdbPathstringPath to the GDB executable (optional, defaults to "gdb")
workingDirstringWorking directory for GDB (optional)

gdb_load

Load a program into GDB

ParameterTypeDescription
program *stringPath to the program to debug
sessionId *stringGDB session ID
argumentsarrayCommand-line arguments for the program (optional)

gdb_command

Execute a GDB command

ParameterTypeDescription
command *stringGDB command to execute
sessionId *stringGDB session ID

gdb_terminate

Terminate a GDB session

ParameterTypeDescription
sessionId *stringGDB session ID

gdb_list_sessions

List all active GDB sessions

gdb_attach

Attach to a running process

ParameterTypeDescription
pid *numberProcess ID to attach to
sessionId *stringGDB session ID

gdb_load_core

Load a core dump file

ParameterTypeDescription
corePath *stringPath to the core dump file
program *stringPath to the program executable
sessionId *stringGDB session ID

gdb_set_breakpoint

Set a breakpoint

ParameterTypeDescription
location *stringBreakpoint location (e.g., function name, file:line)
sessionId *stringGDB session ID
conditionstringBreakpoint condition (optional)

gdb_continue

Continue program execution

ParameterTypeDescription
sessionId *stringGDB session ID

gdb_step

Step program execution

ParameterTypeDescription
sessionId *stringGDB session ID
instructionsbooleanStep by instructions instead of source lines (optional)

gdb_next

Step over function calls

ParameterTypeDescription
sessionId *stringGDB session ID
instructionsbooleanStep by instructions instead of source lines (optional)

gdb_finish

Execute until the current function returns

ParameterTypeDescription
sessionId *stringGDB session ID

gdb_backtrace

Show call stack

ParameterTypeDescription
sessionId *stringGDB session ID
fullbooleanShow variables in each frame (optional)
limitnumberMaximum number of frames to show (optional)

gdb_print

Print value of expression

ParameterTypeDescription
expression *stringExpression to evaluate
sessionId *stringGDB session ID

gdb_examine

Examine memory

ParameterTypeDescription
expression *stringMemory address or expression
sessionId *stringGDB session ID
countnumberNumber of units to display
formatstringDisplay format (e.g., "x" for hex, "i" for instruction)

gdb_info_registers

Display registers

ParameterTypeDescription
sessionId *stringGDB session ID
registerstringSpecific register to display (optional)

gdb_list_source

List source code at current location or specified location, with VS Code integration

ParameterTypeDescription
sessionId *stringGDB session ID
lineCountnumberNumber of lines to show (optional, default is 10)
locationstringSource location (e.g., function name, file:line, optional)