Hex-Rays IDA MCP
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| IDA_MCP_ID | No | Optional process-level correlation ID used for trusted association. | |
| IDA_MCP_STATE_DIR | No | Root directory for semantic traces. Defaults to <IDAUSR>/mcp/sessions. | |
| IDA_MCP_IDLE_TIMEOUT | No | Equivalent to the --idle-timeout CLI flag; number of seconds after which an idle managed idalib lease is automatically released. 0 disables. | |
| IDA_MCP_PRO_EXTENSIONS | No | Equivalent to the --extensions CLI flag; comma-separated pro extension groups to enable (e.g. dbg for debugger tools). |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {} |
| logging | {} |
| prompts | {} |
| resources | {
"subscribe": false,
"listChanged": false
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| open_databaseA | Open (load) a binary executable, shared library, firmware image, or an existing .i64/.idb IDA database in IDA Pro for reverse engineering. Runs IDA auto-analysis (functions, disassembly, cross references, strings) in a headless idalib worker, or attaches to the file already open in the IDA GUI. Call this first, then use execute_python to decompile, disassemble and query the binary. load_options apply only when a new headless worker is spawned; they do not change an already-open IDA GUI database or a reused worker. |
| execute_pythonA | Run Python (IDAPython and the ida-domain API) against the binary open in IDA: decompile a function to Hex-Rays pseudocode, disassemble (disasm) instructions, enumerate functions, strings, imports, exports, symbols, segments and sections, find cross references (xrefs to/from an address, callers, callees, call graph), get the function at an address, inspect or apply types and structs, rename functions and variables, add comments, and patch bytes. Returns the result plus stdout/stderr. Look up API names with reference first. |
| referenceA | Look up the IDA Pro ida-domain Python API by task or name, e.g. "decompile function", "xrefs to address", "list strings", "rename local variable", "struct type". Returns API signatures and usage examples for IDA analysis via execute_python. |
| list_databasesA | Show the IDA databases (analyzed binaries, .i64/.idb) currently open in the IDA GUI or in headless idalib workers, with their instance ids. |
| save_databaseA | Save the IDA database (.i64) to disk so renames, comments, types and patches made during reverse engineering persist. |
| close_databaseA | Release this session's lease on an IDA database (.i64/.idb) without disrupting other clients. If this is the final lease on a managed idalib worker, orphaned IDA Python execution is cancelled and this call waits for the IDB to shut down. Databases open in the IDA GUI stay open. |
| server_healthA | Health/ready probe for MCP server and current IDB state. |
| lookup_funcsB | Get functions by address or name (auto-detects) |
| int_convertC | Convert numbers to different formats |
| list_funcsB | List functions with optional filtering and offset/count pagination. |
| func_queryB | Query functions with richer filtering than list_funcs. |
| list_globalsB | List globals with optional filtering and offset/count pagination. |
| entity_queryC | Query IDB entities with typed filters, projection, and pagination. |
| importsB | List imports with module names using offset/count pagination. |
| imports_queryB | Query imports with richer filtering than imports(offset,count). |
| idb_saveA | Save active IDB to disk, optionally to a provided path. The open database is backed by loose working files (.id0/.id1/.id2/.nam/.til) that IDA actively manages, headless included. Killing them out from under the open database corrupts it (issues #446, #498), so DBFL_KILL is never used here: an in-place save uses IDA's native save (Ctrl+W), and an explicit different destination gets a compressed copy while the working files stay. |
| find_regexA | Search strings by case-insensitive regex with offset/limit pagination. |
| search_textA | Search the rendered listing for Iterates Use |
| get_bytesC | Read bytes from memory addresses |
| get_intC | Read integer values from memory addresses |
| get_stringC | Read strings from memory addresses |
| get_global_valueC | Read global variable values by address or symbol name. |
| patchB | Patch bytes at memory addresses with hex data |
| put_intC | Write integer values to memory addresses |
| decompileA | Decompile function(s) at address(es); returns pseudocode and per-item errors. |
| disasmB | Disassemble function with offset/max_instructions pagination and optional total count. |
| func_profileB | Profile functions with summary metrics and optional sampled details. |
| analyze_batchC | Run comprehensive analysis over one or more target functions. |
| xrefs_toA | Return xrefs to address(es) or named symbols, capped per target with truncation flag. |
| xref_queryC | Query xrefs with direction/type filters and pagination. |
| xrefs_to_fieldC | Get cross-references to structure fields |
| calleesB | Return unique callees per function, capped by limit. |
| find_bytesB | Search byte patterns (supports ??) with offset/limit pagination. |
| basic_blocksB | Return function CFG blocks with offset/max_blocks pagination. |
| findB | Search strings/immediates/refs for targets with offset/limit pagination. |
| insn_queryC | Query instructions with mnemonic/operand filters and scoped scans. |
| export_funcsC | Export function data for addresses in json/c_header/prototypes formats. |
| callgraphB | Build bounded callgraph from roots with depth/node/edge limits. |
| declare_typeC | Declare C type definitions in local type library. |
| enum_upsertB | Create or extend local enums in an idempotent way. |
| read_structB | Read struct fields from memory at address; auto-detect type when possible. |
| search_structsB | Search local structs/unions by name pattern. |
| type_queryB | Query local types with structured filters/projection-friendly output. |
| type_inspectB | Inspect named types (size/kind/declaration/members). |
| set_typeC | Apply types (function/global/local/stack) |
| type_apply_batchC | Apply multiple type edits and return aggregate status. |
| infer_typesC | Infer and apply likely types at target addresses. |
| stack_frameC | Return stack variables for function address(es). |
| declare_stackC | Create stack variables from typed stack declarations. |
| delete_stackC | Delete stack variables by name or offset. |
| add_bookmarkA | Add or replace the IDA bookmark at an address. Set prefix="" for no prefix. |
| set_commentsC | Set comments at addresses (both disassembly and decompiler views) |
| append_commentsC | Append comments at addresses, deduping exact text by default. |
| patch_asmC | Patch assembly instructions at addresses |
| renameC | Batch-rename funcs/globals/locals/stack vars with dry-run options. |
| define_funcC | Define functions; IDA infers bounds unless end is provided. |
| define_codeC | Convert bytes to code instruction(s) at address(es). |
| undefineC | Undefine item(s) at address(es), converting back to raw bytes. |
| force_recompileA | Invalidate the Hex-Rays decompile cache for one or more functions. Use after |
| set_op_typeA | Set the type of an instruction operand. GUI 'Y' / 'O' / '#' equivalent. Tags an operand at a specific instruction with a desired interpretation. Useful when the decompiler picks an awkward expression form (e.g., the "earlier-named-symbol + offset" form for contiguous globals).
|
| make_dataA | Create a typed data symbol at an address, replacing any prior items. Use this to harden a symbol boundary that the decompiler is currently
expressing through a neighboring global plus offset. The |
| py_evalA | Execute Python in IDA context and return result/stdout/stderr. Locals persistence (Jupyter-style): the locals namespace persists across calls by default, so variables, imports, and definitions from previous calls stay visible. Pass new_locals=True to reset the stored namespace and start fresh. Note: the globals namespace (IDA modules and helpers) is always rebuilt per call; only locals persist. Jupyter-style last-expression return: if the code ends with an expression, its value is returned in "result". Timeouts for long snippets: this tool runs with a 300s ceiling, and the helpers mcp_time_left() / mcp_deadline_exceeded() are injected into the snippet namespace. Poll them inside long loops so the main thread bails out cleanly instead of freezing every other MCP call (including server_health) behind a non-polling C++ call. |
| py_exec_fileA | Execute a Python script file in IDA context and return stdout/stderr. Unlike py_eval, this runs the entire file with exec() using a single shared globals dict (no locals split), so top-level definitions are visible to all code in the script. Handles large scripts that would be unwieldy as inline code. |
| survey_binaryA | Get a compact overview of the binary in one call. Returns file metadata, segment layout, entry points, statistics, top 15 strings and functions ranked by xref count (functions include classification: thunk/wrapper/leaf/dispatcher/ complex), imports by category, and call graph summary. Use this as your FIRST tool call when starting analysis. Do not call list_funcs, imports, or find_regex separately for triage — this returns all of that. Use detail_level='minimal' for binaries with >10k functions. |
| analyze_functionA | Compact single-function analysis: pseudocode, strings, constants, callers, callees, xrefs, blocks. |
| analyze_componentA | Analyze related functions as a group: per-function summaries, internal call graph, shared data. |
| diff_before_afterA | Rename a function, set its type, or add a comment, and immediately see the before/after decompilation side by side. Use this instead of calling rename then decompile separately when you want to verify that a rename or type change actually improved readability. Actions: 'rename_func' (action_args: {name: str}), 'set_type' (action_args: {type: str}), 'set_comment' (action_args: {comment: str}). Returns {before, after, action_applied, changes_detected}. Especially useful during batch renaming to confirm each change had the intended effect. |
| trace_data_flowA | Follow cross-references from or to an address, automatically traversing multiple hops. Use 'forward' to see where data flows TO (xrefs-from), or 'backward' to see where data flows FROM (xrefs-to). At each node in the traversal, returns the function name, instruction, and whether it's code or data. Use this when you find an interesting string, constant, or global and want to understand every code path that touches it without manually chaining xrefs_to calls. Do not use for call graph traversal — use callgraph for that. max_depth controls how many hops to follow (default 5, max 20). |
| make_signatureA | Create unique byte signatures for addresses. Generates the shortest unique signature starting at each address by walking instructions and wildcarding operands. Useful for finding stable patterns that survive recompilation. |
| make_signature_for_functionB | Create unique byte signatures for function entry points. Resolves each name/address to a function, then generates the shortest unique signature starting at the function start. |
| make_signature_for_rangeA | Create a byte signature for a specific address range (e.g. a selected region). Unlike make_signature, this does NOT guarantee uniqueness — it simply encodes the bytes in the range with optional operand wildcarding. |
| find_xref_signaturesA | Find signatures for code locations that reference an address. For each input address, finds all code cross-references TO it, generates a unique signature at each xref site, and returns the shortest ones. Ideal for creating signatures for data addresses, vtable entries, or string references that can't be signatured directly. |
| get_algorithm_signatureB | 自动识别常见算法(md5/sha/aes/des/rc4/tea/xor/base64/crc32/zlib 等),返回算法类型和置信度。 |
| detect_obfuscationB | 检测常见混淆模式:控制流平坦化、字符串加密、反调试、死代码,返回各标志与详情。 |
| get_patch_pointsB | 自动定位可 patch 位置(条件跳转、call、反调试 int 0x2d 等)。 |
| get_function_constraintsB | 从反编译伪代码中启发式提取 flag/校验约束线索(长度比较、常量 == 等)。 |
| get_dynamic_string_mapC | 动态字符串解密映射(静态字符串 + 运行期记录的动态字符串)。 |
| get_analysis_reportB | 自动生成结构化分析报告(函数/全局/字符串/入口点全量清单)。 |
| generate_analysis_report_mdA | 一键生成结构化 markdown 报告,帮助快速理解程序核心逻辑(全量函数扫描)。 |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
| idb_metadata_resource | IDB metadata: file info, architecture, analysis state. |
| idb_segments_resource | All segments with permissions and types. |
| idb_entrypoints_resource | All entry points (exports and thread entries). |
| cursor_resource | Current cursor address, function, and item (GUI only). |
| selection_resource | Current IDA selection range (GUI only). |
| types_resource | All local types with their declarations. |
| structs_resource | All local structures and unions. |
TDQS
Scored across 79 tools
Many tools overlap heavily: list_funcs vs func_query vs entity_query vs lookup_funcs, imports vs imports_query, xrefs_to vs xref_query vs trace_data_flow, find vs find_regex vs search_text vs find_bytes, and execute_python vs py_eval vs py_exec_file. Some descriptions clarify intended distinctions, but the boundaries remain fuzzy across dozens of near-duplicate query and analysis variants.
Most names are snake_case, but conventions mix bare verbs (decompile, patch, rename), verb_noun (list_funcs, get_bytes, set_comments), and bare nouns (imports, callgraph, stack_frame, basic_blocks). The repeated suffix variants (_query, _batch, _profile) add some predictability, but the overall pattern is not consistent enough for a 4 or 5.
79 tools is extreme even for a deep reverse-engineering domain, and many are redundant variants that could be consolidated into broader query/analysis tools. The sheer count makes navigation and tool selection burdensome.
The surface covers database lifecycle, decompilation, disassembly, cross-references, types, editing, signatures, reporting, and arbitrary IDAPython execution via py_eval/py_exec_file. Minor gaps exist (e.g., undo, bookmark/comment deletion, debugger control), but the Python escape hatch mitigates most dead ends.