GDB MCP Server
This server provides an MCP interface for starting, controlling, and querying GDB and LLDB debugging sessions from AI assistants.
Start new GDB or LLDB debugging sessions, optionally specifying a debugger path
Auto-detect and start a debugger with
debugger_startExecute arbitrary debugger commands (GDB, LLDB, or unified) on active sessions
Terminate active debugging sessions by session ID
List all active debugging sessions for GDB, LLDB, or both
Check the availability/status of installed debuggers
Integrates with Claude Desktop, VSCode Copilot, and Windsurf via MCP
Enables interaction with GDB (GNU Debugger) for debugging and binary analysis, providing tools for session management, program loading, execution control, breakpoint setting, and memory/register examination.
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., "@GDB MCP Server debug the 'server' binary and show me the backtrace of the current crash"
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.
MDB-MCP
An MCP server that gives your AI assistant a real debugger. It drives GDB or LLDB, so the assistant can set breakpoints, run your program, read memory and walk the stack the same way you would.
Install
You need uv and at least one debugger:
# Debian / Ubuntu
sudo apt install gdb lldb python3-lldb
# macOS (LLDB ships with the Xcode command line tools)
xcode-select --installThen add the server to your client. For Claude Code:
claude mcp add mdb -- uvx --from git+https://github.com/smadi0x86/MDB-MCP mdb-mcpFor Claude Desktop, Cursor or Windsurf:
{
"mcpServers": {
"mdb": {
"command": "uvx",
"args": ["--from", "git+https://github.com/smadi0x86/MDB-MCP", "mdb-mcp"]
}
}
}VS Code takes the same entry under "servers" in .vscode/mcp.json, with
"type": "stdio" added. On Windows with WSL, set "command": "wsl" and put the full
path to uvx at the start of args.
Related MCP server: LLDB MCP Server
Tools
debugger_status which debuggers are usable, and the open sessions
debugger_start start a gdb or lldb session, optionally loading a program
debugger_command run any gdb or lldb command
debugger_interrupt pause a running program, like Ctrl-C
debugger_terminate kill the program and close the sessionEverything else is a normal debugger command, so break main, bt, x/16gx $sp
and frame variable all work. Commands that resume the program wait for it to stop
(10 seconds by default, adjustable per call). If it is still running after that, the
assistant can interrupt it or keep waiting.
GDB is the default on Linux and LLDB on macOS. Either can be picked explicitly. GDB
loads your ~/.gdbinit, so pwndbg and GEF keep working.
Try it
make -C examplesThen ask your assistant why examples/crash segfaults (give it the absolute path).
Configuration
To use a debugger other than the one on your PATH, set it in the server's env in
your client config:
"env": {
"MDB_GDB_PATH": "gdb-multiarch",
"MDB_LLDB_PATH": "/opt/homebrew/opt/llvm/bin/lldb"
}Troubleshooting
If LLDB shows up as unavailable, debugger_status tells you why. On Debian and
Ubuntu it is usually a missing python3-lldb, which has to match your LLDB version.
The program can't read from your keyboard. Feed it a file instead:
run < input.txt # gdb
process launch -i input.txt # lldbIf attaching to a running process fails on Linux, check
/proc/sys/kernel/yama/ptrace_scope. A value of 1 only allows debugging child
processes.
Security
A debugger can run shell commands (shell, python, platform shell, script),
and the programs you debug run as your user. Only debug code you trust, and keep
tool approval on for debugger_command unless you are in a sandbox.
Development
uv sync
uv run pytest # tests for a missing debugger are skipped
uv run ruff check . && uv run ruff format --check .The demo above is recorded from real tool calls with demo/record.py. See the top of
that file for how to regenerate it.
License
GPL-3.0
Available Tools
13 toolsdebugger_commandC
Execute an arbitrary debugger command.
Inputs: session_id (required), command (required). Returns: result
debugger_list_sessionsB
List all active debugging sessions.
Inputs: no named parameters. Returns: result
debugger_startC
Start a debugging session with auto-detection or specified debugger type.
Inputs: debugger_type_param, debugger_path. Returns: result
debugger_statusB
Get status of available debuggers.
Inputs: no named parameters. Returns: result
debugger_terminateB
Terminate a debugging session.
Inputs: session_id (required). Returns: result
gdb_commandC
Execute any arbitrary GDB command. Use this for all GDB operations.
Inputs: session_id (required), command (required). Returns: result
gdb_list_sessionsB
List all active GDB sessions.
Inputs: no named parameters. Returns: result
gdb_startC
Start a new GDB debugging session.
Inputs: gdb_path. Returns: result
gdb_terminateB
Terminate a GDB debugging session.
Inputs: session_id (required). Returns: result
lldb_commandC
Execute an arbitrary LLDB command.
Inputs: session_id (required), command (required). Returns: result
lldb_list_sessionsB
List all active LLDB sessions.
Inputs: no named parameters. Returns: result
lldb_startB
Start a new LLDB debugging session.
Inputs: lldb_path. Returns: result
lldb_terminateB
Terminate an LLDB debugging session.
Inputs: session_id (required). Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 13 tools
There is significant ambiguity between the generic debugger_* tools and the specific gdb_* and lldb_* tools. For example, debugger_start and gdb_start/lldb_start appear to serve overlapping purposes, and the descriptions don't clarify when to use which. This creates confusion about tool selection boundaries.
All tool names follow a consistent verb_noun pattern with snake_case throughout. The naming is predictable and organized, with clear prefixes (debugger_, gdb_, lldb_) for different tool groups.
13 tools is a reasonable count for a debugger server, but it feels borderline due to redundancy. The duplication between generic and specific tools makes the set feel heavier than necessary, suggesting the count could be optimized.
The tool set covers essential debugger operations: starting, listing, terminating sessions, and executing commands for both GDB and LLDB. Minor gaps might include session-specific status queries or more granular control, but core debugging workflows are well-supported.
Maintenance
Related MCP Connectors
Use your Mac, Windows or Linux computer from ChatGPT, Claude or Codex: files, commands, documents.
Compile code with thousands of compilers, inspect the assembly, and share godbolt.org links
Operate Linux, macOS and Windows from your LLM. Every action runs through an auditable allowlist.
Source-checked CLI guides and model-aware planning for Claude Code, Codex, and Grok Build.
Related MCP Servers
- AlicenseBqualityDmaintenanceProvides GDB debugging functionality for use with Claude or other AI assistants, allowing users to manage debugging sessions, set breakpoints, examine variables, and execute GDB commands through natural language.16111 npm161MIT
- 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
- FlicenseAqualityDmaintenanceEnables AI agents to debug embedded systems by providing a comprehensive interface for GDB operations across multiple architectures like ARM and x86. It supports remote debugging via gdbserver or QEMU, allowing for detailed inspection of memory, registers, stack frames, and variables.31-
- FlicenseNot gradedqualityDmaintenanceEnables dynamic debugging with GDB via the MCP protocol, allowing LLMs to execute GDB commands, manage breakpoints, control execution, and inspect program state.3-