Skip to main content
Glama
idapin-mcp
by ASkyeye

idapin-mcp

Windows-Pipeline, die IDAs idadbg-PIN-Tool kompiliert, es mit IDA Pro verbindet und dasselbe Pintool jedem MCP-fähigen KI-Tool (Grok, Claude Desktop, Cursor, VS Code, …) ohne die IDA-GUI zu öffnen bereitstellt.

Dieses Repository enthält den vollständigen Projektquellcode: das Windows-Pintool (pintool/), den MCP-Server (src/idapin_mcp/) und die Installations-/Build-Pipeline (scripts/).

PIN instrumentiert einen laufenden Prozess. idadbg spricht das IDA-Pintool-Protokoll (v9). Der MCP-Prozess ist ein TCP-Client für dieses Protokoll, sodass KI-Tools die IDA-GUI nicht benötigen.

Intel PIN (pin.exe) ist hier nicht enthalten (Intel-Lizenz). scripts/setup.ps1 lädt das PIN-3.31-MSVC-Kit herunter.

Was Sie bekommen

Pfad

Rolle

pintool/

idadbg.cpp / Header / .sln — kompiliert zu idadbg.dll + idadbg64.dll

src/idapin_mcp/

MCP-stdio-Server (pin_launch, pin_read_regs, …)

scripts/setup.ps1

PIN herunterladen → Pintools bauen → IDA dbg_pin.cfg patchen → MCP-Konfigurationen schreiben

configs/

Beispiel-Snippets für 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

Voraussetzungen (Windows)

  • Windows 10/11 x64

  • Python 3.10+

  • Visual Studio 2017 oder neuer mit MSVC x86/x64 (2019, 2022, 2026 funktionieren alle; das Build-Skript wählt das neueste Toolset)

  • Windows 10 SDK (eine beliebige mit VS installierte Version 10.0.*)

  • IDA Pro 7.x/8.x/9.x optional, nur wenn Sie auch den GUI-PIN-Tracer möchten

  • Einmal Netzwerkzugriff, um Intel PIN 3.31 herunterzuladen (pin-external-3.31-98869-…-msvc-windows.zip)

Administratorrechte sind nicht erforderlich, wenn Sie nicht in C:\pin schreiben können — setzen Sie -PinRoot "$env:LOCALAPPDATA\idapin-mcp\pin" (Pfade ohne Leerzeichen sind für PIN sicherer).

Setup mit einem Befehl

In PowerShell aus dem Repository-Stammverzeichnis:

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

Das bewirkt Folgendes:

  1. Erstellt %LOCALAPPDATA%\idapin-mcp\venv und führt pip install -e . aus.

  2. Lädt PIN 3.31 nach C:\pin herunter (oder in den übergebenen Pfad).

  3. Kopiert pintool/ in PIN\source\tools\idapin, richtet das VS-Projekt neu aus und baut Win32 + x64 Release.

  4. Patcht dbg_pin.cfg in jeder gefundenen IDA-Installation.

  5. Registriert den MCP-Server in den Benutzerkonfigurationen von Grok, Claude Desktop, Cursor und VS Code.

Starten Sie dann den KI-Client neu.

Benutzerdefinierter PIN-Speicherort:

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

Schritt-für-Schritt-Anleitung statt des Sammelskripts: docs/windows-build.md.

MCP-Tools (für jedes KI-Tool)

Nach dem Start ist der Prozess bei PROCESS_STARTED angehalten. Setzen Sie Haltepunkte und setzen Sie dann fort.

Tool

Zweck

pin_launch

PIN + Pintool mit einer Windows-EXE starten

pin_status / pin_events

Sitzung und Debug-Ereignisse

pin_add_bpt / pin_del_bpt

Software-Haltepunkte

pin_read_regs / pin_read_mem / pin_write_mem

Register / Speicher

pin_resume / pin_pause / pin_step

Steuerung

pin_meminfo

Zugeordnete Speicherabschnitte

pin_set_trace / pin_trace_count

Befehls-Tracing

pin_stop

PIN-Prozessbaum beenden

Verwenden Sie idapin MCP: pin_launch auf C:\Windows\System32\cmd.exe mit den Argumenten /c echo hi, lesen Sie die Register, dann pin_resume und pin_stop.

Manuelles MCP-Snippet: configs/mcp.example.json. Clientspezifische Hinweise: docs/ai-clients.md.

IDA Pro (GUI-Tracer)

setup.ps1 schreibt:

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

In IDA: Debugger → Select debugger → PIN tracer, dann F9. Details: docs/ai-clients.md.

Das Headless-idalib kann pin_user.dll nicht starten; deshalb spricht dieser MCP direkt mit dem Pintool.

Lizenz

Geteilte Lizenzierung. Der MCP-Server ist MIT-lizenziert; das Pintool nicht.

Baumstruktur

Lizenz / Urheberrecht

src/idapin_mcp/, scripts/, configs/, docs/, dieses README

MIT — LICENSE

pintool/

Hex-Rays Urheberrecht 2014–2019 — pintool/COPYRIGHT. Nicht MIT. In Quellform belassen, weil Intel die Weiterverbreitung kompilierter PIN-Tools verbietet.

Intel-PIN-Kit (pin.exe, Header, Bibliotheken)

Intel. Nicht in diesem Repository. Separat herunterladen und Intels Lizenz akzeptieren.

Siehe NOTICE. Lizenzieren Sie pintool/ nicht als MIT neu.

Committen Sie pin.exe, das PIN-Zip oder kompilierte *.dll-Dateien nicht.

Von einem Browser aus auf GitHub veröffentlichen (ohne Git-Installation): 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