gdb_pwndbg
Run pwndbg, gef, or peda helper commands within GDB to debug crashes, inspect ELF binaries, and solve CTF Pwn challenges.
Instructions
Execute pwndbg/gef/peda helper commands if they appear available.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| command | Yes | ||
| confirm | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- server.py:1408-1408 (registration)MCP tool registration decorator for gdb_pwndbg
@mcp.tool() - server.py:1408-1442 (handler)Full handler function for the gdb_pwndbg tool. Executes pwndbg/gef/peda helper commands with availability checks, risk assessment, and confirmation gating.
@mcp.tool() def gdb_pwndbg(command: str, confirm: bool = False) -> dict[str, Any]: """Execute pwndbg/gef/peda helper commands if they appear available.""" if not ENABLE_PWNDBG_COMMANDS: return make_result(ok=False, tool="gdb_pwndbg", action="plugin", error="pwndbg commands are disabled") try: assessment = assess_gdb_command(command) gated = _risk_gate(tool="gdb_pwndbg", action="plugin", command=command, assessment=assessment, confirm=confirm) if gated: return gated availability_checks = { "pwndbg": _exec_cli_internal("help pwndbg", parse=False).ok, "gef": "GEF" in _exec_cli_internal("gef config", parse=False).stdout, "peda": _exec_cli_internal("help peda", parse=False).ok, } if not any(availability_checks.values()): return make_result( ok=False, tool="gdb_pwndbg", action="plugin", data={"available": False, "checks": availability_checks}, error="pwndbg/gef/peda does not appear to be loaded in this GDB session", ) res = _exec_cli_internal(command, timeout=DEFAULT_TIMEOUT, parse=True) return _command_result_to_tool_result( tool="gdb_pwndbg", action="plugin", command=command, result=res, assessment=assessment, confirmed=confirm, ) except Exception as exc: return make_result(ok=False, tool="gdb_pwndbg", action="plugin", error=str(exc)) - server.py:1409-1409 (schema)Function signature/parameters for gdb_pwndbg: command (str) and confirm (bool, default False)
def gdb_pwndbg(command: str, confirm: bool = False) -> dict[str, Any]: - config.py:52-52 (helper)Configuration flag ENABLE_PWNDBG_COMMANDS controlling whether pwndbg tools are enabled
ENABLE_PWNDBG_COMMANDS = _env_bool("GDB_MCP_ENABLE_PWNDBG_COMMANDS", True)