Connecting LLM to IDA MCP Server in a Virtual Machine (feat. Gemini CLI)
Table of Contents
Setting up a parallel analysis workflow with IDA in a VM and Gemini CLI on Host MCP (Model Context Protocol) is an open standard that enables AI models to communicate with other systems. By using MCP, LLMs can connect to various data sources like PCs or databases, and tools like search engines or calculators to perform complex and valuable tasks. Itโs often described as a โUSB-C port for AI.โ While there is an official plugin from Hex-Rays, this guide is based on the GitHub repository which has more stars and community traction. I also structured this setup using a virtual machine for the MCP Server, enabling a workflow where I can freely analyze in parallel while the agent handles its tasks. As mentioned, the MCP server will be set up inside a virtual machine. You can use any OS that supports IDA (macOS, Linux, and Windows), but I used Windows 10 x64. Python 3.11 or higher is required. Usually, IDA installs Python if itโs missing, but older versions might install 3.10. Since weโre running this in a VM, itโs easier to install the latest version beforehand. I personally install it in The GitHub repository recommends IDA Pro 8.3 or higher, or version 9. Note that IDA Free is not supported, but according to sources, IDA Home (the individual plan) works fine. During installation, uncheck the option to install Python so that IDA uses the version you previously installed. Refer to the GitHub installation guide for detailed steps. After installation, go to Since it listens on While you could install the AI application on the guest OS, I preferred separating the guest and host. I use these applications frequently on my host, and it feels slightly faster. The host environment is Windows 11 with WSL, and the following steps are for WSL. The demo on GitHub uses Claude Desktop, but since I subscribe to Gemini, Iโll be using the Gemini CLI. To communicate with the guest, add the MCP server information to If everything is set up correctly, running the You can verify the available tools using the For better analysis results, using a well-crafted prompt is highly recommended. Here is the default recommended prompt: And here is a more detailed prompt shared by another user (@can1357): 0x00. Introduction
0x01. Install
Guest
Python
C:\Python\Python[VER]. Make sure to add the following paths to your systemโs PATH environment variable:C:\Python\Python314\C:\Python\Python314\Scripts\ IDA Pro
IDA MCP
pip uninstall ida-pro-mcp
pip install https://github.com/mrexodia/ida-pro-mcp/archive/refs/heads/main.zip
ida-pro-mcp --installEdit -> Plugins -> MCP in the IDA menu. If the output looks like this, the installation was successful:[MCP] Server started:
Streamable HTTP: http://127.0.0.1:13337/mcp
SSE: http://127.0.0.1:13337/sse
Config: http://127.0.0.1:13337/config.html127.0.0.1 by default, you can set up port forwarding or simply run the following command to allow host communication:ida-pro-mcp --transport http://0.0.0.0:13337/sse Host
Gemini CLI
# Install nvm and Node.js (requires version > 20)
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash
nvm install node
# Install Gemini CLI
npm install -g @google/gemini-cli~/.gemini/settings.json:{
"mcpServers": {
"ida-vm": {
"url": "http://xxx.xxx.xxx.xxx:13337/sse"
}
}
}gemini command should show a log saying Using: 1 MCP server.
โโโ โโโโโโโโโ โโโโโโโโโโ โโโโโโ โโโโโโ โโโโโ โโโโโโ โโโโโ โโโโโ
โโโ โโโ โโโ โโโ โโโโโโ โโโโโโ โโโ โโโโโโ โโโโโ โโโ
โโโ โโโ โโโ โโโ โโโ โโโ โโโ โโโ โโโ โโโ โโโ โโโ
โโโ โโโ โโโโโโโโโโโโโโโโโโโโโ โโโโโโ โโโโโโโโโโโโโโโโโโโโโ โโโโโโโ โโโโโโ
โโโ โโโ โโโโ โโโโโโโโโ โโโโโโ โโโโโโโโโโโโโโโโโโโโ โโโโโโ โโโโโ
โโโ โโโโโโ โโโโโโโ โโโโโโโ โโโ โโโโโโโโโโโโโโโโโ โโโโโ โโโโโ
โโโ โโโ โโโ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโ โโโโโโ โโโโโโ
โโโ โโโ โโโ โโโ โโโ โโโ โโโ โโโ โโโ โโโโโโ โโโ
โโโ โโโ โโโ โโโ โโโ โโโ โโโ โโโ โโโโโ โโโ
โโโ โโโโโโโโโ โโโโโโโโโโ โโโ โโโ โโโโโ โโโ โโโโโ โโโโโ
Tips for getting started:
1. Ask questions, edit files, or run commands.
2. Be specific for the best results.
3. Create GEMINI.md files to customize your interactions with Gemini.
4. /help for more information.
Using: 1 MCP server
โญโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ > Type your message or @path/to/file โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
~/mcp no sandbox (see /docs) Auto (Gemini 3) /model/mcp command.> /mcp
Configured MCP servers:
๐ข ida-vm - Ready (71 tools, 15 resources)
Tools:
- analyze_funcs
- analyze_strings
- apply_types
...
Resources:
- idb_metadata_resource (ida://idb/metadata) [application/json]
- idb_segments_resource (ida://idb/segments) [application/json]
- idb_entrypoints_resource (ida://idb/entrypoints) [application/json]
... 0x02. Prompt Engineering
Your task is to analyze the open file 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 foundYour 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