# hexrayssa/ida-mcp architecture

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

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

## Overview

Hex-Rays IDA MCP exposes reverse-engineering tools to AI agents through stdio or Streamable HTTP. The main workflow is an agent request entering the MCP server, which delegates database operations to IDA Nexus and returns tool results. Agent extensions provide an additional client integration. Separate CLI capabilities support session dashboards, log exports, and transcript-path hooks. The excerpts establish CLI routing, key database calls, and session-path dependencies; some tool behavior and GUI integration details are documented rather than fully sampled.

Main entry points: [`ida_mcp/mcp.py`](https://github.com/hexrayssa/ida-mcp/blob/main/ida_mcp/mcp.py) (MCP tools and transports), [`ida_mcp/logs.py`](https://github.com/hexrayssa/ida-mcp/blob/main/ida_mcp/logs.py) (Log archive tools), [`ida_mcp/paths.py`](https://github.com/hexrayssa/ida-mcp/blob/main/ida_mcp/paths.py) (State locations), [`ida_mcp/hooks.py`](https://github.com/hexrayssa/ida-mcp/blob/main/ida_mcp/hooks.py) (Transcript hooks)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_clients["Agent clients"]
  node_pi_ext["Pi / OMP extension<br/>[ida-mcp.ts]"]
  node_hooks["Transcript hooks<br/>[hooks.py]"]
end

subgraph group_server["MCP server"]
  node_cli["Command router<br/>[cli.py]"]
  node_mcp["MCP tools and transports<br/>[mcp.py]"]
end

subgraph group_operations["Session operations"]
  node_trace["Semantic session traces<br/>[mcp.py]"]
  node_state_paths["State locations<br/>[paths.py]"]
  node_dashboard["Session dashboard<br/>[dashboard.py]"]
  node_logs["Log archive tools<br/>[logs.py]"]
end

subgraph group_ida["IDA integration"]
  node_nexus["IDA Nexus manager"]
  node_ida_db[("IDA database")]
  node_gui_plugin["GUI plugin entry<br/>[ida_mcp_plugin.py]"]
end

node_agent(("AI agent"))
node_transcripts["Agent transcripts"]
node_archive["Export archive"]

node_agent -->|"uses tools"| node_pi_ext
node_pi_ext -->|"calls tools"| node_mcp
node_agent -->|"sends requests"| node_mcp
node_cli -->|"starts server"| node_mcp
node_mcp -->|"manages databases"| node_nexus
node_nexus -.->|"opens and operates"| node_ida_db
node_gui_plugin -->|"delegates lifecycle"| node_nexus
node_mcp -->|"records events"| node_trace
node_mcp -->|"uses locations"| node_state_paths
node_dashboard -->|"reads sessions"| node_trace
node_dashboard -->|"resolves paths"| node_state_paths
node_logs -->|"archives sessions"| node_trace
node_logs -->|"resolves paths"| node_state_paths
node_logs -->|"writes export"| node_archive
node_hooks -.->|"attaches metadata"| node_agent
node_hooks -->|"references paths"| node_transcripts
node_mcp -.->|"links sessions"| node_transcripts

click node_pi_ext "https://github.com/hexrayssa/ida-mcp/blob/main/ida-mcp.ts"
click node_cli "https://github.com/hexrayssa/ida-mcp/blob/main/ida_mcp/cli.py"
click node_mcp "https://github.com/hexrayssa/ida-mcp/blob/main/ida_mcp/mcp.py"
click node_gui_plugin "https://github.com/hexrayssa/ida-mcp/blob/main/ida_mcp_plugin.py"
click node_trace "https://github.com/hexrayssa/ida-mcp/blob/main/ida_mcp/mcp.py"
click node_state_paths "https://github.com/hexrayssa/ida-mcp/blob/main/ida_mcp/paths.py"
click node_hooks "https://github.com/hexrayssa/ida-mcp/blob/main/ida_mcp/hooks.py"
click node_dashboard "https://github.com/hexrayssa/ida-mcp/blob/main/ida_mcp/dashboard.py"
click node_logs "https://github.com/hexrayssa/ida-mcp/blob/main/ida_mcp/logs.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_pi_ext,node_hooks toneBlue
class node_cli,node_mcp toneAmber
class node_trace,node_state_paths,node_dashboard,node_logs toneMint
class node_nexus,node_ida_db,node_gui_plugin toneRose
class node_agent,node_transcripts,node_archive toneIndigo
```

## Components

### Agent clients

- [Pi / OMP extension](https://github.com/hexrayssa/ida-mcp/blob/main/ida-mcp.ts): `ida-mcp.ts`
- [Transcript hooks](https://github.com/hexrayssa/ida-mcp/blob/main/ida_mcp/hooks.py): `ida_mcp/hooks.py`

### MCP server

- [Command router](https://github.com/hexrayssa/ida-mcp/blob/main/ida_mcp/cli.py): `ida_mcp/cli.py`
- [MCP tools and transports](https://github.com/hexrayssa/ida-mcp/blob/main/ida_mcp/mcp.py): `ida_mcp/mcp.py`

### Session operations

- [Semantic session traces](https://github.com/hexrayssa/ida-mcp/blob/main/ida_mcp/mcp.py): `ida_mcp/mcp.py`
- [State locations](https://github.com/hexrayssa/ida-mcp/blob/main/ida_mcp/paths.py): `ida_mcp/paths.py`
- [Session dashboard](https://github.com/hexrayssa/ida-mcp/blob/main/ida_mcp/dashboard.py): `ida_mcp/dashboard.py`
- [Log archive tools](https://github.com/hexrayssa/ida-mcp/blob/main/ida_mcp/logs.py): `ida_mcp/logs.py`

### IDA integration

- **IDA Nexus manager**
- **IDA database**
- [GUI plugin entry](https://github.com/hexrayssa/ida-mcp/blob/main/ida_mcp_plugin.py): `ida_mcp_plugin.py`

### Other components

- **AI agent**
- **Agent transcripts**
- **Export archive**

## Connections

- AI agent → Pi / OMP extension: uses tools (evidence: `README.md`)
- Pi / OMP extension → MCP tools and transports: calls tools (evidence: `ida-mcp.ts`)
- AI agent → MCP tools and transports: sends requests (evidence: `README.md`)
- Command router → MCP tools and transports: starts server (evidence: `ida_mcp/cli.py`)
- MCP tools and transports → IDA Nexus manager: manages databases (evidence: `ida_mcp/mcp.py`)
- IDA Nexus manager → IDA database: opens and operates
- GUI plugin entry → IDA Nexus manager: delegates lifecycle (evidence: `ida_mcp_plugin.py`)
- MCP tools and transports → Semantic session traces: records events (evidence: `ida_mcp/mcp.py`)
- MCP tools and transports → State locations: uses locations (evidence: `ida_mcp/mcp.py`)
- Session dashboard → Semantic session traces: reads sessions (evidence: `ida_mcp/dashboard.py`)
- Session dashboard → State locations: resolves paths (evidence: `ida_mcp/dashboard.py`)
- Log archive tools → Semantic session traces: archives sessions (evidence: `ida_mcp/logs.py`)
- Log archive tools → State locations: resolves paths (evidence: `ida_mcp/logs.py`)
- Log archive tools → Export archive: writes export (evidence: `ida_mcp/logs.py`)
- Transcript hooks → AI agent: attaches metadata
- Transcript hooks → Agent transcripts: references paths (evidence: `ida_mcp/hooks.py`)
- MCP tools and transports → Agent transcripts: links sessions
