Home / MCP / MCP GDB Server

MCP GDB Server

Provides GDB debugging functionality for use with Claude or other MCP-enabled assistants.

javascript
Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
    "mcpServers": {
        "gdb": {
            "command": "node",
            "args": [
                "/path/to/mcp-gdb/build/index.js"
            ]
        }
    }
}

You can run a dedicated MCP GDB server to manage debugging sessions for programs and core dumps, directly within your MCP-enabled workflows. This server lets you start GDB sessions, load binaries or cores, set breakpoints, inspect memory and registers, and execute arbitrary GDB commands from your conversations with supported assistants like Claude.

How to use

You use the GDB MCP server by connecting it as an MCP endpoint from your MCP client. Once connected, you can start a new debugging session, load a program or core dump, set breakpoints, run the program, inspect variables and memory, retrieve a backtrace, and terminate the session. All interactions are performed through standard GDB commands exposed via the MCP interface, allowing you to drive debugging from your assistant chats.

How to install

Prerequisites: you need Node.js and npm installed on your machine. You also need git to clone the project. Ensure you have access to a shell with these tools available.

Clone the project repository and navigate into the directory.

Install dependencies.

Build the project.

Available tools

gdb_start

Start a new GDB debugging session.

gdb_load

Load a program or core dump into the active GDB session.

gdb_command

Execute an arbitrary GDB command within the current session.

gdb_terminate

Terminate the active GDB debugging session.

gdb_list_sessions

List all active GDB debugging sessions.

gdb_attach

Attach GDB to an existing process.

gdb_load_core

Load a core dump file into GDB for analysis.

gdb_set_breakpoint

Set a breakpoint at a specified function or line.

gdb_continue

Continue program execution from the current point.

gdb_step

Step through the program one instruction or line at a time.

gdb_next

Step over function calls without entering them.

gdb_finish

Run until the current function returns.

gdb_backtrace

Show the current call stack.

gdb_print

Print the value of an expression in the current context.

gdb_examine

Examine a memory region or address.

gdb_info_registers

Display the current CPU registers.