Headless IDA Pro binary analysis via Model Context Protocol. Go orchestrates multi-session concurrency while Python workers handle IDA operations. Key features: - Multi-session concurrency via process isolation - 52 MCP tools for binary analysis - Automatic session timeouts (4 hours default, configurable) - Paginated results with configurable limit (default 1000) - Il2CppDumper metadata import for
Add this skill
npx mdskills install zboralski/ida-headless-mcpWell-architected multi-session binary analysis server with 52 tools, clear setup, and strong documentation
1# IDA Headless MCP Server23Headless IDA Pro binary analysis via Model Context Protocol. Go orchestrates multi-session concurrency while Python workers handle IDA operations.45## Architecture67```8┌─────────────────┐9│ MCP Client │ Claude Desktop, Claude Code, CLI10│ (HTTP/SSE) │11└────────┬────────┘12 │ http://localhost:17300/13 ▼14┌─────────────────┐15│ Go Server │ Session registry, worker manager, watchdog16│ (MCP Tools) │17└────────┬────────┘18 │ Connect RPC over Unix socket19 ▼20┌─────────────────┐21│ Python Worker │ IDA + idalib (one per session)22│ (per session) │23└─────────────────┘24```2526**Key features:**27- Multi-session concurrency via process isolation28- 52 MCP tools for binary analysis29- Automatic session timeouts (4 hours default, configurable)30- Paginated results with configurable limit (default 1000)31- [Il2CppDumper](https://github.com/Perfare/Il2CppDumper) metadata import for Unity games32- [unflutter](https://github.com/zboralski/unflutter) metadata import for Flutter/Dart apps3334## Prerequisites35361. **IDA Pro 9.0+ or IDA Essential 9.2+**37382. **idalib**: install and activate:3940 ```bash41 ./scripts/setup_idalib.sh42 ```4344 See [IDA as a Library documentation](https://docs.hex-rays.com/user-guide/idalib).45463. **Go 1.21+** with protoc tools:47 ```bash48 make install-tools49 ```50514. **Python 3.10+** with dependencies:52 ```bash53 pip3 install -r python/requirements.txt54 ```55565. **Optional: [Il2CppDumper](https://github.com/Perfare/Il2CppDumper)** for Unity game analysis57586. **Optional: [unflutter](https://github.com/zboralski/unflutter)** for Flutter/Dart app analysis59 ```bash60 # Install unflutter (provides flutter_meta.json for import_flutter)61 git clone https://github.com/zboralski/unflutter.git62 cd unflutter && make install63 ```6465## Installation6667```bash68git clone <repo-url>69cd ida-headless-mcp70make setup71```7273This runs idalib setup, installs Python dependencies, and builds the server.7475For manual setup or troubleshooting:7677```bash78./scripts/setup_idalib.sh # Setup idalib (requires IDA Pro/Essential 9.x)79make install-python # Install Python dependencies80make build # Build Go server81```8283## Usage8485### Start Server8687```bash88./bin/ida-mcp-server89```9091Server starts running on port 17300 (configurable via `config.json`, env, or `--port`), exposing both transports:9293- Streamable HTTP (recommended): `http://localhost:17300/`94- SSE compatibility endpoint: `http://localhost:17300/sse`9596### Configure Claude Desktop9798Edit `~/Library/Application Support/Claude/claude_desktop_config.json`:99100```json101{102 "mcpServers": {103 "ida-headless": {104 "url": "http://127.0.0.1:17300/",105 "type": "http"106 }107 }108}109```110111Restart Claude Desktop after editing.112113### Configure Claude Code114115Copy `.claude/settings.json` to `~/.claude/settings.json` to grant access to all IDA MCP tools.116117### Basic Workflow118119```1201. open_binary(path="/path/to/binary.so")121 → {"session_id": "abc123", "has_decompiler": true}1221232. run_auto_analysis(session_id="abc123")124 → {"completed": true}1251263. get_entry_point(session_id="abc123")127 → {"address": 4198400}1281294. get_decompiled_func(session_id="abc123", address=4198400)130 → {pseudocode...}1311325. get_functions(session_id="abc123")133 → {"functions": [...], "count": 1523}1341356. close_binary(session_id="abc123")136 → {"success": true}137```138139### Flutter/Dart Import140141```1421. Run unflutter on the target: unflutter meta libapp.so1432. open_binary(path="libapp.so")1443. import_flutter(session_id="...", meta_json_path="flutter_meta.json")145 → {"functions_created": 9926, "structs_created": 2090,146 "signatures_applied": 9926, "comments_set": 34172}1474. run_auto_analysis(session_id="...")148```149150The `import_flutter` tool reads structured JSON metadata from unflutter. It creates Dart class structs, function definitions with typed signatures, and annotates THR/PP/string reference comments in a single pass.151152Use `tools/list` via MCP to see all available tools.153154## Configuration155156Command line flags:157158```bash159./bin/ida-mcp-server \160 --port 17300 \161 --max-sessions 10 \162 --session-timeout 4h \163 --worker python/worker/server.py \164 --debug165```166167Environment variables (overridden by CLI flags):168169```bash170IDA_MCP_PORT=17300171IDA_MCP_SESSION_TIMEOUT_MIN=240172IDA_MCP_MAX_SESSIONS=10173IDA_MCP_WORKER=/custom/worker.py174IDA_MCP_DEBUG=1175```176177## Development178179### Build180181```bash182make build # Build Go server183make proto # Regenerate protobuf184make test # Run tests + consistency checks185make restart # Kill, rebuild, restart server186make clean # Clean build artifacts187```188189### Testing190191Install test dependencies:192```bash193pip3 install -r requirements-test.txt194```195196Run tests:197```bash198make test # All tests199pytest tests/ -v # Python tests only200go test ./... # Go tests only201```202203### Interactive Testing204205Use MCP Inspector:206```bash207make run # Start server208make inspector # Launch inspector at http://localhost:5173209```210211### Project Structure212213```214ida-headless-mcp/215├── cmd/ida-mcp-server/ # Go MCP server entry point216├── internal/217│ ├── server/ # MCP tool handlers218│ ├── session/ # Session registry219│ └── worker/ # Worker process manager220├── proto/ # Protobuf definitions221├── python/worker/ # Python worker (idalib wrapper)222├── contrib/il2cpp/ # Il2CppDumper helpers (MIT)223└── tests/ # Test suites224```225226### Adding New Tools2272281. Add RPC to `proto/ida/worker/v1/ida_service.proto`2292. Regenerate: `make proto`2303. Implement in `python/worker/ida_wrapper.py`2314. Add handler in `python/worker/connect_server.py`2325. Register MCP tool in `internal/server/server.go`233234## Session Lifecycle2352361. Client calls `open_binary(path)`2372. Go creates session in registry (UUID)2383. Go spawns Python worker subprocess2394. Worker creates Unix socket at `/tmp/ida-worker-{id}.sock`2405. Worker opens IDA database with idalib2416. Go creates Connect RPC clients over socket2427. Subsequent tool calls proxy to worker via Connect2438. Watchdog monitors idle time (default: 4 hours)2449. On timeout or `close_binary`: save database, kill worker, cleanup24510. Session metadata persists under `<database_directory>/sessions` for automatic restoration after server restart246247## Troubleshooting248249**Worker fails to start:**250```bash251python3 -c "import idapro; print('OK')"252```253If this fails, run `./scripts/setup_idalib.sh`254255**Socket timeout:**256Check Python worker logs. Worker may have crashed during init.257258**Port already in use:**259```bash260lsof -ti:17300 | xargs kill261# or use a different port262./bin/ida-mcp-server --port 17301263```264265**Session not found:**266Session may have timed out. Use `list_sessions` to check active sessions.267268## License269270MIT271272## Related Projects273274**MCP Servers:**275- [LaurieWired/GhidraMCP](https://github.com/LaurieWired/GhidraMCP)276- [mrexodia/ida-pro-mcp](https://github.com/mrexodia/ida-pro-mcp)277- [cnitlrt/headless-ida-mcp-server](https://github.com/cnitlrt/headless-ida-mcp-server)278279**Metadata Dumpers:**280- [Perfare/Il2CppDumper](https://github.com/Perfare/Il2CppDumper) (used by `import_il2cpp`)281- [zboralski/unflutter](https://github.com/zboralski/unflutter) (used by `import_flutter`)282283## References284285- [MCP Specification](https://spec.modelcontextprotocol.io/)286- [Connect RPC](https://connectrpc.com/)287- [IDA Pro idalib](https://hex-rays.com/products/ida/support/idapython_docs/)288
Full transparency — inspect the skill content before installing.