pwndbg-mcp

pwndbg-mcp

MCP server that exposes pwndbg and GDB for binary debugging, enabling memory inspection, exploit development, remote debugging, and kernel analysis.

Category
Visit Server

README

<h1 align="center">pwndbg-mcp</h1>

<p align="center"> <strong>Debug binaries with pwndbg and GDB from your AI client</strong> </p>

<p align="center"> <a href="#configure-clients"><img alt="Claude Code Supported" src="https://img.shields.io/badge/Claude%20Code-Supported-D8B4A0?style=flat-square&logo=claude&logoColor=white"></a> <a href="#configure-clients"><img alt="Codex Supported" src="https://img.shields.io/badge/Codex-Supported-B8C0E0?style=flat-square&logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA1MTIgNTEyIj48cGF0aCBmaWxsPSIjZmZmIiBkPSJNMTk2LjQgMTg1LjhsMC00OC42YzAtNC4xIDEuNS03LjIgNS4xLTkuMmw5Ny44LTU2LjNjMTMuMy03LjcgMjkuMi0xMS4zIDQ1LjYtMTEuMyA2MS40IDAgMTAwLjQgNDcuNiAxMDAuNCA5OC4zIDAgMy42IDAgNy43LS41IDExLjhMMzQzLjMgMTExLjFjLTYuMS0zLjYtMTIuMy0zLjYtMTguNCAwTDE5Ni40IDE4NS44ek00MjQuNyAzNzUuMmwwLTExNi4yYzAtNy4yLTMuMS0xMi4zLTkuMi0xNS45TDI4NyAxNjguNCAzMjkgMTQ0LjNjMy42LTIgNi43LTIgMTAuMiAwTDQzNyAyMDAuN2MyOC4yIDE2LjQgNDcuMSA1MS4yIDQ3LjEgODUgMCAzOC45LTIzIDc0LjgtNTkuNCA4OS42bDAgMHpNMTY2LjIgMjcyLjhsLTQyLTI0LjZjLTMuNi0yLTUuMS01LjEtNS4xLTkuMmwwLTExMi42YzAtNTQuOCA0Mi05Ni4zIDk4LjgtOTYuMyAyMS41IDAgNDEuNSA3LjIgNTguNCAyMEwxNzUuNCAxMDguNWMtNi4xIDMuNi05LjIgOC43LTku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TIzLjQgMCAzNS44IDE1LjQgNzAuNyA0MyA5NS43LTIuNiAxMC44LTQuMSAyMS41LTQuMSAzMi4zIDAgNzMuMiA1OS40IDEyOCAxMjggMTI4IDEzLjggMCAyNy4xLTIgNDAuNC02LjcgMjMgMjIuNSA1NC44IDM2LjkgODkuNiAzNi45eiIvPjwvc3ZnPg%3D%3D"></a> <a href="https://www.python.org/"><img alt="Python 3.11+" src="https://img.shields.io/badge/python-3.11%2B-A8C7E6?style=flat-square&logo=python&logoColor=white"></a> <a href="LICENSE"><img alt="MIT license" src="https://img.shields.io/badge/license-MIT-BFD8B8?style=flat-square&logo=github&logoColor=white"></a> <a href="#installation"><img alt="Linux platform" src="https://img.shields.io/badge/platform-Linux-C8C2B8?style=flat-square&logo=linux&logoColor=white"></a> </p>


Overview

pwndbg-mcp runs a local GDB session with pwndbg loaded and exposes it to an MCP client. The client reads live debugger state and runs approved commands against it. Built for pentesting, CTF pwn, exploit development, and crash analysis.

Run the server on the analysis machine, next to GDB and the target. It starts GDB in MI mode and expects your own GDB setup to load pwndbg. The inferior gets a PTY, so clients can read it, write to it, and interrupt interactive programs. The server tracks inferior state, and any tool that needs it stopped checks first.

Background

This started from RocketMaDev/pwndbg-mcp, which drives pwndbg over MCP for ELF and CTF pwn work in 19 tools, and whose PTY and controller scaffold this project's bridge.py is derived from. That project in turn credits pwno-mcp as its bootstrap framework.

What this adds: 169 tools against their 19, attach by PID or process name, remote gdbserver over target remote and target extended-remote, decompiler context through pwndbg's di commands rather than decomp2dbg directly, and an installer that writes a per-tool approval inventory into the client's config.

Features

169 registered tools, split 84 read-only and 85 mutating. Serve them over stdio, HTTP, or SSE.

Area What it covers
Debugger control Load binaries, attach by PID or name, set arguments, reset GDB, run/start variants, step/next/continue/finish, move stack frames, kill the inferior.
State and context Server and inferior state, pwndbg help and command listings, config/theme get and set, context sections, ctx_watch entries.
Inspection Mappings, memory, registers, stack, disassembly, breakpoints, ELF/libc state, heap chunks, bins, process info.
Mutation and exploit helpers Write memory and registers, breakpoints and watchpoints, patch code, spray memory, cyclic patterns, ROP/ropper/one-gadget/leakfind, syscall and fd helpers.
Remote workflows pwncat sessions: open, listen, list, read, send, close, and a zero-I/O scan. Plus target remote, target extended-remote, and a remote exploit template.
Kernel views pwndbg kernel helpers for BPF, binder, buddy allocator, nftables, tasks, modules, syscalls, slabs, dmesg, and kernel metadata.
Decompiler integration Check the di endpoint, connect, disconnect, sync symbols, request decomp [addr] [lines].

For the full list, read src/pwndbg_mcp/tools/_registry.py or ask a client for tools/list.

Large results are capped, and anything truncated says so in its response. src/pwndbg_mcp/util.py holds the limits. A GDB command that fails comes back as an MCP error, not as partial output that looks like success.

Installation

Prerequisites: Linux, Python 3.11+, uv, GDB, pwndbg.

From a clone, with client configuration:

git clone https://github.com/h0w1tzxr/pwndbg-mcp.git
cd pwndbg-mcp
python install.py
pwndbg-mcp doctor

Tool only:

uv tool install git+https://github.com/h0w1tzxr/pwndbg-mcp.git
pwndbg-mcp doctor

Configure clients

Two entry points:

  • python install.py is interactive. It installs the tool and configures Claude Code, Codex, or both. Only it accepts --clients and --codex-config.
  • pwndbg-mcp install does Claude Code only. It has no Codex flags.

The server uses FastMCP, whose CLI exposes stdio (the default), HTTP, and SSE. Any client that can launch a stdio server works; configure those yourself.

Claude Code

pwndbg-mcp install --scope user
pwndbg-mcp status

That registers the server over stdio and writes one exact rule per tool: read-only tools into permissions.allow, mutating tools into permissions.ask. Use --unsafe only in an isolated test environment. It moves both inventories to allow.

User, project, and local policies live in ~/.claude/settings.json, .claude/settings.json, and .claude/settings.local.json. --scope selects only the Claude Code scope. Without the Claude CLI, the JSON fallback supports user and project scopes, and local scope requires the CLI.

Codex

Configure Codex through python install.py --codex-config (default ~/.codex/config.toml). Any Claude scope other than user leaves the Codex path unset, so pass --codex-config yourself when you configure both. Codex manages approvals itself, and the installer's per-tool inventory is not written there.

Manual configuration:

[mcp_servers.pwndbg]
command = "pwndbg-mcp"
args = [
  "--transport", "stdio",
  "--pwndbg", "gdb",
]

If the client cannot find the binary, use the absolute path from command -v pwndbg-mcp.

tools/list publishes standard MCP readOnlyHint and destructiveHint annotations from the same inventories. They are advisory; the client's approval policy decides.

Decompiler integration

Requires pwndbg 2026.02.18 or newer, which exposes one decompiler-integration command (aliased di) for IDA, Binary Ninja, Ghidra, and angr-management. A local provider also needs decomp2dbg in pwndbg's own Python environment. That is not a pwndbg-mcp dependency.

Stop the inferior first, then:

  1. Call decompiler_status. It reports the command, pwndbg version, host, port, live provider, and the installed and required dependency versions.
  2. Install a matching plugin with pwndbg's di install <provider>. This writes files and may download a plugin, so run it through the approval-gated execute_command tool only after review.
  3. Open the same binary in the decompiler and start its server with Ctrl+Shift+D.
  4. Call decompiler_connect, then decompiler_sync once the inferior starts.
  5. Call decomp with an optional address and line count. Call decompiler_disconnect when done.

A dependency or provider mismatch raises MissingDependency. A closed listener raises RemoteConnectionError naming its endpoint. For a local provider, pass literal localhost to decompiler_connect so pwndbg runs its local dependency and version checks.

IDA and Ghidra expose unauthenticated, unencrypted XML-RPC. Bind their listeners only to 127.0.0.1:3662 and confirm the socket with ss. Linux may show the same IPv4-mapped loopback as [::ffff:127.0.0.1]:3662. Reject wildcard and non-loopback listeners.

Remote debugging

Load local symbols before connecting:

file /path/to/local/binary
set sysroot /path/to/target-root

Then call gdb_target_remote for a regular gdbserver target, or gdb_target_extended_remote for extended mode. A failed connection names the endpoint. To recover, restart gdbserver, run disconnect through the approval-gated execute_command tool before reconnecting, or call mcp_hard_reset when GDB stops responding.

remote_pwncat_* needs pwncat (uv tool install pwncat). ROP helpers report a missing ROPgadget, ropper, one_gadget, or pwntools and name the install. leakfind ships with pwndbg and needs no external binary.

To find your way around, call version_info, then list_pwndbg_commands, then pwndbg_help on whatever looks useful. Clients can also use tools/list.

Development

Clone it, then work with uv directly:

uv tool install --editable . --reinstall   # link for development
uv run --extra dev ruff check src/         # lint
uv run --extra dev mypy src/               # typecheck
uv run --extra dev ruff format src/        # format
uv build                                   # wheel + sdist
pwndbg-mcp doctor                          # check gdb, pwndbg, and PATH

List the tool surface over stdio:

echo '{"jsonrpc":"2.0","id":1,"method":"tools/list"}' | pwndbg-mcp --transport stdio --pwndbg gdb

Before publishing or handing off:

uv run --extra dev ruff check src/
uv run --extra dev mypy src/
uv build
uv lock --check
git diff HEAD --check

Check the registry split:

uv run --extra dev python - <<'PY'
from pwndbg_mcp.tools._registry import SAFE_TOOLS, MUTATING_TOOLS
print(len(SAFE_TOOLS), len(MUTATING_TOOLS), len(SAFE_TOOLS) + len(MUTATING_TOOLS))
PY

Expected output:

84 85 169

Layout:

  • src/pwndbg_mcp/bridge.py: GDB/MI controller, PTY handling, state tracking, response parsing.
  • src/pwndbg_mcp/tools/: tool modules grouped by debugging domain.
  • src/pwndbg_mcp/tools/_registry.py: FastMCP singleton and the read-only and mutating inventories.
  • src/pwndbg_mcp/installer/: client registration and config helpers.
  • install.py: interactive installer.

Credits

Built on pwndbg, whose command surface this server exposes, and GDB underneath it.

RocketMaDev/pwndbg-mcp (MIT, Copyright (C) 2025-present RocketDev) is where the PTY and controller scaffold in bridge.py comes from, along with much of the tool naming. It credits pwno-mcp as its own bootstrap framework. pwntools does the payload-oriented process I/O.

Also ida-pro-mcp, FastMCP, and pygdbmi.

License

MIT. See LICENSE.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured