Get the FREE Ultimate OpenClaw Setup Guide →

mcp_server_gdb

MCP Server to expose the GDB debugging capabilities

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio pansila-mcp_server_gdb docker run -i pansila/mcp_server_gdb

How to use

MCP Server GDB provides a remote debugging experience built on the MCP protocol, exposing GDB/MI-style debugging capabilities over lightweight transport. It supports multiple concurrent debugging sessions, allowing you to create and manage separate GDB sessions, set breakpoints, inspect stack frames and variables, and control program execution (run, pause, step, continue, etc.). The server also offers a built-in, work-in-progress TUI to inspect agent behaviors, which can help you refine prompts and prompts-driven workflows during debugging sessions.

Usage typically involves starting the server (via Docker in this configuration) and then connecting a client that speaks the MCP/GDB protocol. You can manage sessions, retrieve debugging information, and issue control commands through the available MCP endpoints such as create_session, get_session, set_breakpoint, get_stack_frames, read_memory, and more. By supporting both standard Stdio-like and SSE transports, the server can accommodate a variety of client setups and tooling ecosystems.

How to install

Prerequisites:

  • Docker installed and running (recommended for this deployment).
  • Basic familiarity with GDB/MI debugging workflow.

Installation steps:

  1. Pull and run the MCP GDB server container: docker pull pansila/mcp_server_gdb docker run -it --rm pansila/mcp_server_gdb

  2. Alternative: Build locally with Dockerfile (if you prefer to build your own image): git clone https://github.com/pansila/mcp_server_gdb.git cd mcp_server_gdb docker build -t pansila/mcp_server_gdb . docker run -it --rm pansila/mcp_server_gdb

  3. If you want to run without Docker, you would need a compatible Rust build environment and run the binary directly (not covered by this Docker-based setup). Ensure you have Rust and Cargo installed, then build and run the server accordingly.

Note: The provided repository primarily demonstrates a Dockerized deployment path. If you require a non-Docker setup, please refer to the repository's build instructions for cargo-based execution.

Additional notes

Environment and configuration tips:

  • The server accepts multiple MCP tools for session management, debug control, breakpoint management, and debug information retrieval. Use create_session to start a new GDB session, then issue commands like start_debugging, set_breakpoint, and get_stack_frames to drive the session.
  • Transport mode: The README notes Stdio (default) and SSE transports. Ensure your client is configured to communicate over the supported transport. For the Docker image, the container will expose the appropriate ports unless overridden; consult the container's runtime docs for port mappings.
  • GDB command timeout and server IP/port are configurable via environment variables or the source configuration (refer to the README’s Configuration section). Adjust as needed to fit your network environment and debugging requirements.
  • If you encounter issues with multi-session isolation, verify that each session has unique identifiers and that your client properly scopes commands per session.
  • The TUI feature is WIP; rely on standard MCP tooling for debugging tasks and use the TUI for exploratory agent behavior inspection when available.

Related MCP Servers

Sponsor this space

Reach thousands of developers