
smadi0x86/mdb-mcp 是从 https://github.com/smadi0x86/mdb-mcp. 导入的 MCP 服务器候选服务器。
概览
smadi0x86/mdb-mcp 是从 https://github.com/smadi0x86/mdb-mcp. 导入的 MCP 服务器候选服务器。
概述(AI 翻译)
一个MCP服务器,为你的AI助手提供真正的调试器。它驱动GDB或LLDB, 所以助手可以设置断点、运行程序、读取内存并走动 堆叠方式和你平时一样。
安装
你需要 uv 和至少一个调试器:
然后把服务器添加到你的客户端。关于Claude代码:
针对Claude桌面、光标或风帆冲浪:
VS Code 在 .vscode/mcp.json 中以 "servers" 下相同的条目,且
"type": "stdio" 添加。在 Windows 上,设置 "command": "wsl" 并放入完整
在args起始处的路径。
工具
其他所有操作都是普通的调试器命令,比如 break main、bt、x/16gx $sp
frame variable 都正常工作。恢复程序的命令等待程序停止
(默认为10秒,每次通话可调整)。如果超过这个时间还在运行,
助理可以打断,或者继续等待。
在Linux上默认使用GDB,macOS上使用LLDB。任一都可以明确选择。GDB
加载你的~/.gdbinit,所以pwndbg和GEF继续工作。
试试看
然后问你的助理为什么examples/crash会有分断错误(给出绝对路径)。
配置
要使用除你 PATH 上的调试器,请在服务器的 env 中设置它
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
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 --install
Then add the server to your client. For Claude Code:
claude mcp add mdb -- uvx --from git+https://github.com/smadi0x86/MDB-MCP mdb-mcp
For 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.
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 session
Everything 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 examples
Then 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 # lldb
If 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),
安装
uvx --from git+https://github.com/smadi0x86/MDB-MCP mdb-mcp配置
{
"mcpServers": {
"mdb": {
"command": "uvx",
"args": ["--from", "git+https://github.com/smadi0x86/MDB-MCP", "mdb-mcp"]
}
}
}