GDB

Provides an MCP interface to discover, attach to, and control GDB sessions for AI-assisted debugging.
  • python

63

GitHub Stars

python

Language

6 months ago

First Indexed

2 months ago

Catalog Refreshed

Documentation & install

Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.

Installation

Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "yywz1999-gdb-mcp-server": {
      "command": "python3",
      "args": [
        "mcp_server.py"
      ]
    }
  }
}

You can run a Python-based MCP server that talks to GDB using the Model Context Protocol. This server lets an AI assistant interact with GDB, attach to running GDB sessions, manage breakpoints, inspect memory and registers, step through code, and perform common debugging tasks across multi-architecture and remote scenarios.

How to use

Launch the MCP server in a local environment to enable interaction with GDB through MCP. Start by attaching to a running GDB session or discovering active GDB processes, then perform debugging actions via MCP calls that correspond to common GDB operations.

How to install

# prerequisites: Python 3.11+ and Git
# 1) Clone the MCP server repository
git clone https://github.com/yywz1999/gdb-mcp-server.git
cd gdb-mcp-server

# 2) Install Python dependencies
python3 -m pip install -r requirements.txt

# 3) Run the MCP server (from the repository root or adjust path as needed)
python3 mcp_server.py

This sequence installs dependencies and starts the MCP server so you can begin interfacing with GDB via MCP.

## Configuration and usage notes

The server provides a standard set of tools to locate and attach to GDB, followed by a suite of GDB-related actions you can trigger via MCP calls. When starting from macOS with a terminal, you may want to optimize terminal handling and ensure the GDB terminal is ready before attaching.

The following tools are available for interacting with GDB through MCP: sys\_find\_gdb\_processes, sys\_attach\_to\_gdb, gdb\_execute\_command, gdb\_set\_breakpoint, gdb\_delete\_breakpoint, gdb\_step, gdb\_next, gdb\_finish, gdb\_continue, gdb\_get\_registers, gdb\_examine\_memory, gdb\_get\_stack, gdb\_get\_locals, gdb\_disassemble, gdb\_connect\_remote.

## Available tools

### sys\_find\_gdb\_processes

Find all running GDB processes on the host so you can attach without manual process selection.

### sys\_attach\_to\_gdb

Attach the MCP server to a selected GDB process to start issuing commands.

### gdb\_execute\_command

Execute an arbitrary GDB command and return the result.

### gdb\_set\_breakpoint

Set a breakpoint at a specified location.

### gdb\_delete\_breakpoint

Remove a breakpoint by its location or number.

### gdb\_step

Step through the next source line of code.

### gdb\_next

Continue execution until the next line in the current function.

### gdb\_finish

Run until the current function returns.

### gdb\_continue

Continue program execution.

### gdb\_get\_registers

Fetch the current values of CPU registers.

### gdb\_examine\_memory

Inspect a memory region by address and size.

### gdb\_get\_stack

Obtain the current stack trace.

### gdb\_get\_locals

Retrieve local variables in the current stack frame.

### gdb\_disassemble

Disassemble a code region to view assembly instructions.

### gdb\_connect\_remote

Connect to a remote debugging target.
Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational