gdb-mcp
Click on "Install 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-mcpdebug remote binary with breakpoint at main"
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.
gdb-mcp is a high-privilege Model Context Protocol (MCP) server that allows Codex to control the GDB debugger via the GDB/MI interface and the pygdbmi library.
Supported deployment architectures for this project:
Windows 上的 Codex
-> Windows 上的 gdb-mcp MCP 服务端
-> Windows 本地 GDB
-> target remote / target extended-remote
-> linux 虚拟机中的 gdbserver
-> 虚拟机内的目标程序This server is specifically designed for local authorized debugging, CTF Pwn challenges, crash analysis, Core Dump analysis, exploit reproduction, and ELF file analysis. High-risk GDB commands are not permanently disabled; the first execution will return a warning, and the caller can run them by passing confirm=true upon retry.
Tool List
gdb_session: Start, stop, restart, and status query for local GDB sessionsgdb_load: Load local binaries, core files, symbol files, and startup argumentsgdb_exec: General GDB CLI command execution entry pointgdb_mi: Native GDB/MI command execution entry pointgdb_remote: Configure and connect to the virtual machine'sgdbservergdb_context: View registers, stack, disassembly, call stack, breakpoints, memory maps, and shared librariesgdb_memory: Memory read, write, search, and dumpgdb_register: Register read and writegdb_breakpoint: Normal breakpoints, hardware breakpoints, temporary breakpoints, and watchpointsgdb_run_control: Run, continue, step into, step over, instruction-level step, finish function, interrupt, kill program, and restartgdb_analyze: Crash and exploit feasibility analysisgdb_elf: Security checks (checksec), ELF headers, sections, segments, symbols, GOT/PLT, relocations, and stringsgdb_pwndbg: Compatible execution of pwndbg/gef/peda commands
All tools return a unified JSON structure:
{
"ok": true,
"tool": "gdb_exec",
"action": "exec",
"risk_level": "low",
"need_confirm": false,
"executed_with_risk": false,
"warning": null,
"data": {},
"stdout": "",
"stderr": "",
"raw": {},
"error": null
}Related MCP server: pwndbg-lldb-mcp
Installation
git clone https://github.com/traver88/gdb-mcp.gitThe supported runtime environment for this project is Python 3.12.
Windows Environment: Codex + Windows gdb-mcp + Virtual Machine gdbserver
Install Python isolated environment in the project directory
python --version
python -m venv .venv
.\.venv\Scripts\activate
pip install -e .Windows: Install GDB
Method A: MSYS2 MinGW64 GDB
Install MSYS2
Open MSYS2 MinGW64 terminal
Execute:
pacman -Syu # 之后重启 MSYS2
pacman -S gdb gdb-multiarchAdd
C:\msys64\mingw64\binto WindowsPATHVerify:
gdb --version
gdb-multiarch --versionRun smoke_test
gdb-mcp项目目录下:
.\.venv\Scripts\activate
python tests\smoke_test.pySuccess will output:
smoke test passedsmoke_test.py test content:
Start Windows local GDB
Load test program compiled from
examples/hello.cSet breakpoint at
mainRun program
Read registers
Read stack
Disassemble
Close GDB
Virtual Machine (Ubuntu/Kali) Configuration
Install gdbserver
sudo apt update
sudo apt install -y gdbserver gdb gcc make binutils fileStart target program
cd xxx/xxx/
gdbserver 0.0.0.0:1234 ./pwnWindows side connectivity test
powershell:
ping 192.168.56.101
Test-NetConnection 192.168.56.101 -Port 1234Codex Configuration config.toml
[mcp_servers.gdb-mcp]
command = "D:\\gdb-mcp\\.venv\\Scripts\\python.exe"
args = ["D:\\gdb-mcp\\server.py"]command: Points to the Python program that starts the MCP serverargs: Points to theserver.pyserver entry point
Codex Usage Example
Requirement example:
请使用 gdb-mcp:
- 启动 GDB
- 加载本地符号文件 E:/ctf/pwn/pwn
- 连接 192.168.56.101:1234 的 gdbserver
- 在 main 下断点
- continue
- 显示寄存器、栈、RIP 附近反汇编、backtraceEquivalent MCP call:
gdb_session(action="start")
gdb_remote(
action="connect",
host="192.168.56.101",
port=1234,
mode="remote",
local_binary="E:/ctf/pwn/pwn",
confirm=true
)
gdb_breakpoint(action="add", location="main")
gdb_run_control(action="continue")
gdb_register(action="read_all")
gdb_memory(action="read", address="$rsp", size=160)
gdb_exec(command="x/20i $rip")
gdb_exec(command="bt")
gdb_context(depth=20)Equivalent GDB command:
file "E:/ctf/pwn/pwn"
target remote 192.168.56.101:1234
b main
c
info registers
x/20gx $rsp
x/20i $rip
btExtended remote mode
Virtual machine:
gdbserver --multi 0.0.0.0:1234MCP call:
gdb_remote(
action="connect",
host="192.168.56.101",
port=1234,
mode="extended-remote",
local_binary="E:/ctf/pwn/pwn",
remote_binary="/xxx/pwn",
confirm=true
)
gdb_breakpoint(action="add", location="main")
gdb_run_control(action="run")
gdb_context(depth=20)Internal GDB command:
file "E:/ctf/pwn/pwn"
set remote exec-file /xxx/pwn
target extended-remote 192.168.56.101:1234FAQ
Windows cannot ping the virtual machine: Check VM IP and network adapter mode
Cannot connect to port 1234: Confirm
gdbserveris runninggdbserveronly listening locally: Usegdbserver 0.0.0.0:1234 ./pwnWindows firewall blocking: Allow GDB or the corresponding port
VM NAT mode inaccessible: Switch to Host-only/Bridged adapter or configure port forwarding
local_binaryandremote_binaryconfusion: The former is the Windows path, the latter is the Linux pathWindows GDB cannot parse Linux ELF: Use a multi-architecture GDB for the corresponding architecture
info proc mappingsunavailable in remote mode:gdb_contextwill mark it as unavailable instead of crashingMissing remote libc symbols: Use
gdb_remote(action="set_sysroot", ...)orset_solib_search_path
Risk Operation Confirmation
Examples of high-risk commands requiring confirmation:
target remote HOST:PORTtarget extended-remote HOST:PORTdisconnectdetachset remote exec-file PATHset sysroot PATHset solib-search-path PATHshell ...source ...python ...dump memory ...restore ...maintenance ...
First call:
gdb_exec(command="target remote 192.168.56.101:1234")Server returns need_confirm=true, retry with confirmation:
gdb_exec(command="target remote 192.168.56.101:1234", confirm=true)After execution, the return contains executed_with_risk=true.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseAqualityCmaintenanceMCP server that exposes GDB debugging as tools. An AI assistant can set breakpoints, run programs, step through code, inspect variables and memory, and examine registers — all via structured tool calls. Reverse debugging with rr is also supported.343MIT
- AlicenseCqualityDmaintenanceAn MCP server that exposes pwndbg commands running under LLDB as tools for AI assistants. This enables AI-driven binary analysis, exploit development, and reverse engineering through pwndbg's enhanced debugging capabilities.1001MIT
- AlicenseAqualityDmaintenanceAn MCP server that enables AI assistants to control GDB debugging sessions, including breakpoint management, thread analysis, and variable inspection, using the GDB/MI protocol.221MIT
- FlicenseNot gradedqualityDmaintenanceEnables dynamic debugging with GDB via the MCP protocol, allowing LLMs to execute GDB commands, manage breakpoints, control execution, and inspect program state.4
Related MCP Connectors
Live browser debugging for AI assistants — DOM, console, network via MCP.
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
Persistent memory and cross-session learning for AI coding assistants (hosted remote MCP).
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/traver88/gdb-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server