gdb-mcp
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| GDB_MCP_PORT | No | Port (default 3939) | 3939 |
| GDB_MCP_TOKEN | No | Shared token; required for non-loopback listening | |
| GDB_MCP_LOG_DIR | No | Log directory for launch tools | |
| GDB_MCP_HOST_BIND | No | Listen address (default 127.0.0.1) | 127.0.0.1 |
| GDB_MCP_WSL_DISTRO | No | WSL distribution for launch tools | |
| GDB_MCP_MAX_MEM_READ | No | Memory read limit | |
| GDB_MCP_HEARTBEAT_SEC | No | Heartbeat timeout in seconds | |
| GDB_MCP_MAX_ASYNC_LINE | No | Protocol frame (async line) limit | |
| GDB_MCP_REQUEST_TIMEOUT | No | Request timeout |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": false
} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
| experimental | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| list_sessionsA | List all known sessions (gdb plugin connections and launched processes) with their state. |
| session_statusC | Detailed status of one gdb session: state, inferior info, last stop reason. |
| quit_gdbA | Detach the MCP plugin from gdb. With kill_gdb=True, also quit gdb itself (and with it the debugged process). Default leaves the externally launched gdb running. |
| get_process_outputA | Tail the stdout/stderr log of a launched session (gdb or script). Requires the session to have been started by launch_gdb / launch_script. |
| launch_gdbA | Launch gdb with the MCP plugin loaded inside WSL2 (background
process, log captured to a file). |
| launch_scriptA | Launch a Python (typically pwntools) script inside WSL2. |
| kill_sessionA | End a session. For gdb, the default detaches the plugin and leaves gdb running; force=True also terminates gdb. Script sessions are terminated gracefully by default or killed with force=True. |
| execute_commandA | Execute a raw gdb command and return its output. Use for pwndbg-specific commands (vmmap, heap, got, checksec, ropgadget, search, ...) or any other gdb CLI command. Works while the inferior is running (queued until the next stop). |
| continue_executionA | Resume the inferior: continue / step / next / stepi / nexti / finish / until. Returns immediately; use wait_for_stop to wait for the next stop event, or rely on the async stop notification. |
| interruptA | Interrupt the running inferior (equivalent to Ctrl-C in gdb). The inferior stops and a stop notification is emitted. |
| wait_for_stopA | Wait until the inferior stops (signal, breakpoint, exit) or the timeout elapses. Returns immediately when the inferior is already stopped. |
| get_stop_reasonB | The reason the inferior last stopped (signal, fault address, breakpoint info). |
| read_memoryB | Read raw memory from the inferior. |
| write_memoryB | Write raw bytes (given as a hex string, e.g. '9090c3' or '90 90 c3') to the inferior's memory. |
| read_registersA | Read register values (all general-purpose registers by default, or the named subset). |
| write_registerC | Write a register. |
| get_backtraceC | Stack backtrace: pc, function name, source file/line per frame. |
| disassembleA | Disassemble |
| evaluateA | Evaluate a gdb expression against the live inferior (PIE-aware): 'main', '&puts@got', '$rax+8', '(char*)0x404000'. |
| list_threadsA | List inferior threads and which one is selected. |
| select_frameA | Select a stack frame by level (0 = innermost) for subsequent register/memory/local inspection. |
| get_memory_mapA | Memory mappings of the inferior ( |
| load_targetA | Load a program ( |
| set_breakpointC | Set a breakpoint at an address/symbol/expression ('main', '*main+0x20', '0x401000'). Types: breakpoint (software), hw (hardware), watch, hw_watch. |
| list_breakpointsB | List all breakpoints/watchpoints. |
| manage_breakpointA | Delete / enable / disable a breakpoint by number. |
| crash_reportA | One-call crash triage: signal, fault address, PC, registers,
backtrace, disassembly around PC, memory at PC/SP/fault address
and the head of the memory map. Use after wait_for_stop (or after
a stop notification). Best-effort: unreadable pieces are reported
in |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 27 tools
Most tools target distinct gdb actions such as memory, registers, breakpoints, and execution control. The main ambiguity is between quit_gdb and kill_session, which overlap in detaching/terminating sessions, but descriptions are detailed enough to guide selection in most cases.
The set mostly follows verb_noun conventions: list_*, get_*, read_*, write_*, set_breakpoint, launch_*. Minor inconsistencies exist, such as session_status and crash_report using noun phrases instead of get_* and interrupt/continue_execution/wait_for_stop using different patterns, but the overall style remains readable and predictable.
At 27 tools, the set is above the typical well-scoped range and feels heavy, though gdb is a broad debugging domain and most tools cover a concrete operation. The count could be reduced by merging quit_gdb into kill_session and avoiding the catch-all nature of execute_command.
The core debugging lifecycle is well covered: launching/loading targets, breakpoints, execution control, memory and register inspection, threads/frames, and crash triage. Minor gaps such as setting breakpoint conditions or modifying variables directly can be worked around using execute_command or evaluate.