pwndbg-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., "@pwndbg-mcpdebug the segfault at address 0x400500"
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.
pwndbg-mcp
MCP Server for pwndbg - 让 AI Agent 能够通过标准 MCP 协议控制 pwndbg 进行协作调试
特性
✅ 标准 HTTP MCP 协议
✅ 支持远程访问
✅ 自动启动,无需手动初始化
✅ 完整的 GDB/pwndbg 命令支持
✅ 支持人机协作调试
✅ 实时状态同步
✅ 模块化架构,易于扩展
Related MCP server: pwndbg-lldb-mcp
快速开始
安装
运行安装脚本:
python3 setup.py按照提示操作,脚本会:
检查依赖
自动添加到 ~/.gdbinit
配置自动加载
手动安装
在 ~/.gdbinit 中添加:
source /path/to/pwndbg-mcp/pwndbg_mcp.py使用
1. 启动 pwndbg
gdb ./your_binaryHTTP MCP 服务器会自动启动在 127.0.0.1:22334
2. 管理命令
# 查看状态
pwndbg> mcp-status
# 启动服务器(支持自定义配置)
pwndbg> mcp-start # 默认 127.0.0.1:22334
pwndbg> mcp-start 0.0.0.0 # 监听所有接口,端口22334
pwndbg> mcp-start 0.0.0.0 9000 # 自定义host和port
pwndbg> mcp-start 9000 # 只改端口
# 停止服务器
pwndbg> mcp-stop3. 配置 Claude Code
在 Claude Code 的 MCP 配置中添加:
{
"mcpServers": {
"pwndbg-mcp": {
"url": "http://127.0.0.1:22334"
}
}
}4. 开始调试
在 Claude Code 中可以直接使用 MCP 工具控制 pwndbg!
支持的工具
工具 | 描述 |
| 执行 GDB/pwndbg 命令 |
| 获取寄存器状态 |
| 读取内存 |
| 设置断点 |
| 删除断点 |
| 列出所有断点 |
| 继续执行 |
| 单步进入 |
| 单步执行指令 |
| 单步跳过 |
| 下一条指令 |
| 获取调用栈 |
| 获取程序信息 |
架构
模块化设计
pwndbg_plugin/
├── __init__.py - 插件入口,自动启动
├── http_bridge.py - HTTP MCP 服务器
├── commands.py - 用户管理命令
├── wrappers.py - 内部包装命令
├── queries.py - 查询接口
├── events.py - 事件处理
└── utils.py - 工具函数通信协议
传输: HTTP POST
协议: 标准 MCP (Model Context Protocol)
端点:
POST /或POST /mcp格式: JSON-RPC 2.0
配置
安全建议
默认监听 127.0.0.1(仅本地访问)。如需远程访问:
pwndbg> mcp-start 0.0.0.0 22334⚠️ 警告:开放远程访问前请确保网络安全
防火墙配置
如果需要远程访问,确保防火墙允许端口:
# UFW
sudo ufw allow 22334/tcp
# iptables
sudo iptables -A INPUT -p tcp --dport 22334 -j ACCEPT故障排查
检查服务器状态
pwndbg> mcp-status测试连接
curl -X POST http://127.0.0.1:22334/ \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"initialize","params":{},"id":1}'查看日志
服务器输出会显示在 pwndbg 终端中
开发
添加新工具
在
queries.py中添加查询函数在
http_bridge.py的_get_tools_list()中注册工具在
_execute_tool()中添加工具映射
测试
cd examples
gdb test_program
pwndbg> startLicense
MIT
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- 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/liert/pwndbg-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server