# mrexodia/ida-pro-mcp architecture

> Architecture diagram of the GitHub repository mrexodia/ida-pro-mcp, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-04). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mrexodia/ida-pro-mcp
- Repository: https://github.com/mrexodia/ida-pro-mcp

## Overview

##### 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).

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% External Component
    Clients["External MCP Clients\n(Cline, Roo Code, Claude)"]:::external

    %% Internal Components
    Server["MCP Server (server.py)"]:::server
    Plugin["IDA Pro Plugin (mcp-plugin.py)"]:::plugin
    IDA["IDA Pro Environment"]:::env

    %% Deployment Tools as a subgraph
    subgraph "Deployment Tools"
        UV1["uv-package.sh"]:::tool
        UV2["uv.lock"]:::tool
    end

    %% Data Flow
    Clients -->|"JSON-RPC_request"| Server
    Server -->|"Delegates_call"| Plugin
    Plugin -->|"Calls_IDA_API"| IDA
    IDA -->|"Returns_Result"| Plugin
    Plugin -->|"Sends_Response"| Server
    Server -->|"Returns_Response"| Clients

    %% uv Tools Launching the Server
    UV1 -->|"Launches_Server"| Server
    UV2 -->|"Deployment_Control"| Server

    %% Click Events
    click Plugin "https://github.com/mrexodia/ida-pro-mcp/blob/main/src/ida_pro_mcp/mcp-plugin.py"
    click Server "https://github.com/mrexodia/ida-pro-mcp/blob/main/src/ida_pro_mcp/server.py"
    click UV1 "https://github.com/mrexodia/ida-pro-mcp/blob/main/uv-package.sh"
    click UV2 "https://github.com/mrexodia/ida-pro-mcp/blob/main/uv.lock"

    %% Styles
    classDef external fill:#f8d7da,stroke:#842029,stroke-width:2px;
    classDef server fill:#d1e7dd,stroke:#0f5132,stroke-width:2px;
    classDef plugin fill:#cff4fc,stroke:#055160,stroke-width:2px;
    classDef env fill:#fff3cd,stroke:#664d03,stroke-width:2px;
    classDef tool fill:#e2e3e5,stroke:#41464b,stroke-width:2px;
```
