Skip to main content
Glama
idapin-mcp
by ASkyeye

idapin-mcp

Windows 流水线,用于编译 IDA 的 idadbg PIN 工具,将其接入 IDA Pro,并向 任何支持 MCP 的 AI(Grok、Claude Desktop、Cursor、VS Code 等)暴露同一个 pintool,无需打开 IDA 图形界面。

本仓库包含完整的项目源码:Windows 版 pintool(pintool/)、MCP 服务器(src/idapin_mcp/)以及安装/构建流水线(scripts/)。

PIN 对正在运行的进程进行插桩。idadbg 使用 IDA pintool 协议(v9)进行通信。MCP 进程是该协议的 TCP 客户端,因此 AI 工具无需 IDA 图形界面。

Intel PIN(pin.exe)并未内置在本仓库中(Intel 许可)。scripts/setup.ps1 会下载 PIN 3.31 MSVC 工具包。

你将获得

路径

作用

pintool/

idadbg.cpp / 头文件 / .sln — 编译为 idadbg.dll + idadbg64.dll

src/idapin_mcp/

MCP stdio 服务器(pin_launch、pin_read_regs 等)

scripts/setup.ps1

下载 PIN → 构建 pintool → 修补 IDA dbg_pin.cfg → 写入 MCP 配置

configs/

IDA + MCP 示例片段

AI client  --stdio MCP-->  python -m idapin_mcp  --TCP-->  pin.exe + idadbg*.dll  --instrument-->  target.exe
IDA Pro    --dbg_pin.cfg--> pin.exe + same DLLs   (optional GUI tracer)

Related MCP server: headless-re-mcp

系统要求(Windows)

  • Windows 10/11 x64

  • Python 3.10+

  • Visual Studio 2017 或更高版本,且包含 MSVC x86/x64(2019、2022、2026 均可;构建脚本会选择最新的工具集)

  • Windows 10 SDK(随 VS 安装的任何 10.0.* 版本)

  • IDA Pro 7.x/8.x/9.x 可选,仅当你还想要 GUI PIN tracer 时

  • 一次性联网,以下载 Intel PIN 3.31(pin-external-3.31-98869-…-msvc-windows.zip)

如果你无法写入 C:\pin,则不需要管理员权限——可设置 -PinRoot "$env:LOCALAPPDATA\idapin-mcp\pin"(不含空格的路径对 PIN 更安全)。

单命令安装

在仓库根目录的 PowerShell 中执行:

Set-ExecutionPolicy -Scope Process Bypass
.\scripts\setup.ps1

该脚本将:

  1. 创建 %LOCALAPPDATA%\idapin-mcp\venv 并执行 pip install -e .

  2. 将 PIN 3.31 下载到 C:\pin(或你传入的路径)

  3. 将 pintool/ 复制到 PIN\source\tools\idapin,重定目标 VS 项目,构建 Win32 + x64 Release

  4. 在其找到的每个 IDA 安装中修补 dbg_pin.cfg

  5. 在 Grok、Claude Desktop、Cursor 和 VS Code 的用户配置中注册 MCP 服务器

然后重启 AI 客户端。

自定义 PIN 安装位置:

.\scripts\setup.ps1 -PinRoot "$env:LOCALAPPDATA\idapin-mcp\pin"

分步说明(替代一键脚本):docs/windows-build.md。

MCP 工具(适用于任何 AI)

启动后,进程会在 PROCESS_STARTED 处挂起。先设置断点,再恢复执行。

工具

用途

pin_launch

在 Windows EXE 上启动 PIN + pintool

pin_status / pin_events

会话与调试事件

pin_add_bpt / pin_del_bpt

软件断点

pin_read_regs / pin_read_mem / pin_write_mem

寄存器 / 内存

pin_resume / pin_pause / pin_step

控制

pin_meminfo

已映射区段

pin_set_trace / pin_trace_count

指令跟踪

pin_stop

终止 PIN 进程树

示例提示词:

使用 idapin MCP:对 C:\Windows\System32\cmd.exe 调用 pin_launch,参数为 /c echo hi,读取寄存器,然后执行 pin_resume 和 pin_stop。

手动 MCP 配置片段:configs/mcp.example.json。各客户端专属说明:docs/ai-clients.md。

IDA Pro(GUI 跟踪器)

setup.ps1 会写入:

PIN_PATH = "C:\\pin\\pin.exe";
PIN_TOOL_PATH = "C:\\pin\\source\\tools\\idapin";
PIN_TOOL_OPTIONS = 1

在 IDA 中:调试器 → 选择调试器 → PIN tracer,然后按 F9。详情请参阅:docs/ai-clients.md。

无头模式下的 idalib 无法启动 pin_user.dll;这正是本 MCP 要直接与 pintool 通信的原因。

许可证

采用分离式许可。MCP 服务器为 MIT 许可;pintool 则不是。

目录树

许可证 / 版权

src/idapin_mcp/、scripts/、configs/、docs/、本 README

MIT — LICENSE

pintool/

Hex-Rays 版权所有 2014–2019 — pintool/COPYRIGHT。非 MIT。以源码形式保留,因为 Intel 禁止再分发编译后的 PIN 工具。

Intel PIN 工具包(pin.exe、头文件、库)

Intel。本仓库不包含。请单独下载并接受 Intel 的许可协议。

请参阅 NOTICE。请勿将 pintool/ 重新授权为 MIT。

请勿提交 pin.exe、PIN 压缩包或编译后的 *.dll。

无需安装 Git,直接从浏览器发布到 GitHub:docs/publish-github.md。

Available Tools

15 tools
pin_add_bptB

Add a software breakpoint at ea (hex or int).

Inputs: ea (required).

pin_del_bptB

Remove a software breakpoint.

Inputs: ea (required).

pin_eventsB

Return (and optionally clear) queued debug events from the pintool.

Inputs: clear.

pin_launchA

Start Intel PIN + idadbg on a Windows EXE (no IDA GUI). Leaves the process suspended at PROCESS_STARTED so you can set breakpoints, then call pin_resume.

Inputs: target (required), args, port, trace_insns, +1 more.

pin_meminfoB

List mapped image/section ranges from the pintool.

Inputs: no named parameters.

pin_pauseB

Pause the instrumented process.

Inputs: no named parameters.

pin_read_memA

Read up to 1024 bytes of target memory. Returns hex.

Inputs: ea (required), size.

pin_read_regsC

Read general-purpose registers for a thread.

Inputs: tid.

pin_resumeA

Resume after an event. eid defaults to the last received event (PROCESS_STARTED=1, BREAKPOINT=5, STEP=6).

Inputs: eid.

pin_set_traceB

Set tracing flags (TF_TRACE_INSN=2, TF_REGISTERS=0x10, TF_TRACE_EVERYTHING=0x40). Combine with bitwise OR.

Inputs: flags (required).

pin_statusB

PIN session status: connected, last event, paths.

Inputs: no named parameters.

pin_stepB

Single-step the given OS thread (tid 0 = last event thread).

Inputs: tid.

pin_stopA

Send EXIT to the pintool and kill the PIN process tree.

Inputs: no named parameters.

pin_trace_countB

Number of recorded trace events currently buffered.

Inputs: no named parameters.

pin_write_memC

Write hex bytes to target memory.

Inputs: ea (required), hex (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.6/5.0

    Scored across 15 tools

    Disambiguation5/5

    Each tool targets a distinct debugger operation: session control (launch/status/resume/pause/step/stop), event retrieval, breakpoint add/del, register/memory read/write, and tracing. The only slight adjacency is pin_events vs pin_trace_count, but the descriptions clearly separate debug events from buffered trace events.

    Naming Consistency5/5

    All tools use a uniform pin_ prefix in snake_case with predictable verb_noun or noun forms (pin_add_bpt, pin_read_mem, pin_set_trace, pin_status). No mixed conventions or casing inconsistencies.

    Tool Count5/5

    15 tools is well-scoped for a debugger/instrumentation control surface, with each tool covering a necessary operation rather than redundant variants. The count supports full session lifecycle without bloat.

    Completeness4/5

    Core debugger coverage is strong: launch/attach, breakpoints add/remove, stepping, memory read/write, register read, memory map, tracing, and teardown. Notable gaps remain: no pin_write_regs (only read), no breakpoint enumeration/list, and no module/symbol lookup, which slightly limits register and breakpoint management workflows.

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      B
      quality
      D
      maintenance
      A simple MCP server exposing persistent, scriptable Frida dynamic instrumentation to an AI agent for Windows reversing, malware/security analysis, and dynamic debugging.
      19
      -
    • A
      license
      Not graded
      quality
      F
      maintenance
      Enables AI-driven reverse engineering with x64dbg via 71+ MCP tools for breakpoints, memory, disassembly, tracing, debug control, PE analysis, and anti-anti-debugging, supporting HTTP, SSE, and stdio transports.
      2
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables AI assistants to autonomously inspect and control IDA Pro via MCP, providing tools for decompilation, disassembly, cross-references, renaming, typing, patching, searching, debugging, and arbitrary IDAPython execution.
      MIT