MCP GDB Server
This MCP server enables AI assistants to perform comprehensive GDB debugging operations through a structured interface.
Session Management: Start new GDB sessions with custom GDB paths and working directories, list active sessions, and terminate sessions
Program Loading: Load executables with command-line arguments, attach to running processes by PID, and load core dump files for post-mortem analysis
Execution Control: Continue execution, step into/over functions, step by source lines or instructions, and finish executing the current function
Breakpoint Control: Set breakpoints at specific locations (functions, file:line) with optional conditions
Code & State Inspection: View call stacks with optional frame limits and variable display, list source code at current or specified locations with VS Code integration, print variable values and evaluate expressions, examine memory at specific addresses with customizable display formats (hex, instruction, etc.), and display CPU registers
Raw Command Execution: Execute arbitrary GDB commands for advanced debugging scenarios
Allows accessing the MCP GDB server repository for installation and setup.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MCP GDB Server set a breakpoint at main and then run the program"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MCP GDB Server
A Model Context Protocol (MCP) server that provides GDB debugging functionality for use with Claude or other AI assistants.
Features
Start and manage GDB debugging sessions
Load programs and core dumps for analysis
Set breakpoints, step through code, and examine memory
View call stacks, variables, and registers
View source code with VS Code integration
Execute arbitrary GDB commands
Related MCP server: GDB MCP Server
Installation
Claude Code
claude mcp add gdb -- npx -y mcp-gdbClaude Desktop
Add the following to your Claude Desktop MCP configuration:
{
"mcpServers": {
"gdb": {
"command": "npx",
"args": ["-y", "mcp-gdb"]
}
}
}Install from Source
git clone https://github.com/signal-slot/mcp-gdb.git
cd mcp-gdb
npm install
npm run buildUsage
Example Commands
Here are some examples of using the GDB MCP server through Claude:
Starting a GDB session
Use gdb_start to start a new debugging sessionLoading a program
Use gdb_load to load /path/to/my/program with the sessionId that was returned from gdb_startSetting a breakpoint
Use gdb_set_breakpoint to set a breakpoint at main in the active GDB sessionRunning the program
Use gdb_continue to start executionExamining variables
Use gdb_print to evaluate the expression "my_variable" in the current contextGetting a backtrace
Use gdb_backtrace to see the current call stackTerminating the session
Use gdb_terminate to end the debugging sessionSupported GDB Commands
gdb_start: Start a new GDB sessiongdb_load: Load a program into GDBgdb_command: Execute an arbitrary GDB commandgdb_terminate: Terminate a GDB sessiongdb_list_sessions: List all active GDB sessionsgdb_attach: Attach to a running processgdb_load_core: Load a core dump filegdb_set_breakpoint: Set a breakpointgdb_continue: Continue program executiongdb_step: Step program executiongdb_next: Step over function callsgdb_finish: Execute until the current function returnsgdb_backtrace: Show call stackgdb_print: Print value of expressiongdb_examine: Examine memorygdb_info_registers: Display registersgdb_list_source: List source code at current location or specified location with VS Code integration
License
MIT
Available Tools
16 toolsgdb_attachC
Attach to a running process
Inputs: pid (required), sessionId (required).
gdb_backtraceC
Show call stack
Inputs: sessionId (required), full, limit.
gdb_commandC
Execute a GDB command
Inputs: command (required), sessionId (required).
gdb_continueC
Continue program execution
Inputs: sessionId (required).
gdb_examineC
Examine memory
Inputs: expression (required), sessionId (required), count, format.
gdb_finishC
Execute until the current function returns
Inputs: sessionId (required).
gdb_info_registersC
Display registers
Inputs: sessionId (required), register.
gdb_list_sessionsB
List all active GDB sessions
Inputs: no named parameters.
gdb_loadC
Load a program into GDB
Inputs: program (required), sessionId (required), arguments.
gdb_load_coreC
Load a core dump file
Inputs: corePath (required), program (required), sessionId (required).
gdb_nextC
Step over function calls
Inputs: sessionId (required), instructions.
gdb_printC
Print value of expression
Inputs: expression (required), sessionId (required).
gdb_set_breakpointC
Set a breakpoint
Inputs: location (required), sessionId (required), condition.
gdb_startC
Start a new GDB session
Inputs: gdbPath, workingDir.
gdb_stepC
Step program execution
Inputs: sessionId (required), instructions.
gdb_terminateC
Terminate a GDB session
Inputs: sessionId (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 16 tools
Every tool has a clearly distinct purpose with no ambiguity. Each tool targets a specific GDB operation like attaching, stepping, examining memory, or managing sessions, making misselection unlikely.
All tools follow a consistent 'gdb_' prefix with descriptive verb_noun patterns (e.g., gdb_attach, gdb_backtrace, gdb_set_breakpoint). This predictability aids agent understanding and usage.
With 16 tools, the count is slightly high but reasonable for a GDB debugging server. It covers essential debugging operations without feeling overly heavy, though it could be streamlined slightly.
The toolset provides complete coverage for GDB debugging workflows, including session management, execution control, breakpoints, memory examination, and stack analysis. No obvious gaps exist for the domain.
Maintenance
Related MCP Connectors
Use your Mac, Windows or Linux computer from ChatGPT, Claude or Codex: files, commands, documents.
Work on your own computers from Claude or ChatGPT: run commands, edit and search files.
Source-checked CLI guides and model-aware planning for Claude Code, Codex, and Grok Build.
Live browser debugging for AI assistants — DOM, console, network via MCP.
Related MCP Servers
- AlicenseAqualityDmaintenanceProvides structured debugging capabilities through LLDB, enabling AI assistants to set breakpoints, inspect variables, analyze crashes, disassemble code, and evaluate expressions in C/C++ programs.173Apache 2.0
- AlicenseCqualityBmaintenanceEnables LLM clients to interact with the GNU Debugger (GDB) for comprehensive debugging and binary analysis. It provides a wide range of tools for program execution control, memory examination, stack analysis, and disassembly.1374GPL 3.0
- AlicenseNot gradedqualityDmaintenanceA GDB debugging tool designed for AI Agents (Claude Code, etc.)40Apache 2.0
- AlicenseBqualityDmaintenanceEnables AI assistants to start and manage LLDB debugging sessions, including loading programs, setting breakpoints, stepping through code, and examining memory.191MIT