A production-ready MCP server for multi-session GDB and gdbserver debugging through GDB/MI.
概览
Multi-session GDB control for Codex, Claude Code, and any MCP client. gdb-mcp is a Model Context Protocol server that drives GDB through GDB/MI. It gives AI coding clients a structured, session-aware debugger interface for local Linux programs, core files, and gdbserver targets. The default gdb-mcp command is a lazy stdio proxy. MCP clients can discover tools immediately, while the full backend starts only when the first gdb_* tool is called. - : every target gets an explicit session_id, so multiple programs can be debugged side by side. - : run, continue, step, reverse-step, and inspect with tool responses that include the current frame, backtrace, locals, and summary. - : debug local executables, attach to Linux processes, load core files, connect to gdbserver, or launch a managed gdbserver. - : expose workflow groups, output strategy, safety posture, dependency versions, and diagnostic state through structured read-only tools.
README
以下为原文 README 节选,完整内容请查看原文。
gdb-mcp
Multi-session GDB control for Codex, Claude Code, and any MCP client.
gdb-mcp is a Model Context Protocol server
that drives GDB through GDB/MI. It gives AI coding clients a structured,
session-aware debugger interface for local Linux programs, core files, and
gdbserver targets.
The default gdb-mcp command is a lazy stdio proxy. MCP clients can discover
tools immediately, while the full backend starts only when the first gdb_*
tool is called.
Highlights
- Isolated debugging sessions: every target gets an explicit
session_id, so multiple programs can be debugged side by side. - Compact context tools: run, continue, step, reverse-step, and inspect with tool responses that include the current frame, backtrace, locals, and summary.
- Local and remote workflows: debug local executables, attach to Linux
processes, load core files, connect to
gdbserver, or launch a managedgdbserver. - Agent-readable capabilities: expose workflow groups, output strategy, safety posture, dependency versions, and diagnostic state through structured read-only tools.
- Safety by default: reads and ordinary debugger control are available out of the box; raw GDB execution, inferior calls, mutation, and memory writes require explicit unsafe mode.
What You Can Do
| Workflow | Tools |
|---|---|
| Start and manage sessions | gdb_create_session, gdb_attach, gdb_load_core, gdb_close_session |
| Control execution | gdb_run_and_context, gdb_continue_and_context, gdb_step_and_context, gdb_next_and_context |
| Reverse debug | gdb_rr_record, gdb_start_rr_replay_session, gdb_start_recording, gdb_reverse_continue_and_context, gdb_reverse_step_and_context |
| Inspect state | gdb_context, gdb_backtrace, gdb_locals, gdb_eval_expression, gdb_read_register, gdb_registers, gdb_source, gdb_disassemble_around_pc, gdb_read_memory |
| Analyze stripped/optimized binaries | gdb_pwn_context, gdb_binary_summary, gdb_register_context, gdb_vmmap_structured, gdb_address_info, gdb_rva_info, gdb_telescope, gdb_nearpc, gdb_symbols, gdb_got, gdb_piebase, gdb_break_rva, gdb_checksec, gdb_elf_info |
| Work with remote targets | gdb_connect_gdbserver, gdb_launch_gdbserver, gdb_gdbserver_status |
安装
uvx gdb-mcp