mcp_server_gdb is a GDB/MI protocol server based on the MCP protocol, with the goal of providing AI assistants with remote application debugging capabilities.
Purpose: Expose GDB's debugging capabilities to AI assistants through the MCP protocol, enabling AI assistants to participate in remote debugging workflows.
Main capabilities:
- Create and manage GDB debugging sessions;
- Set and manage breakpoints;
- View stack information and variables;
- Control program execution (run, pause, step, etc.);
- Support concurrent multi-session debugging;
- Built-in TUI for inspecting agent behavior in order to improve prompts (in development, WIP).
Usage:
- Precompiled binaries: binaries for the corresponding working platform can be found on the release page and run directly.
- Build from source: clone the repository and build with cargo; if Nix is already installed, you can run the project directly without cloning, or enter a development shell containing all dependencies and then run ./mcp-server-gdb directly.
- Transport modes: supports Stdio (default, standard input/output transport) and SSE (Server-Sent Events transport, default address http://127.0.0.1:8080)。
- Configuration: the server IP address and GDB command timeout (in seconds) can be adjusted by modifying the src/config.rs file or via environment variables.
Supported MCP tools:
- Session management: create_session (create a new GDB debugging session), get_session (get information about a specific session), get_all_sessions (get all sessions), close_session (close a session), start_debugging (start debugging), stop_debugging (stop debugging), continue_execution (continue execution), step_execution (step into the next line), next_execution (step over the next line).
- Breakpoint management: get_breakpoints (get the breakpoint list), set_breakpoint (set a breakpoint), delete_breakpoint (delete a breakpoint).
- Debugging information: get_stack_frames (get stack frame information), get_local_variables (get local variables), get_registers (get registers), read_memory (read memory contents).
Applicable scenarios: development and debugging scenarios that require AI assistants to participate in GDB remote debugging, breakpoint management, program execution control, and viewing debugging information.
Limitations: the materials do not provide pricing, cost, platform compatibility details, performance data, or complete usage steps; the built-in TUI feature is marked as in development (WIP).