Ida MCP
A headless MCP server for IDA Pro 9+
Installation
npx ida-mcpAsk AI about Ida MCP
Powered by Claude Β· Grounded in docs
I know everything about Ida MCP. Ask me about installation, configuration, usage, or troubleshooting.
0/500
Reviews
Documentation
IDA-MCP
IDA-MCP (FastMCP + Multi-instance Gateway)
- Each IDA instance starts its own FastMCP Streamable HTTP endpoint at
/mcp - A standalone gateway daemon maintains the in-memory instance registry and forwards tool calls
- The gateway serves both the internal API at
/internaland the client-facing MCP proxy at/mcpon127.0.0.1:11338by default - The stdio proxy is a separate subprocess entrypoint that reuses the same proxy tool set
- MCP Resources are exposed by each IDA instance directly, not by the gateway/proxy
- A PySide6 desktop IDE provides installation, configuration, gateway management, and status monitoring
Architecture
Repository Structure
IDA-MCP/
βββ ide/ # PySide6 desktop IDE (main project)
β βββ app/ # UI layer
β βββ supervisor/ # Gateway lifecycle & installation
β βββ resources/ida_mcp/ # Bundled ida_mcp source (installed to IDA plugins/)
β βββ tests/
βββ skills/ # MCP skill documentation
βββ test/ # Test suite
βββ API.md # Tool & response contract reference
βββ README.md / README_CN.md
βββ project.md / roadmap.md
Core Infrastructure (inside ida_mcp/)
rpc.py-@tool/@resource/@unsafedecorators and registrationsync.py-@idaread/@idawriteIDA thread synchronization decoratorsutils.py- Address parsing, pagination, pattern filtering utilitiescompat.py- IDA 8.x/9.x compatibility layer
API Modules
api_core.py- IDB metadata, function/string/global listsapi_analysis.py- Decompilation, disassembly, cross-referencesapi_memory.py- Memory reading operationsapi_modeling.py- Database shaping (functions, code/data/string creation)api_types.py- Type operations (prototypes, local types)api_modify.py- Comments, renamingapi_stack.py- Stack frame operationsapi_debug.py- Debugger control (marked unsafe)api_python.py- Python execution in IDA context (marked unsafe)api_resources.py- MCP Resources (ida://URI patterns)
Key Features
- Decorator Chain Pattern:
@tool+@idaread/@idawritefor clean API definitions - Batch Operations: Most tools accept lists for batch processing
- MCP Resources: REST-like
ida://URI patterns for read-only data access on direct instance connections - Multi-instance Support: A standalone gateway on port 11338 manages multiple IDA instances
- HTTP-first Defaults: The bundled config defaults to
enable_http=true,enable_stdio=false, andenable_unsafe=true - IDA 8.x/9.x Compatible: Compatibility layer handles API differences
- Desktop IDE: PySide6 GUI for one-click install, config, gateway control, and status monitoring
Installation
Via Desktop IDE (Recommended)
- Launch the IDE:
python ide/launcher.py - In Settings β Config, set IDA Python path (e.g.
D:\IDA\ida-python\python.exe) - Plugin directory defaults to
%APPDATA%\Hex-Rays\IDA Pro\plugins - Click Install β the IDE copies plugin files and installs Python dependencies
- Click Start Gateway from the status page or toolbar
Via Command Line
python ide/resources/ida_mcp/ida_mcp/command.py gateway start --json
Manual Installation
- Copy
ida_mcp.pyandida_mcp/fromide/resources/ida_mcp/to IDA'splugins/directory - Install dependencies using IDA's Python:
<ida_python> -m pip install -r ide/resources/ida_mcp/requirements.txt - Open a target binary in IDA and wait for initial analysis
Startup Steps
- Install the plugin (via IDE or manually).
- Open a target binary and wait for initial analysis.
- Start the gateway (via IDE or
command.py gateway start). - In IDA, trigger the plugin manually or via
open_in_idafrom the proxy. - On startup, the instance:
- selects a free instance port starting from
10000 - serves MCP over
http://127.0.0.1:<instance_port>/mcp/ - registers itself with the gateway at
http://127.0.0.1:11338/internal
- selects a free instance port starting from
Closing an IDA instance only deregisters that instance. The standalone gateway keeps running.
Current Tools
Core Tools (api_core.py)
check_connectionβ Gateway/registry health check (ok/count)list_instancesβ List all IDA instances registered in the shared gatewayget_metadataβ IDB metadata (hash/arch/bits/endian)list_functionsβ Paginated function list with optional pattern filterlist_globalsβ Global symbols (non-functions)list_stringsβ Extracted stringslist_local_typesβ Local type definitionsget_entry_pointsβ Program entry pointsconvert_numberβ Number format conversionlist_importsβ List imported functions with module nameslist_exportsβ List exported functions/symbolslist_segmentsβ List memory segments with permissionsget_cursorβ Get current cursor position and context
Analysis Tools (api_analysis.py)
decompileβ Batch decompile functions (Hex-Rays)disasmβ Batch disassemble functionslinear_disasmβ Linear disassembly from arbitrary addressget_callersβ Structured caller summary grouped by function and call siteget_calleesβ Structured callee summary grouped by function and call siteget_function_signatureβ Best-available function signature stringxrefs_toβ Batch cross-references to addressesxrefs_fromβ Batch cross-references from addressesxrefs_to_fieldβ Heuristic struct field referencesfind_bytesβ Search for byte patterns with wildcardsget_basic_blocksβ Get basic blocks with control flow
Memory Tools (api_memory.py)
get_bytesβ Read raw bytesread_scalarβ Read integers with explicit widthget_stringβ Read null-terminated strings
Modeling Tools (api_modeling.py)
create_functionβ Create a function at an addressdelete_functionβ Delete an existing functionmake_codeβ Convert bytes at an address into codeundefine_itemsβ Undefine a byte rangemake_dataβ Create typed data itemsmake_stringβ Create a string literal
Type Tools (api_types.py)
declare_structβ Create/update local structsdeclare_enumβ Create/update local enumsdeclare_typedefβ Create/update local typedefsset_function_prototypeβ Set function signatureset_local_variable_typeβ Set local variable type (Hex-Rays)set_global_variable_typeβ Set global variable typelist_structsβ List all structures/unionsget_struct_infoβ Get structure definition with fields
Modify Tools (api_modify.py)
set_commentβ Batch set commentsrename_functionβ Rename functionrename_local_variableβ Rename local variable (Hex-Rays)rename_global_variableβ Rename global symbolpatch_bytesβ Patch bytes at addresses
Stack Tools (api_stack.py)
stack_frameβ Get stack frame variablesdeclare_stackβ Create stack variablesdelete_stackβ Delete stack variables
Python Tools (api_python.py) - Unsafe
py_evalβ Execute arbitrary Python code in IDA context
Debug Tools (api_debug.py) - Unsafe
dbg_regsβ Get all registersdbg_callstackβ Get call stackdbg_list_bpsβ List breakpointsdbg_start/dbg_exit/dbg_continueβ Start/stop/continue debuggingdbg_run_toβ Run to addressdbg_add_bp/dbg_delete_bp/dbg_enable_bpβ Breakpoint managementdbg_step_into/dbg_step_overβ Single-step executiondbg_read_mem/dbg_write_memβ Debugger memory access
MCP Resources (api_resources.py)
ida://idb/metadataβ IDB metadataida://functionsβ Function listida://function/{addr}β Single function detailsida://function/{addr}/decompileβ Function decompilation snapshotida://function/{addr}/disasmβ Function disassembly snapshotida://function/{addr}/basic_blocksβ Function CFG/basic block viewida://function/{addr}/stackβ Function stack/local-variable viewida://strings/ida://globals/ida://types/ida://segmentsida://imports/ida://imports/{module}/ida://exports/ida://entry_pointsida://structs/ida://struct/{name}ida://xrefs/to/{addr}/ida://xrefs/from/{addr}(+/summaryvariants)ida://memory/{addr}?size=Nβ Read memory
Transport Overview
| Mode | Description | Configuration |
|---|---|---|
| HTTP proxy (recommended) | Connects to the standalone gateway MCP proxy on 11338 | Only requires url |
| stdio proxy | MCP client launches ida_mcp/proxy/ida_mcp_proxy.py as a subprocess | Requires command and args |
| Direct instance HTTP | Connects straight to one IDA instance, mainly useful for ida:// resources | Requires the selected instance port |
Proxy Tools:
| Category | Tools |
|---|---|
| Management | check_connection, list_instances, select_instance |
| Lifecycle | open_in_ida, close_ida, shutdown_gateway |
| Core | list_functions, get_metadata, list_strings, list_globals, list_local_types, get_entry_points, convert_number, list_imports, list_exports, list_segments, get_cursor |
| Analysis | decompile, disasm, linear_disasm, get_callers, get_callees, get_function_signature, xrefs_to, xrefs_from, xrefs_to_field, find_bytes, get_basic_blocks |
| Modeling | create_function, delete_function, make_code, undefine_items, make_data, make_string |
| Modify | set_comment, rename_function, rename_global_variable, rename_local_variable, patch_bytes |
| Memory | get_bytes, read_scalar, get_string |
| Types | set_function_prototype, set_local_variable_type, set_global_variable_type, declare_struct, declare_enum, declare_typedef, list_structs, get_struct_info |
| Stack | stack_frame, declare_stack, delete_stack |
| Python | py_eval |
| Debug | dbg_start, dbg_continue, dbg_step_into, dbg_step_over, dbg_regs, dbg_add_bp, dbg_delete_bp, ... |
Works with any MCP client: Claude Code, Codex, Cursor, VSCode, LangChain, Cherry Studio, etc.
Method 1: HTTP Proxy Mode (Recommended)
{
"mcpServers": {
"ida-mcp": {
"url": "http://127.0.0.1:11338/mcp"
}
}
}
Method 2: stdio Proxy Mode
{
"mcpServers": {
"ida-mcp-proxy": {
"command": "path/to/ida-python/python.exe",
"args": ["path/to/ida_mcp/proxy/ida_mcp_proxy.py"]
}
}
}
Configuration
Edit ida_mcp/config.conf (located in the IDA plugins directory after installation):
enable_stdio = false
enable_http = true
enable_unsafe = true
wsl_path_bridge = false
http_host = "0.0.0.0"
http_port = 11338
http_path = "/mcp"
ida_default_port = 10000
ida_host = "127.0.0.1"
# ida_path = "C:\\Path\\To\\ida.exe"
# ida_python = "C:\\Path\\To\\ida-python\\python.exe"
open_in_ida_bundle_dir = ""
open_in_ida_autonomous = true
auto_start = false
server_name = "IDA-MCP"
request_timeout = 30
debug = false
Command Helper
The installed command.py provides CLI access:
python <plugins>/ida_mcp/command.py gateway start
python <plugins>/ida_mcp/command.py gateway status
python <plugins>/ida_mcp/command.py gateway stop
python <plugins>/ida_mcp/command.py ida list
python <plugins>/ida_mcp/command.py ida open ./target.exe
python <plugins>/ida_mcp/command.py tool call get_metadata --port 10000
Add --json for machine-readable output.
Development
It's not about having many tools, but about having precise ones; the power of the API is what truly matters. Additionally, the tools should be comprehensive, and the more tools there are, the more obstacles there are for the model to call them. If certain tools can be achieved through existing ones, then those tools are unnecessary. What I need are the missing toolsβthe ones that existing tools cannot accomplish.
License
See LICENSE.
