Skip to main content
Glama
idapin-mcp
by ASkyeye

idapin-mcp

Конвейер для Windows, который компилирует PIN-инструмент idadbg из состава IDA, подключает его к IDA Pro и предоставляет тот же pintool любому ИИ с поддержкой MCP (Grok, Claude Desktop, Cursor, VS Code, …) без открытия графического интерфейса IDA.

В этом репозитории находится полный исходный код проекта: pintool для Windows (pintool/), MCP-сервер (src/idapin_mcp/) и конвейер установки/сборки (scripts/).

PIN инструментирует живой процесс. idadbg общается по протоколу pintool от IDA (v9). Процесс MCP — это TCP-клиент данного протокола, поэтому инструментам ИИ графический интерфейс IDA не нужен.

Intel PIN (pin.exe) не включён в этот репозиторий (лицензия Intel). scripts/setup.ps1 загружает MSVC-комплект PIN 3.31.

Что вы получаете

Путь

Роль

pintool/

idadbg.cpp / заголовки / .sln — компилируется в idadbg.dll + idadbg64.dll

src/idapin_mcp/

MCP stdio-сервер (pin_launch, pin_read_regs, …)

scripts/setup.ps1

Загрузка PIN → сборка pintool → правка dbg_pin.cfg в IDA → запись конфигураций 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 (любая версия 10.0.*, установленная вместе с VS)

  • 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. Пропатчит dbg_pin.cfg во всех найденных установках IDA

  5. Зарегистрирует MCP-сервер в пользовательских конфигурациях Grok, Claude Desktop, Cursor и VS Code

Затем перезапустите клиент ИИ.

Пользовательский путь к PIN:

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

Пошаговая инструкция вместо универсального скрипта: docs/windows-build.md.

Инструменты MCP (для любого ИИ)

После запуска процесс приостановлен в состоянии PROCESS_STARTED. Установите точки останова, затем возобновите выполнение.

Инструмент

Назначение

pin_launch

Запуск PIN + pintool для Windows EXE

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: Debugger → Select debugger → 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, ZIP-архив PIN или скомпилированные *.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