A Model Context Protocol (MCP) server that provides GDB debugging functionality for use with Claude or other AI assistants.
- 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
- Execute arbitrary GDB commands
npm install mcp-gdb
You can use the package in your Node.js project:
import { startGdbServer } from 'mcp-gdb';
// Start the server programmatically
startGdbServer();
# Clone the repository
git clone https://github.com/signal-slot/mcp-gdb.git
cd mcp-gdb
npm install
npm run build
- Configure the MCP settings in the Claude desktop app or browser extension to include this server:
{
"mcpServers": {
"gdb": {
"command": "node",
"args": ["/path/to/mcp-gdb/build/index.js"],
"disabled": false
}
}
}
If you installed via NPM, you can reference the package in node_modules:
{
"mcpServers": {
"gdb": {
"command": "node",
"args": ["node_modules/mcp-gdb/build/index.js"],
"disabled": false
}
}
}
-
Restart Claude or refresh the page.
-
Now you can use the GDB tools in your conversations with Claude.
Here are some examples of using the GDB MCP server through Claude:
Use gdb_start to start a new debugging session
Use gdb_load to load /path/to/my/program with the sessionId that was returned from gdb_start
Use gdb_set_breakpoint to set a breakpoint at main in the active GDB session
Use gdb_continue to start execution
Use gdb_print to evaluate the expression "my_variable" in the current context
Use gdb_backtrace to see the current call stack
Use gdb_terminate to end the debugging session
The mcp-gdb
package is available on npm and provides all the functionality needed to integrate GDB debugging with MCP-enabled AI assistants.
- Current Version: 0.1.0
- Main: build/index.js
- Type: ESM module
- License: MIT
- Keywords: gdb, debug, mcp
- Repository: GitHub
-
gdb_start
: Start a new GDB session -
gdb_load
: Load a program into GDB -
gdb_command
: Execute an arbitrary GDB command -
gdb_terminate
: Terminate a GDB session -
gdb_list_sessions
: List all active GDB sessions -
gdb_attach
: Attach to a running process -
gdb_load_core
: Load a core dump file -
gdb_set_breakpoint
: Set a breakpoint -
gdb_continue
: Continue program execution -
gdb_step
: Step program execution -
gdb_next
: Step over function calls -
gdb_finish
: Execute until the current function returns -
gdb_backtrace
: Show call stack -
gdb_print
: Print value of expression -
gdb_examine
: Examine memory -
gdb_info_registers
: Display registers
MIT