How mrexodia/ida-pro-mcp works
Project Type and Purpose
• This project is a specialized plugin/MCP server for IDA Pro that enables “vibe reversing” by providing an MCP (Model Context Protocol) server.
• Its role is to allow various MCP clients (like Cline, Roo Code, or Claude) to interact with IDA Pro through a set of JSON-RPC endpoints. The available functions (e.g., get_metadata, decompile_function, etc.) emphasize reverse engineering tasks.
File Structure
• Top-level files like .gitignore, LICENSE, README.md, and configuration files (pyproject.toml) show standard Python project conventions.
• The core implementation lives in the “src/ida_pro_mcp” directory:
• mcp-plugin.py: Contains the IDA Pro plugin logic. It likely registers MCP commands with IDA and manages interaction between IDA’s internal APIs and the MCP protocol.
• server.py: Acts as the MCP server’s main entry point. It handles JSON-RPC requests from external clients, maps these to the corresponding functions from mcp-plugin.py, and returns responses.
• Other files like uv-package.sh and uv.lock indicate that “uv” (a tool runner) is used to manage development and deployment/testing commands.
Extract Insights from the README
• The README outlines available MCP commands, installation instructions, and details on how to integrate the plugin with various MCP clients.
• It explains that the MCP server communicates through JSON-RPC over HTTP, and that functions are auto-exposed by a decorator (e.g., @jsonrpc).
• There is clear guidance on how to extend functionality—new functions get added directly to mcp-plugin.py, making the architecture easily extendable.
a. Main Components:
• IDA Pro Plugin Module (mcp-plugin.py): Resides inside IDA Pro’s plugins folder (or linked from the project) and interacts directly with IDA’s API.
• MCP Server Module (server.py): Runs as a Python process (spawned via uv) that listens on a designated port for JSON-RPC requests.
• External MCP Clients: These are third-party or integrated tools (Cline, Roo Code, Claude) that send JSON-RPC requests to the MCP server.
• “uv” Tool: Manages running the server and possibly installation commands.
b. Relationships and Interactions:
• External MCP Clients send JSON-RPC requests (e.g., check_connection, get_metadata, etc.) over HTTP (or a similar protocol) to the MCP Server.
• The MCP Server receives these requests in server.py, routes them to the corresponding function in mcp-plugin.py.
• The plugin functions in mcp-plugin.py then interact with IDA Pro through its API to perform tasks like decompilation, disassembly, renaming symbols etc.
• Once processed, the responses go back through the server, which then returns them to the clients.
• The uv tool is used to run the server (for example, via commands like "uv run fastmcp dev server.py") and to facilitate installation tasks (like linking the plugin to the IDA Pro plugins folder).
c. Architectural Patterns/Design Principles:
• Modular Design: Separation between the MCP server (handling network & JSON-RPC communications) and the IDA Pro plugin (performing in-IDA operations).
• Extensibility: New functionality can be added simply by adding a new function with the @jsonrpc decorator in mcp-plugin.py.
• Client-Server: Clear distinction between external MCP clients and the internal processing layers.
d. Relevant Technologies/Frameworks:
• Python (version 3.11 or higher)
• IDA Pro (as the reverse engineering environment)
• uv (for command-line operations, testing, and installation automation)
• JSON-RPC protocol for communication between clients and the server
Elements
• Clear labels for each overall component:
• “External MCP Clients” (with samples like Cline, Roo Code, Claude)
• “MCP Server” (server.py)
• “IDA Pro Plugin” (mcp-plugin.py)
• “IDA Pro Environment” (indicating where the plugin operates)
• “uv Tool” (optional, for server startup/installation)
• Network components vs. internal processing components.
• External entities (clients) vs. internal modules (server and plugin).