WinDbg调试服务器

用于WinDbg调试集成的MCP服务器,使AI助手能够分析崩溃转储并通过DbgEng调试实时进程。

  • by themixednuts
  • Rust
  • 本地部署
  • 7 星标
  • 更新于
在 GitHub 查看 themixednuts/windbg-mcp-server

使用说明

windbg mcp服务器

用于Wingey调试集成的MCP服务器。使AI助手能够通过DbgEng分析崩溃转储和调试实时进程。

需求

安装

# From this repo
cargo install --path . --force

# Or via cargo-binstall (GitHub release binaries)
cargo binstall --git https://github.com/themixednuts/windbg-mcp-server

构建

# Default build includes stdio + Streamable HTTP
cargo build --release

用法

stdio(默认)

# Add to Claude Code
claude mcp add windbg /path/to/windbg-mcp-server.exe

# Permissive mode (enables memory writes, execution control)
claude mcp add-json windbg '{"command":"/path/to/windbg-mcp-server.exe","args":["--permissive"]}'

当父MCP主机死亡时,Stdio模式退出,并在启动时回收任何 同一个父母剩下的 windbg-mcp-server 从主机中删除的进程 不终止子句柄(重新连接时常见)。

HTTP(流式HTTP /mcp)

# Stateful — MCP sessions persist (default port 8081 to avoid Ghidra's 8080)
windbg-mcp-server --http --permissive

# Explicit bind/port
windbg-mcp-server --http --bind 127.0.0.1 --port 8081 --permissive

# Stateless — each request is independent, direct JSON responses
windbg-mcp-server --http --stateless --port 8081

OpenCode标准io MCP示例(opencode.json)--host启动服务器:

{
  "mcp": {
    "windbg": {
      "type": "local",
      "command": ["windbg-mcp-server", "--permissive"],
      "enabled": true
    }
  }
}

HTTP远程替代方案: {"type":"remote","url":"http://127.0.0.1:8081/mcp","enabled":true} 之后 windbg-mcp-server --http --permissive.

工具

工具 说明
open_dump 开放式紧急倾卸区(.dmp)
attach_process 附加到实时进程
connect_remote 连接到远程Wingey服务器
detach 从会话中分离
list_sessions 列出活动会话
execute 运行Winchester命令
analyze 快跑 !analyze -v
get_stack_trace 获取调用堆栈
list_threads 列出线程
switch_thread 切换线程上下文
list_modules 列出已加载的模块
read_memory 读取内存
search_memory 在内存中搜索字节模式
write_memory 写入内存*
resolve_symbol 将符号解析为地址,反之亦然
get_type_info 获取类型布局信息
disassemble 反汇编代码
get_registers 获取CPU寄存器
set_breakpoint 设置断点*
remove_breakpoint 删除断点*
go 继续执行*
step 单步执行*
break_execution 闯入调试器*
load_script 加载JavaScript调试脚本
unload_script 卸载脚本
run_script 加载、执行和卸载脚本
invoke_script 从加载的脚本调用函数
eval 计算JavaScript表达式(dx)
list_scripts 列出加载的脚本

*需要 --permissive 旗帜

提示词

预构建的调试工作流程,指导助手完成多步骤分析:

提示 描述
crash_triage 打开一个垃圾场,快跑!分析、检查线程和模块,总结根本原因
thread_analysis 枚举线程,检查死锁,分析锁争用
memory_investigation 检查堆状态,搜索损坏模式,分析可疑地址

远程调试

要连接到远程Wingey会话,请执行以下操作:

  1. 在Winchester中启动调试服务器:

    .server tcp:port=5005
    
  2. 使用 connect_remote 使用连接字符串:

    tcp:server=hostname,port=5005
    

安全

默认情况下,危险操作被禁用。使用 --permissive 以使他们能够。

操作 默认 允许
内存写入 已禁用 已启用
注册写入 已禁用 已启用
执行控制 已禁用 已启用
实时附加 已启用 已启用
命令执行 启用(部分被阻止) 启用(全部)

许可证

麻省理工学院