ida-mcp-rs 标志

ida-mcp-rs

社区
blacktop

Headless IDA Pro MCP Server

发布者blacktop
代码仓库ida-mcp-rs
语言Rust
复刻数
61
星标数
827
可用工具
0
传输类型stdio
分类
许可协议MIT
链接
  • 将工具接入 AI 工作流

    ida-mcp-rs 提供 MCP 功能,可供兼容的 AI 客户端和智能体使用。

  • 0 个可用工具

    浏览下方可调用的操作;如果服务器提供了名称和描述,也会一并显示。

  • 可直接复制的配置

    使用安装配置片段,在您首选的 MCP 客户端中配置此服务器。

  • 开源社区热度

    关联的代码仓库有 827 个星标和 61 个复刻。

Prerequisites

  • IDA Pro 9.4 with valid license

Getting Started

Install

macOS / Linux (via Homebrew)

bash
brew install blacktop/tap/ida-mcp        # Latest (IDA 9.4)

macOS (Apple Silicon), older IDA releases (via versioned Homebrew casks)

bash
brew install blacktop/tap/ida-mcp@9.3    # IDA 9.3/9.3sp1
brew install blacktop/tap/ida-mcp@9.2    # IDA 9.2

Windows (via Scoop)

powershell
scoop bucket add blacktop https://github.com/blacktop/scoop-bucket
scoop install blacktop/ida-mcp

Windows note: See the Windows platform setup section below for DLL discovery options.

macOS / Linux (via Nix)

bash
nix shell github:blacktop/nur#ida-mcp \
  --extra-experimental-features 'nix-command flakes'

Direct download — grab the archive for your platform from GitHub Releases.

Build from source

See docs/BUILDING.md.

ida-mcp versions mirror IDA Pro versions (v9.4.x for IDA 9.4, v9.3.x for IDA 9.3, and v9.2.x for IDA 9.2). A version mismatch is detected at startup with a clear error message. Scoop and NUR publish the latest version. For older IDA versions, use the matching GitHub Release or, on Apple Silicon, the versioned Homebrew cask.

Platform Setup

macOS

Standard IDA installations in /Applications work automatically:

bash
claude mcp add ida -- ida-mcp

If you see Library not loaded: @rpath/libida.dylib, set DYLD_LIBRARY_PATH to your IDA path:

bash
claude mcp add ida -e DYLD_LIBRARY_PATH='/path/to/IDA.app/Contents/MacOS' -- ida-mcp

Supported paths (auto-detected):

  • /Applications/IDA Professional 9.4.app/Contents/MacOS
  • /Applications/IDA Home 9.4.app/Contents/MacOS
  • /Applications/IDA Essential 9.4.app/Contents/MacOS

Linux

The IDA installer defaults to ~/ida-pro-9.4 — the launcher script auto-detects this:

bash
claude mcp add ida -- ida-mcp

For non-default install locations, set IDADIR:

bash
claude mcp add ida -e IDADIR='/path/to/ida' -- ida-mcp

Resolution order: $IDADIR → ~/ida-pro-9.4 → /opt/ida-pro-9.4 and other RUNPATH fallbacks.

Windows

Option A — Install ida-mcp.exe into your IDA directory (simplest, no env setup needed):

powershell
# Copy the binary next to ida.dll / idalib.dll
copy ida-mcp.exe "C:\Program Files\IDA Professional 9.4\"
claude mcp add ida -- "C:\Program Files\IDA Professional 9.4\ida-mcp.exe"

Option B — Install via Scoop (auto-detects IDA and sets IDADIR):

powershell
scoop bucket add blacktop https://github.com/blacktop/scoop-bucket
scoop install blacktop/ida-mcp
claude mcp add ida -- ida-mcp

Option C — Set IDADIR manually:

powershell
$idaDir = "C:\Program Files\IDA Professional 9.4"
[Environment]::SetEnvironmentVariable("IDADIR", $idaDir, "User")
$userPath = [Environment]::GetEnvironmentVariable("Path", "User")
$pathEntries = @($userPath -split ";" | Where-Object { $_ })
if (-not ($pathEntries -contains $idaDir)) {
  [Environment]::SetEnvironmentVariable(
    "Path", (@($pathEntries + $idaDir) -join ";"), "User"
  )
}
# Then restart your terminal
claude mcp add ida -- ida-mcp

Windows requires ida.dll and idalib.dll to be discoverable before ida-mcp starts. Placing ida-mcp.exe in the IDA directory is the easiest approach. Otherwise, set IDADIR for build/install discovery and add the same IDA directory to PATH for runtime DLL loading.

Common IDA paths:

  • C:\Program Files\IDA Professional 9.4
  • C:\Program Files\IDA Pro 9.4
  • C:\Program Files\IDA Home 9.4

Runtime Requirements

The binary links against IDA's libraries at runtime. Standard installation paths are auto-detected via baked RPATHs. For non-standard paths:

PlatformLibraryFallback Configuration
macOSlibida.dylibDYLD_LIBRARY_PATH
Linuxlibida.soIDADIR (launcher reads it) or LD_LIBRARY_PATH
Windowsida.dllPlace exe in IDA dir, or set IDADIR and add IDA dir to PATH

Configure your AI agent

Claude Code

bash
claude mcp add ida -- ida-mcp

Codex CLI

bash
codex mcp add ida -- ida-mcp

Gemini CLI

bash
gemini mcp add ida -- ida-mcp

Cursor

Add to .cursor/mcp.json:

json
{
  "mcpServers": {
    "ida": { "command": "ida-mcp" }
  }
}

Usage

Once configured, you can analyze binaries through your AI agent:

# Open a binary (returns quickly — analysis runs separately)
open_idb(path: "~/samples/malware")

# Keep the generated database away from a read-only input directory
open_idb(path: "/System/example", idb_out: "~/ida-work/example.i64")

# These work immediately, no analysis needed
list_functions(limit: 20)
disasm_by_name(name: "main", count: 20)
strings(limit: 10)

# For xrefs/decompile on large binaries, run analysis in background
analyze_funcs(background: true)   # returns task_id
task_status(task_id: "analyze-<random>") # poll progress (ID from the analyze_funcs response)

# Decompile (requires Hex-Rays + completed analysis)
decompile(address: "0x100000f00")

# Discover more tools
tool_catalog(query: "find callers")

Raw blobs

Raw inputs still use IDA's normal loader by default and save to <input>.i64. idb_out selects another database location, which is useful for read-only input directories. An existing output is reused only when IDA's recorded input SHA-256 matches the current file; rebuild: true can overwrite only a database whose hash or recorded input path proves that it belongs to the input.

For headerless blobs, the same open_idb tool accepts typed loader hints:

text
open_idb(
  path: "~/firmware/boot.bin",
  idb_out: "~/ida-work/boot.i64",
  processor: "arm:ARMv7-M",
  bitness: 32,
  base_address: "0x08000000",
  entry_point: "0x08000101"
)

Processor families with multiple modes require an explicit IDA processor variant; ambiguous bare names such as arm or metapc are rejected. These target fields apply only while creating a raw-input database and never alter an existing .i64/.idb. For 32-bit ARM targets, an odd entry_point is treated as a Thumb pointer: ida-mcp clears bit 0 for the code address and records the Thumb state before creating the entry instruction.

Multi-database workspace (opt-in)

The default remains one implicit IDA database, so existing agent prompts and tool calls do not need a handle. For headless workflows that deliberately keep several databases open, start with --workspace:

bash
ida-mcp --workspace --workspace-max-workers 4
ida-mcp --workspace serve-http --bind 127.0.0.1:8765 --stateless

In workspace mode, each open_idb/open_dsc allocates and returns a database_id. Every database-scoped call must send that ID; runtime tools such as tool_catalog reject it. close_idb(database_id: ...) invalidates only the selected handle. Idle handles are reaped after 30 minutes by default; use --workspace-idle-timeout-secs 0 to disable that database TTL.

list_databases recovers handles: it returns every routed database_id with its database path and lifecycle state (open, busy, or no_worker), so an agent that lost a response — or reconnected over stateless HTTP — can re-address an open database instead of stranding it until the TTL expires. It is read-only and, like every workspace tool, is absent unless the server runs --workspace.

Workspace routing and legacy pooled HTTP share one internal registry. The legacy session behavior below is preserved, but there is no second independent session-to-worker lease map.

HTTP/SSE worker pool

serve-http keeps the existing single in-process IDA worker by default. For stateful multi-client HTTP/SSE usage, set --max-workers above 1 to route sessions through child ida-mcp worker processes:

bash
ida-mcp serve-http --bind 127.0.0.1:8765 --max-workers 4 --min-workers 1

Without --max-workers N, HTTP sessions still share one IDA context; a second client opening another binary waits behind the first and then gets the normal A database is already open error. Pooled startup logs include Starting pooled HTTP router and MCP pooled HTTP server listening.

Each opened HTTP session leases one child worker until close_idb, HTTP DELETE, session timeout, or server shutdown. close_idb releases the lease immediately, but the child process may stay alive idle for reuse until --worker-idle-timeout-secs elapses. If all workers are leased, new open_idb/open_dsc calls fail with Worker pool exhausted so clients can retry later. Pooled mode requires stateful HTTP sessions; --max-workers > 1 is rejected with --stateless.

Headless debugger (experimental opt-in)

Debugger tools are absent from the default schema. On supported builds, add --enable-debugger to expose debug_status, debug_launch, debug_attach, debug_modules, and debug_stop. debug_open_module additionally requires --workspace, because it opens the selected runtime image in a new database without replacing the database that owns the live debug session:

text
debug_status()
debug_launch(database_id: "…", path: "/absolute/path/to/program")
debug_modules(database_id: "…")
debug_open_module(
  database_id: "…",
  module: "/usr/lib/libobjc.A.dylib",
  idb_out: "~/ida-work/libobjc.i64"
)
debug_stop(database_id: "…", action: "auto")

debug_open_module opens standalone binaries and dlopen'd plugins directly. On macOS, it also resolves system libraries such as /usr/lib/libobjc.A.dylib through the target architecture's host dyld shared cache and loads the selected image through IDA 9.4's in-process DSC service; it does not extract a temporary dylib or invoke idat.

debug_open_module.idb_out is always required. Runtime modules often live in read-only system directories, and silently writing an IDB next to them is not a valid headless workflow. The response includes a checked runtime slide; the new database remains at its on-disk preferred addresses.

In workspace mode, a successfully launched or attached debug session pins its database against the idle TTL until debug_stop succeeds or close_idb releases the database.

Known limitation — a target that exits on its own keeps its pin. IDA's process state is a cached value that only refreshes when a call drains the pending debug event, so a debuggee killed outside ida-mcp is not observable in the background. Its database stays pinned (and exempt from the idle TTL) until debug_stop, close_idb, or worker loss clears it. Both debug_stop and close_idb handle an already-exited target correctly.

Known limitation — worker loss does not stop the debuggee. If the worker process hosting a live debug session is killed, crashes, or ida-mcp retires it after a wedged debugger call, that process may never run its own teardown, so IDA's debug-server helper can be reparented instead of terminated and the target may keep running. When an in-flight tool call detects or causes that retirement, ida-mcp returns a Debugger session lost error saying the target may still be alive, clears the handle's debug pin, and never claims the debuggee ended. A leased worker can also die while no request is in flight to carry an error; list_databases may briefly report no_worker before the reaper removes that terminal handle, even when healthy idle eviction is disabled. Cleaning up a stray helper or debuggee is currently manual.

The first enabled platform is macOS on Apple Silicon. ida-mcp selects IDA's signed loopback helper from the opened database's target architecture: mac_server_arm for ARM64 and mac_server for x86/x86_64. macOS may require IDA's supported “Take Control” authorization once per login; tools report user_action_required when it is missing. ida-mcp never asks for root, disables SIP, edits authorizationdb, or re-signs binaries. Linux and Windows remain fail-closed rather than being advertised optimistically: IDA's ARM Linux backend is remote-only and remote configuration is not exposed, while the SDK does not provide a Windows-on-ARM user debugger. Their native ARM64 harnesses pass by proving the debugger surface remains unavailable; x86 Linux and Windows still require a positive local-backend oracle before advertisement.

MCP 2026-07-28 uses the sessionless server/discover lifecycle. It is supported over stdio and the default single-worker HTTP mode, including multi-round elicitation and the io.modelcontextprotocol/tasks extension for background open_dsc calls. Pooled HTTP (--max-workers > 1) deliberately advertises protocol versions only through 2025-11-25: its worker lease is session-affine, and MCP 2026 has no session identifier to preserve that routing across requests. MCP 2026 requests to pooled HTTP fail with an unsupported protocol-version error instead of risking dispatch to a different IDA worker.

If an SSE-capable client exits without sending close_idb or HTTP DELETE, pooled mode closes the session after its standalone SSE stream disconnects and the --worker-disconnect-grace-secs reconnect grace elapses. POST-only clients do not always leave a stream for the server to observe, so their orphaned sessions are reclaimed by --session-keep-alive-secs (default 1800 seconds). Lower it if you need faster pool reclaim for POST-only clients.

dyld_shared_cache analysis

open_dsc opens a single module from Apple's dyld_shared_cache. With IDA 9.4, ida-mcp opens the DSC header directly and loads images through IDA's native dscu service. Older IDA builds fall back to the legacy idat background flow when a generated .i64 is needed.

# Open a module from the DSC
open_dsc(path: "/path/to/dyld_shared_cache_arm64e", arch: "arm64e",
         module: "/usr/lib/libobjc.A.dylib")

# If a legacy background task was started, poll until done
task_status(task_id: "dsc-<random>")  # ID from the open_dsc response

# Load additional frameworks for cross-module references
open_dsc(path: "/path/to/dyld_shared_cache_arm64e", arch: "arm64e",
         module: "/usr/lib/libobjc.A.dylib",
         frameworks: ["/System/Library/Frameworks/Foundation.framework/Foundation"])

# Incrementally load another DSC dylib into an already-open database
dsc_add_dylib(module: "/usr/lib/libSystem.B.dylib")

# Incrementally load a DSC data/GOT/stub region by address
dsc_add_region(address: "0x180116000")

# After dsc_add_dylib/dsc_add_region, confirm analysis readiness
analysis_status()

Requirements:

  • IDA 9.4+ for native dscu loading
  • For older IDA builds, idat must be available via $IDADIR or standard install paths

IDAPython scripting

run_script executes Python code in the open database via IDA's IDAPython engine. stdout and stderr are captured.

# Inline script
run_script(code: "import idautils\nfor f in idautils.Functions():\n    print(hex(f))")

# Run a .py file from disk
run_script(file: "/path/to/analysis_script.py")

# With timeout (default 120s, max 600s)
run_script(code: "import ida_bytes; print(ida_bytes.get_bytes(0x1000, 16).hex())",
           timeout_secs: 30)

All ida_* modules, idc, and idautils are available. See the IDAPython API reference.


Lumina

ida-mcp disables IDA's automatic Lumina lookup by default, so starting the server or opening a database does not automatically contact lumina.hex-rays.com. The setting is applied only inside ida-mcp's isolated IDA user profile and does not change the normal IDA GUI profile. On Windows, ida-mcp also uses a process-local registry mapping because IDA stores its settings in the Windows registry instead of under IDAUSR. Startup fails closed if the private profile cannot be established.

To allow IDA to use the configured Lumina servers, opt in for that process:

bash
ida-mcp --allow-lumina

The equivalent environment setting is IDA_MCP_ALLOW_LUMINA=true.

With that opt-in enabled, two metadata tools are available:

  • lumina_lookup queries one function and reports the available metadata without changing the database.
  • lumina_apply pulls and applies metadata using IDA's upgrade policy. force: true may replace existing names, types, or comments.

lumina_apply is excluded by --read-only; lumina_lookup remains available because it does not modify the database.


Context Optimization

ida-mcp exposes the same 75 baseline tools by default (~12k tokens of tools/list payload). Six debugger tools exist behind the explicit gates above, so installing the new release does not enlarge existing clients' schema. Clients with dynamic tool discovery defer that cost; clients that preload schemas include it in every session. Filter the surface to only what you need:

FlagEnv varEffect
--toolsets=cat1,cat2IDA_MCP_TOOLSETSReplaces "all tools" with the union of selected categories
--tools=t1,t2IDA_MCP_TOOLSAdds individual tools (additive to --toolsets)
--exclude-tools=t1,t2IDA_MCP_EXCLUDE_TOOLSSubtracts from the include set; always wins
--read-onlyIDA_MCP_READ_ONLYStrips mutating/arbitrary-code tools (run_script, patch*, rename, set_comments, lumina_apply, type/stack edits, dsc_add_*, analyze_funcs, and debugger process control); keeps lifecycle/discovery

No flags = all 75 baseline tools (default). Categories: core, functions, disassembly, decompile, xrefs, control_flow, memory, search, metadata, types, editing, scripting; debug appears only when its startup/platform gate is active (run tool_catalog to enumerate). Flags override env vars; unknown names are rejected at startup.

Recommendations by client

  • Claude Code, Cursor: no action needed for context usage. Both clients defer MCP tool schemas and discover them on demand. Filtering is still useful when you want to constrain the available capabilities.
  • Codex CLI: current models with tool-search support defer MCP tools automatically. For models without tool search, or to constrain the available capabilities, pick a focused subset:
    bash
    ida-mcp --toolsets=core,functions,disassembly,decompile,xrefs
  • Clients without lazy tool loading: each session receives the full ~11k-token schema payload. Pick a focused subset as shown above.
  • Gemini CLI: filtering is optional, but a smaller surface can reduce tool-selection noise when several MCP servers are enabled:
    bash
    ida-mcp --toolsets=core,functions,disassembly,decompile --read-only
  • Small / local models: prefer the smallest workable surface. For triage:
    bash
    ida-mcp --toolsets=core,functions --tools=decompile,callees,callers --read-only

Configuring through mcpServers.json

Most installed MCP configs run ida-mcp directly without a subcommand. The env vars apply on that path too:

json
{
  "mcpServers": {
    "ida-mcp": {
      "command": "ida-mcp",
      "env": {
        "IDA_MCP_TOOLSETS": "core,functions,disassembly,decompile,xrefs",
        "IDA_MCP_READ_ONLY": "true"
      }
    }
  }
}

Measuring

Run just measure-tools to see the per-tool char/token breakdown. Filtering doesn't change the numbers reported there (it acts at the protocol boundary), but the difference shows up in your client's context view (/context in Claude Code, equivalents elsewhere).

Docs

License

MIT Copyright (c) 2026 blacktop

安装

TypingMind
前提条件:

Node.js 18+

{
  "mcpServers": {
    "blacktop-ida-mcp-rs": {
      "command": "",
      "args": []
    }
  }
}

将 ida-mcp-rs MCP 与多个 AI 模型配合使用

TypingMind 在工作区级别连接 MCP 工具,因此连接 ida-mcp-rs 后,您就可以在 TypingMind 中搭配不同的 AI 模型使用,无需为每个模型单独设置。 此 MCP 通过您设备上的 TypingMind MCP 连接器在本地运行。

本地连接器设置指南

如果 MCP 服务器需要访问您电脑上的本地文件、应用或私有资源,请选择此方式。

1

打开 MCP 设置

在 TypingMind 中,依次前往“设置”、“高级设置”和“模型上下文协议”,然后选择“设置连接器”。

  1. 在您的浏览器中打开 TypingMind。
  2. 点击“设置”图标。
  3. 进入“高级设置”。
  4. 打开“模型上下文协议”部分。
  5. 点击“设置连接器”,然后选择“此设备”。
TypingMind MCP 连接器设置界面,已选择“此设备”
2

运行连接器命令

选择“此设备”,从 TypingMind 复制命令并在终端中运行。使用 MCP 时,请保持该进程运行。

  1. 复制 TypingMind 显示的设置命令。
  2. 在 macOS 上打开“终端”,或在 Windows 上打开 Windows Terminal。
  3. 粘贴并运行命令。
  4. 如果终端询问您是否继续,请确认安装软件包。
  5. 使用 MCP 工具时,请勿关闭终端窗口或停止其中的连接器进程。
3

将 ida-mcp-rs 添加为服务器

当连接器状态为“就绪”时,点击“编辑服务器”,然后粘贴 MCP 服务器配置。

  1. 等待连接器状态显示为“就绪”。
  2. 点击“编辑服务器”。
  3. 粘贴 ida-mcp-rs MCP 服务器配置。
  4. 保存服务器列表。
  5. 如需确认连接器是否仍处于就绪状态,请刷新。
TypingMind MCP 设置界面,显示正在运行的服务器和“编辑服务器”按钮
{
  "mcpServers": {
    "blacktop-ida-mcp-rs": {
      "command": "npx",
      "args": [
        "-y",
        "ida-mcp-rs"
      ]
    }
  }
}
4

在不同模型中使用同一连接

保存服务器列表,打开“插件”,启用 ida-mcp-rs MCP 工具,然后在 TypingMind 中选择任意受支持的 AI 模型,即可在聊天中使用这些工具,或将其分配给智能体。

  1. 在 TypingMind 中打开“插件”页面。
  2. 启用 ida-mcp-rs MCP 工具。
  3. 开始聊天并选择您想使用的 AI 模型。
  4. 在聊天中使用 MCP 工具,或将其分配给 AI 智能体。
  5. 根据需要随时切换到其他 AI 模型,无需重新连接 MCP。
在 TypingMind 聊天中使用已启用的 MCP 工具和选定的 AI 模型
您能使用 ida-mcp-rs 帮我完成这项任务吗?
ida-mcp-rs
当然,我看过了。
以下是我使用 ida-mcp-rs 得到的结果。

常见问题

ida-mcp-rs MCP 服务器有什么用途?

ida-mcp-rs 是一个 MCP 服务器,可让兼容的 AI 客户端连接外部工具并获取上下文。在 TypingMind 中,只需添加一次此 MCP 服务器,即可在您的 AI 工作区中使用其工具。

可以在 TypingMind 中让多个 AI 模型使用 ida-mcp-rs MCP 吗?

可以。TypingMind 在工作区层面连接 MCP 工具,因此您无需为每个模型单独配置 MCP 服务器,就能在 Claude、ChatGPT、Gemini 或您在 TypingMind 中配置的其他 AI 模型中使用 ida-mcp-rs。

为什么在 TypingMind 中使用 ida-mcp-rs MCP?

TypingMind 将多个 AI 模型、提示词、插件、AI 智能体、API 密钥和 MCP 工具整合到同一个工作区中,是最出色的大语言模型聊天前端之一。连接 ida-mcp-rs 后,您可以在偏好的不同模型中使用其 MCP 工具,同时在 TypingMind 中井然有序地管理聊天工作流程。

如何将 ida-mcp-rs MCP 连接到 TypingMind?

ida-mcp-rs 通过 TypingMind 本地 MCP 连接器运行。当 MCP 服务器需要访问您计算机上的本地文件、桌面应用、命令行工具或私有资源时,这种方式最合适。

ida-mcp-rs MCP 在 TypingMind 中提供哪些工具?

ida-mcp-rs 提供 MCP 功能,您可以在 TypingMind 的插件页面启用这些功能,然后在聊天中使用,或将其分配给 AI 智能体。

使用 ida-mcp-rs MCP 需要向 TypingMind 提供我的 API 密钥吗?

不需要。TypingMind 采用本地优先的设计,让您自行选择模型提供商,并自行管理 API 密钥、提示词和 MCP 配置。如果 ida-mcp-rs 需要身份验证,请在创建连接时,为该 MCP 服务器添加所需的请求头、OAuth 设置或本地配置。

相关 MCP 服务器

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇