re-dyn-mcp

re-dyn-mcp

A dynamic-analysis MCP server for reverse-engineering the Broadcom BCM6726b0 WiFi driver, enabling live GDB debugging of the QEMU dhd harness with breakpoints, stepping, and memory inspection.

Category
访问服务器

README

@nebuloss/re-dyn-mcp

A dynamic-analysis MCP server for the GT-BE98 / Broadcom BCM6726b0 WiFi-driver reverse-engineering effort. It drives gdb-multiarch over GDB/MI against the QEMU dhd harness gdbstub, and manages the harness lifecycle (run / stop / logs).

This is the runtime/dynamic counterpart to the static stack:

Server Repo What it does
re (radare2) r2-re-mcp static disassembly, xrefs, signatures
utils re-utils-mcp binwalk, source search
dyn this repo live gdb against the booting harness

Topology — this is a DIRECT MCP entry, not behind mcpproxy

re-dyn-mcp runs on dev-build (10.0.50.21), because that is where QEMU, gdb-multiarch, the kernel symbols (vmlinux.harness), and the harness scripts live. The build never leaves dev-build.

Unlike the static servers (re/utils/files/ghidra), which are aggregated behind mcpproxy on the RE container, dyn is registered directly in the client's .mcp.json as:

{ "dyn": "http://10.0.50.21:8781/mcp" }

It is not a mcpproxy upstream. Dynamic debugging is stateful and latency- sensitive (a live gdb session, breakpoints, single-stepping) — fronting it behind the proxy's retrieve_tools / call_tool indirection added latency and an approval gate for no benefit. The client talks to it straight over VLAN 50, so it binds 0.0.0.0 (not loopback).

Tools (18)

Harness lifecycle

Tool Purpose
harness_run Boot the QEMU dhd harness (run-harness-dhd.sh) in the background, gdbstub on :1234. setsid + pidfile so harness_stop can kill the whole process group.
harness_stop Kill the running harness (and any attached gdb session).
harness_logs Tail the harness boot / dhd-probe / IPC trace (traces/dhd-harness.log).

gdb session

Tool GDB/MI Purpose
gdb_connect -target-select remote Attach to the harness gdbstub (default localhost:1234), load symbols.
gdb_break -break-insert Breakpoint at symbol, file:line, *0xADDR, or fn+off.
gdb_continue -exec-continue Resume; report where it halts.
gdb_step -exec-step Step into (source line).
gdb_next -exec-next Step over (source line).
gdb_finish -exec-finish Run to caller.
gdb_stepi -exec-step-instruction Single instruction.
gdb_interrupt SIGINT Halt a running target, report where it stopped.
gdb_regs -data-list-register-values x Registers in hex.
gdb_mem -data-read-memory-bytes Read count bytes at an address/expr.
gdb_bt -stack-list-frames Call stack.
gdb_eval -data-evaluate-expression Evaluate a C/gdb expression in the current frame.
gdb_cmd (raw) Escape hatch — run an arbitrary gdb/MI command.
gdb_status Whether a gdb session is live; default target/symbols.
gdb_disconnect Detach and terminate the gdb process.

Typical workflow

harness_run                      # boot the dhd harness, gdbstub :1234 (GDB=1 set internally)
gdb_connect                      # attach gdb-multiarch, load vmlinux.harness symbols
gdb_break  brcmf_pcie_probe      # set a breakpoint on the probe path
gdb_continue                     # run to it
gdb_bt ; gdb_regs ; gdb_mem ...  # inspect
gdb_disconnect
harness_stop                     # tear the harness down

Config (environment)

Var Default Meaning
RE_DYN_PORT 8781 HTTP listen port.
RE_DYN_HOST 0.0.0.0 Bind address (cross-host: the client is on dev-code).
HARNESS_DIR Dir holding run-harness-dhd.sh (the QEMU dhd harness).
HARNESS_GDB localhost:1234 gdbstub address the harness exposes.
HARNESS_VMLINUX Kernel image with symbols for gdb to load.
GDB_BIN gdb-multiarch gdb binary.
LOG_LEVEL info Log verbosity.

The MCP endpoint is POST /mcp; GET /health returns {"status":"ok"}.

Build & run

npm install
npm run build        # tsc -> dist/
npm start            # node dist/server.js

Deploy (dev-build)

sudo cp systemd/re-dyn-mcp.service /etc/systemd/system/
sudo systemctl daemon-reload && sudo systemctl enable --now re-dyn-mcp
# expects the built server at /opt/re-dyn-mcp/dist/server.js

The service runs as guillaume (not root) so harness_run behaves like a manual run and doesn't litter root-owned files in the user tree. MemoryMax=512M.

Prerequisite — harness artifacts

gdb_connect can only attach once the harness actually boots. That needs two build artifacts present on dev-build:

  • rootfs/initramfs-dhd.cpio.gz (initrd)
  • vmlinux.harness (kernel image + symbols, path from HARNESS_VMLINUX)

Rebuild them on dev-build (via rtk) before expecting live attach to work. The server itself runs fine without them — harness_run will just fail to boot until they exist.

CI

Typecheck-only (tsc). The runtime drives gdb-multiarch against QEMU, neither of which exists on GitHub runners — the real exercise happens on dev-build.

License

MIT

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选