pwndbg-mcp
An MCP tool that enables AI agents to debug ELF binaries, particularly for CTF pwn challenges.
README
pwndbg-mcp
An MCP tool endows AI agent with the capability to debug ELF. This tool is designed for regular CTF challenges, especially pwn ones.
[!IMPORTANT] It's recommended to use a tmux skill and pwndbg skill, and provide AI agent with a tmux session instead. Controlling pwndbg with MCP requires lots of tokens, and it's hard to support debugging with python script. Reference our 0RAYS/codex-pwner. (Though AI agent tends to use raw tools like reading /proc/mem to get information...)
Quickstart
As currently this repo has not been published on PyPI, clone this repo with
$ git clone https://github.com/RocketMaDev/pwndbg-mcp.git
Then use uv (install it if you don't have it) to pull dependencies and build venv, or install it as a tool.
$ uv tool install pwndbg-mcp
$ pwndbg-mcp
# or clone pwndbg-mcp and run it with uv manually
[!CAUTION] DON'T EXPOSE YOUR MCP SERVICE TO PUBLIC IF YOU DON'T DO ISOLATION! The tool
load_executable,execute_command(GDB command) andeval_to_send_to_processmay lead to remote code execution.
By default starting pwndbg-mcp without args launch a mcp server at localhost:8780 with gdb
as main pwndbg binary, /mcp as mcp connection end point, and HTTP streamable as transport.
Here is some help information:
usage: main.py [-h] [--transport {stdio,http,sse}] [--host HOST] [--port PORT] [--pwndbg BIN] [--d2dname NAME] [--d2dhost HOST] [--d2dport PORT]
pwndbg-mcp: An MCP tool endows AI agent with the capability to debug ELF
options:
-h, --help show this help message and exit
--transport {stdio,http,sse}, -t {stdio,http,sse}
Transport mode: stdio, http (streamable HTTP, default), or sse
--host HOST, -H HOST Host for HTTP/SSE modes (default: localhost)
--port PORT, -p PORT Port for HTTP/SSE modes (default: 8780)
--pwndbg BIN, -b BIN pwndbg binary to launch (default: gdb)
--d2dname NAME, -d NAME
Decomp2dbg section display name. Set this to enable decomp2dbg support
--d2dhost HOST, -D HOST
Decomp2dbg connection host
--d2dport PORT, -P PORT
Decomp2dbg connection port
It is recommended to wrap pwndbg-mcp in minimal container like bwrap since some agents
like Claude Code wants to execute binary under the same directory as where it runs.
Putting pwndbg-mcp in regular container like docker may lead to file path change.
The following line ro-bind your root, map your home as writable but temporary (any write action will not affect your home directory on disk), then bind common file systems, start a new pid namespace and finally start a bash.
$ bwrap --ro-bind / / --overlay-src ~ --tmp-overlay ~ --dev-bind /dev /dev --proc /proc --tmpfs /tmp --unshare-pid bash
Screenshot
<img width="2560" height="1100" alt="claude code with pwndbg-mcp" src="https://github.com/user-attachments/assets/4ea1508c-9a56-4541-ad93-28c4301dcc62" />
Preview tools
- GDB related
load_executableexecute_commandpwndbg_status(may be incorrect)debug_controlconnect_decomp2dbgpwndbg_hard_reset
- Interact with process
send_to_processeval_to_send_to_process(has access to pwntools)read_from_processinterrupt_process(the same as press Ctrl-C)
- pwndbg aliases
telescopecontextheapbinsbacktracevmmapxinfo
Use TOON as return format as it's both human-readable and token-saving.
Pros & Cons
This project draw some inspiration from pwno-mcp, and has some advantages and disadvantages.
Pros
- pwndbg-mcp utilizes GDB/MI for direct communication with GDB, no
echohacks - Interrupts are sent via tty, just like typing Ctrl-C on keyboard, no need to keep pid
eval_to_send_to_processprovides AI with the ability to send any binary data
Cons
- All communication are encapsulated and user can not observe gdb status
- This project targets local debugging, thus each instance only keep one GDB session
- Focused on debugging, requires other MCP to work together, e.g. IDA Pro MCP
- Sometimes Ctrl-C kills process or can't wake up GDB. No idea how this happens
Future roadmap
Please click :star: STAR and open issues (but don't spam) to push me developing these excellent features!
- [x] Integrate with decomp2dbg
- [ ] Integrate with pwntools (
gdb.debug/gdb.attach) - [ ] Attach to local process (untested)
- [ ] Attach to remote gdbserver (untested)
Credits
pwno-mcp: Provides great bootstrap framework for pwndbg-mcp
Contribution
Contributions are welcome! But no vibe coding (sending content all generated by AI is not allowed) and spams.
LICENSE
Copyright (C) 2025-present, RocketDev, distributed under MIT License.
Recommended Servers
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.
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.
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.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
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.
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.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.
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.