
Binary Ninja MCP
Connect your LLM/MCP client to Binary Ninja for AI-assisted reverse engineering and malware analysis.
Add to your client
Copy the config for your MCP client and paste it into its config file.
npx -y binary-ninja-mcpPaste into ~/Library/Application Support/Claude/claude_desktop_config.json
{
"mcpServers": {
"binary-ninja-mcp": {
"command": "npx",
"args": [
"-y",
"binary-ninja-mcp",
"--host",
"localhost",
"--port",
"9009"
]
}
}
}Step-by-step guides: Add to Claude Desktop · Add to Cursor · Add to Windsurf
Before you start
- Binary Ninja (https://binary.ninja/)
- Python 3.12+
- An MCP client (Cline, Roo Code, Claude Desktop, Cursor, Windsurf, Claude Code, or LM Studio)
- Node.js / npx (for the recommended npm bridge)
About Binary Ninja MCP
A Binary Ninja plugin and MCP bridge that exposes Binary Ninja's reverse-engineering capabilities to any MCP client. The plugin runs an HTTP MCP server inside Binary Ninja; the bridge (npm package binary-ninja-mcp or a legacy Python bridge) relays MCP client calls to it. Once a binary is loaded in Binary Ninja and the server is started, you can prompt an LLM to decompile, analyze, rename, retype, comment, and patch code — useful for CTF challenges and malware analysis.
Tools & capabilities (54)
decompile_functionDecompile a specific function by name and return HLIL-like code with addresses.
get_ilGet IL for a function in hlil, mlil, or llil (SSA supported for MLIL/LLIL).
fetch_disassemblyGet the assembly representation of a function by name or address.
define_typesAdd type definitions from a C string type definition.
declare_c_typeCreate/update a local type from a single C declaration.
get_user_defined_typeRetrieve definition of a user-defined type (struct, enum, typedef, union).
get_type_infoResolve a type and return declaration, kind, and members.
set_commentSet a comment at a specific address.
get_commentGet the comment at a specific address.
delete_commentDelete the comment at a specific address.
set_function_commentSet a comment for a function.
get_function_commentGet the comment for a function.
delete_function_commentDelete the comment for a function.
function_atRetrieve the name of the function the address belongs to.
make_function_atCreate a function at an address (platform optional; 'default' uses BinaryView/platform default).
get_entry_pointsList entry point(s) of the loaded binary.
get_binary_statusGet the current status of the loaded binary.
get_xrefs_toGet all cross references (code and data) to an address.
get_xrefs_to_enumGet usages related to an enum (matches member constants in code).
get_xrefs_to_fieldGet all cross references to a named struct field.
get_xrefs_to_structGet xrefs/usages related to a struct (members, globals, code refs).
get_xrefs_to_typeGet xrefs/usages related to a struct/type (globals, refs, HLIL matches).
get_xrefs_to_unionGet xrefs/usages related to a union (members, globals, code refs).
get_callersList callers plus call sites for one or more function identifiers.
get_calleesList callees plus call sites for one or more function identifiers.
get_stack_frame_varsGet stack frame variable information for a function (names, offsets, sizes, types).
get_data_declReturn a C-like declaration and a hexdump for a data symbol or address.
hexdump_addressText hexdump at address. length < 0 reads exact defined size if available.
hexdump_dataHexdump by data symbol name or address. length < 0 reads exact defined size if available.
format_valueConvert a value and annotate it at an address in BN (adds a comment).
list_platformsList all available platform names.
list_binariesList managed/open binaries with ids and active flag.
select_binarySelect active binary by id or filename.
list_all_stringsList all strings (no pagination; aggregates all pages).
list_stringsList all strings in the database (paginated).
list_strings_filterList matching strings (paginated, filtered by substring).
list_classesList all namespace/class names in the program.
list_data_itemsList defined data labels and their values.
list_exportsList exported functions/symbols.
list_importsList imported symbols in the program.
list_local_typesList local types in the current database (name/kind/decl).
list_methodsList all function names in the program.
list_namespacesList all non-global namespaces in the program.
list_segmentsList all memory segments in the program.
rename_dataRename a data label at the specified address.
rename_functionRename a function by its current name to a new user-defined name.
rename_single_variableRename a single local variable inside a function.
rename_multi_variablesBatch rename multiple local variables in a function (mapping or pairs).
set_local_variable_typeSet a local variable's type.
retype_variableRetype a variable inside a given function.
set_function_prototypeSet a function's prototype by name or address.
search_functions_by_nameSearch for functions whose name contains the given substring.
search_typesSearch local types by substring (name/decl).
patch_bytesPatch raw bytes at an address (byte-level). Can patch entire instructions via bytecode; save_to_file (default True) saves to disk and re-signs on macOS.
When to use it
- Solving reverse-engineering CTF challenges with an LLM driving Binary Ninja
- AI-assisted malware analysis: decompile, comment, and assess a sample from its entry point
- Bulk renaming functions and variables to make decompiled code human-readable
- Recovering and defining struct/type information across a binary
- Tracing cross references, callers, and callees to understand control and data flow
- Patching bytes/instructions directly from the LLM client
Security notes
The MCP bridge connects to a local Binary Ninja HTTP server (default localhost:9009) with no authentication. The server can patch bytes and write files to disk (patch_bytes with save_to_file defaults to True, and re-signs binaries on macOS). Only analyze binaries you trust, and keep the HTTP server bound to localhost.
Binary Ninja MCP FAQ
What are the two components?
A Binary Ninja plugin that runs an MCP server exposing Binary Ninja over HTTP endpoints, and a separate MCP bridge that connects your MCP client to that server.
How do I install it?
Install your MCP client first, then install the plugin via Binary Ninja's Plugin Manager (or manually). Supported clients are auto-configured. The recommended bridge is the npm package run with 'npx -y binary-ninja-mcp'.
Which MCP clients are supported?
Auto-setup is supported for Cline, Roo Code, Claude Desktop, Cursor, Windsurf, Claude Code, and LM Studio. Any MCP-compatible client can also be configured manually.
What host and port does it use?
The bridge connects to the plugin's HTTP server at localhost on port 9009 by default (configurable via --host and --port).
Is there a non-npm bridge?
Yes. A legacy Python bridge (bridge/binja_mcp_bridge.py) can be run with the plugin's virtual-environment Python interpreter for clients that need it.
Alternatives to Binary Ninja MCP
Compare all alternatives →Microsoft's official browser-automation MCP using Playwright's accessibility tree (no vision model).
Up-to-date, version-specific library documentation injected into your coding agent.
Code intelligence engine that indexes repos into a persistent knowledge graph for AI coding agents.
Compare Binary Ninja MCP with: