ida-pro-mcp README

The project's README from github.com/mrexodia/ida-pro-mcp. As one markdown file: README.md.

IDA Pro MCP

Simple MCP Server to allow vibe reversing in IDA Pro.

https://github.com/user-attachments/assets/6ebeaa92-a9db-43fa-b756-eececce2aca0

The binaries and prompt for the video are available in the mcp-reversing-dataset repository.

Prerequisites

Note: This requires having idalib activated globally and uv installed:

# windows
uv run "C:\Program Files\IDA Professional 9.3\idalib\python\py-activate-idalib.py"
# macos
uv run "/Applications/IDA Professional 9.3.app/Contents/MacOS/idalib/python/py-activate-idalib.py"
# linux
uv run "/path/to/idapro-9.3/idalib/python/py-activate-idalib.py"

Installation (Claude Code)

To install the latest IDA Pro MCP in Claude Code:

claude plugin marketplace add mrexodia/claude-marketplace
claude plugin uninstall ida-pro-mcp@mrexodia
claude plugin install ida-pro-mcp@mrexodia

Installation (Codex)

To install the latest IDA Pro MCP in Codex:

codex plugin marketplace add mrexodia/codex-marketplace
codex plugin remove ida-pro-mcp@mrexodia
codex plugin add ida-pro-mcp@mrexodia

Installation (Kimi Code)

To install the latest IDA Pro MCP in Kimi Code, run this slash command in the chat:

/plugins install https://github.com/mrexodia/ida-pro-mcp/tree/main
/reload

This installs the idalib MCP server and the idapython skill. Plugins are copied to $KIMI_CODE_HOME/plugins/managed/, so uv must be on your PATH. The first session after installing is slower, because uv resolves the dependencies before the server responds.

Installation (GUI)

Note: the MCP plugin is no longer recommended and will eventually be deprecated. Use idalib-mcp instead.

If you want to configure the MCP server manually from the IDA GUI:

pip uninstall ida-pro-mcp
pip install https://github.com/mrexodia/ida-pro-mcp/archive/refs/heads/main.zip

Configure the MCP servers and install the IDA Plugin:

ida-pro-mcp --install

Important: Make sure you completely restart IDA and your MCP client for the installation to take effect. Some clients (like Claude) run in the background and need to be quit from the tray icon.

Prompt Engineering

LLMs are prone to hallucinations and you need to be specific with your prompting. For reverse engineering the conversion between integers and bytes are especially problematic. Below is a minimal example prompt, feel free to start a discussion or open an issue if you have good results with a different prompt:

Your task is to analyze a crackme in IDA Pro. You can use the MCP tools to retrieve information. In general use the following strategy:

- Inspect the decompilation and add comments with your findings
- Rename variables to more sensible names
- Change the variable and argument types if necessary (especially pointer and array types)
- Change function names to be more descriptive
- If more details are necessary, disassemble the function and add comments with your findings
- NEVER convert number bases yourself. Use the `int_convert` MCP tool if needed!
- Do not attempt brute forcing, derive any solutions purely from the disassembly and simple python scripts
- Create a report.md with your findings and steps taken at the end
- When you find a solution, prompt to user for feedback with the password you found

This prompt was just the first experiment, please share if you found ways to improve the output!

Another prompt by @can1357:

Your task is to create a complete and comprehensive reverse engineering analysis. Reference AGENTS.md to understand the project goals and ensure the analysis serves our purposes.

Use the following systematic methodology:

1. **Decompilation Analysis**
   - Thoroughly inspect the decompiler output
   - Add detailed comments documenting your findings
   - Focus on understanding the actual functionality and purpose of each component (do not rely on old, incorrect comments)

2. **Improve Readability in the Database**
   - Rename variables to sensible, descriptive names
   - Correct variable and argument types where necessary (especially pointers and array types)
   - Update function names to be descriptive of their actual purpose

3. **Deep Dive When Needed**
   - If more details are necessary, examine the disassembly and add comments with findings
   - Document any low-level behaviors that aren't clear from the decompilation alone
   - Use sub-agents to perform detailed analysis

4. **Important Constraints**
   - NEVER convert number bases yourself - use the int_convert MCP tool if needed
   - Use MCP tools to retrieve information as necessary
   - Derive all conclusions from actual analysis, not assumptions

5. **Documentation**
   - Produce comprehensive RE/*.md files with your findings
   - Document the steps taken and methodology used
   - When asked by the user, ensure accuracy over previous analysis file
   - Organize findings in a way that serves the project goals outlined in AGENTS.md or CLAUDE.md

Live stream discussing prompting and showing some real-world malware analysis:

Tips for Enhancing LLM Accuracy

Large Language Models (LLMs) are powerful tools, but they can sometimes struggle with complex mathematical calculations or exhibit "hallucinations" (making up facts). Make sure to tell the LLM to use the int_convert MCP tool and you might also need math-mcp for certain operations.

Another thing to keep in mind is that LLMs will not perform well on obfuscated code. Before trying to use an LLM to solve the problem, take a look around the binary and spend some time (automatically) removing the following things:

You should also use a tool like Lumina or FLIRT to try and resolve all the open source library code and the C++ STL, this will further improve the accuracy.

Transports & Headless MCP

You can run an SSE server to connect to the user interface like this:

uv run ida-pro-mcp --transport http://127.0.0.1:8744/sse

After installing idalib you can also run a headless MCP server. You can start with an initial binary:

uv run idalib-mcp --host 127.0.0.1 --port 8745 path/to/executable

Or start without a binary and open arbitrary files later with idb_open(...):

uv run idalib-mcp --host 127.0.0.1 --port 8745

For stdio-based clients, use:

uv run idalib-mcp --stdio

Database workers are persistent: each one runs as a detached process that outlives the supervisor that spawned it. When a new supervisor (over stdio or HTTP) calls idb_open for a binary that is already open under a worker on this host, the supervisor adopts that worker transparently — there is no separate "shared" mode to enable. Workers self-exit when no request has hit them for an idle interval.

Note: The idalib feature was contributed by Willi Ballenthin.

Headless idalib Session Model

idalib-mcp is a supervisor that keeps each open database in its own idalib worker process. Workers register themselves in a host-local discovery directory and outlive the supervisor that spawned them; any subsequent supervisor that wants the same path adopts the running worker. A worker self-exits when no request has hit it for its idle TTL (default 1 hour). Call idb_close to release a worker eagerly (freeing a slot toward --max-workers), adopted GUI/worker instances are detached rather than killed.

idb_open picks the backend via its mode parameter:

Every tool call must carry an explicit database argument. There is no implicit "current database" — callers name the session they want to operate on.

uv run idalib-mcp --stdio --max-workers 4

Typical flow:

idb_open("/path/to/binary_a.exe", preferred_session_id="binary_a")
idb_open("/path/to/library.dll", preferred_session_id="library")

decompile("main", database="binary_a")
xrefs_to("ImportantExport", database="library")

database must be the session ID returned by idb_open (or shown in idb_list); filenames and paths are not accepted.

Management tools

Worker controls:

The bundled Codex plugin forwards the runtime's IDA_MCP_* configuration variables from the Codex host environment:

MCP Resources

Resources represent browsable state (read-only data) following MCP's philosophy.

Core IDB State:

UI State:

Type Information:

Lookups:

Core Functions

Modification Operations

Memory Reading Operations

Stack Frame Operations

Structure Operations

Debugger Operations (Extension)

Debugger tools are hidden by default. Enable with ?ext=dbg query parameter:

http://127.0.0.1:13337/mcp?ext=dbg

Control:

Breakpoints:

Registers:

Stack & Memory:

Advanced Analysis Operations

Control Flow Analysis

Type Operations

Export Operations

Graph Operations

Batch Operations

Key Features:

Development

Adding new features is a super easy and streamlined process. All you have to do is add a new @tool function to the modular API files in src/ida_pro_mcp/ida_mcp/api_*.py and your function will be available in the MCP server without any additional boilerplate! Below is a video where I add the get_metadata function in less than 2 minutes (including testing):

https://github.com/user-attachments/assets/951de823-88ea-4235-adcb-9257e316ae64

To test the MCP server itself:

npx -y @modelcontextprotocol/inspector

This will open a web interface at http://localhost:5173 and allow you to interact with the MCP tools for testing.

For testing I create a symbolic link to the IDA plugin and then POST a JSON-RPC request directly to http://localhost:13337/mcp. After enabling symbolic links you can run the following command:

uv run ida-pro-mcp --install

Generate the changelog of direct commits to main:

git log --first-parent --no-merges 1.2.0..main "--pretty=- %s"

ida-pro-mcp (mrexodia/ida-pro-mcp)

Searching Database…

这是什么?这是一个 MCP 服务器,用于把 IDA Pro 与 AI 语言模型连接起来,让 Claude、Codex 或 Cursor 等编程代理帮你逆向分析二进制文件(即“氛围式逆向”,vibe reversing)。
这是独立应用,还是我现有 IDA Pro 的插件?它是一个 MCP 服务器,外加一个 IDA 插件/idalib 后端,接入你已有的 IDA Pro 安装;它不是独立的逆向工具。
如何为我的 MCP 客户端安装?运行 'ida-pro-mcp --config' 获取你客户端的 JSON 配置;Claude Code 和 Codex 有专门的一行安装命令,对于其他客户端,你可以手动配置 MCP 服务器,并在 IDA 图形界面中安装 IDA 插件。
使用前需要先装好什么?需要 Python 3.11+ 和 IDA Pro 8.3 或更高版本(推荐 9)——不支持 IDA Free——以及受支持的 MCP 客户端,如 Claude、Claude Code、Codex、Cursor、Cline 或 VS Code;无界面的 idalib 模式还需要在 PATH 中有 'uv'。
AI 开箱即用时真能把逆向分析做对吗?并不可靠——README 警告大语言模型会产生幻觉,并且难以正确处理整数/字节转换以及混淆代码(字符串加密、控制流平坦化),因此需要仔细的提示词设计,并配合 intconvert、Lumina 或 FLIRT 等工具;GUI 版 MCP 插件也正被弃用,转而使用 idalib-mcp。
这是面向谁的?面向已在使用 IDA Pro、希望借助 AI 编程代理来反编译、修补和分析二进制文件的逆向工程师与恶意软件分析人员。
能否在不打开 IDA 图形界面的情况下无界面运行?可以,idalib-mcp 会将每个打开的数据库作为独立、持久的工作进程运行;工作进程在空闲超过 TTL(默认 1 小时)后会自行退出,并且可以被新的监督会话接管。
MCP 服务器向 LLM 暴露了哪些类型的工具?提供数十种工具,涵盖反编译、反汇编、交叉引用、类型推断、栈帧编辑、字节修补、模式/正则搜索以及调用图构建,另外还有一个隐藏的调试器扩展(断点、寄存器、内存读写),通过 '?ext=dbg' 启用。
支持哪些 MCP 客户端?Claude、Claude Code、Cursor、Codex、Cline、Gemini CLI、VS Code、Windsurf、Zed、Kiro 等众多客户端;其他任何 MCP 客户端都可以通过 'ida-pro-mcp --config' 进行配置。
为什么混淆代码会降低准确率?大语言模型对字符串加密、导入哈希、控制流平坦化和反反编译代码等技巧表现很差,因此 README 建议在让模型分析二进制文件之前先清理这些内容(并借助 Lumina/FLIRT 识别库代码)。
Creator
mrexodia
Size
2.4 MB
Stars
13K
Age
1y
Commits · 90 Days