Skip to main content
Glama
idapin-mcp
by ASkyeye

idapin-mcp

IDA の idadbg PIN ツールをコンパイルし、IDA Pro に接続し、同じ pintool を あらゆる MCP 対応 AI (Grok、Claude Desktop、Cursor、VS Code、…) に IDA GUI を開かずに公開する Windows パイプラインです。

このリポジトリには 完全なプロジェクトソース が含まれています: Windows pintool (pintool/)、MCP サーバー (src/idapin_mcp/)、およびインストール/ビルドパイプライン (scripts/)。

PIN は実行中のプロセスを計測します。idadbg は IDA pintool プロトコル (v9) を使用します。MCP プロセスはそのプロトコルの TCP クライアントであるため、AI ツールは IDA GUI を必要としません。

Intel PIN (pin.exe) はここには 同梱されていません (Intel ライセンス)。scripts/setup.ps1 が PIN 3.31 MSVC キットをダウンロードします。

内容

Path

役割

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 トレーサーも必要な場合のみ

  • 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 の時点で 中断 されます。ブレークポイントを設定してから再開してください。

Tool

目的

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 を使用: pin_launch を C:\Windows\System32\cmd.exe に対して、引数 /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 は MIT ではありません。

Tree

ライセンス / 著作権

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 の zip、コンパイル済みの *.dll をコミットしないでください。

ブラウザから GitHub に公開する場合 (Git のインストール不要): 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.

    Maintenance

    ActivityStale
    ResponsivenessOutdated data

    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