convert_number
Convert a number or string to multiple representations (hex/dec/bin, C literals).
Read a binary open in Binary Ninja as decompiled C, IL or disassembly, and write your renames, comments, types and patches back into the same database.
LABSCO SUMMARY
Most analysis bridges stop at reading. This one renames functions, variables and data labels, sets comments and prototypes, declares C types and retypes variables, so an hour spent working through a stripped binary leaves the .bndb better than it found it. patch_bytes goes further and writes to the binary itself, with save_to_file deciding whether that reaches disk, so it is worth knowing which binary select_binary has active before you use it.
A bridge to a running Binary Ninja instance: 54 tools covering the analysis views, the cross-reference graph, the type system and the write-back operations of a reverse-engineering session.
A Binary Ninja installation with the binary loaded — every tool acts on the view that Binary Ninja already has open. No credentials. Licensed GPL-3.0, which constrains how you redistribute anything built on it.
Follow the published steps
USE CASES
Read the function as decompiled C first, drop to hlil or mlil when the C hides an operation, and check the assembly when the IL hides one too. Three views of one function, without leaving the conversation.
Once a function's purpose is clear, write it down where it lasts: rename the function, rename its locals in one call rather than one at a time, and leave the reasoning as a comment on the function or at the address that prompted it.
Cross references by address are ordinary; these go further and resolve them for a named struct field, a whole struct, an enum or a union — the question you have when you are trying to work out which code path writes a flag.
Declare the struct you believe you are looking at from a C declaration, retype the variables that hold it, and set the function prototype so the decompiled C starts reading like the original source instead of a wall of casts.
Entry points, imports and a filtered string list are the standard first ten minutes of triage. Filtering the strings matters here — a large binary's full string table is more than a model can usefully hold.
Write bytes at the address you decided on, with save_to_file deciding whether the change reaches disk or stays in the analysis database. Where the analysis missed a function entirely, create one at the address first.
Counted once with only startup setup. Other versions, modes or optional credentials may expose a different list.
convert_numberConvert a number or string to multiple representations (hex/dec/bin, C literals).
declare_c_typeCreate or update a local type from a C declaration.
decompile_functionDecompile a specific function by name and return the decompiled C code.
define_typesDefine types from a C code string.
delete_commentDelete the comment at a specific address.
delete_function_commentDelete the comment for a function.
fetch_disassemblyRetrieve the disassembled code of a function as assembly mnemonic instructions.
format_valueConvert and annotate a value at an address in Binary Ninja.
function_atRetrieve the name of the function the address belongs to.
get_binary_statusGet the current status of the loaded binary.
get_commentGet the comment at a specific address.
get_data_declReturn a declaration-like string and hexdump for a data symbol.
get_entry_pointsList entry point(s) of the loaded binary.
get_function_commentGet the comment for a function.
get_ilGet IL for a function in the selected view (hlil, mlil, llil).
get_stack_frame_varsGet stack frame variable information for a function (names, offsets, sizes, types).
get_type_infoResolve a type name and return its declaration and details (kind, members, enum values).
get_user_defined_typeRetrieve definition of a user defined type (struct, enumeration, typedef, union).
get_xrefs_toGet all cross references (code and data) to the given address.
get_xrefs_to_enumGet usages/xrefs of an enum by scanning for member values and matches.
get_xrefs_to_fieldGet all cross references to a named struct field (member).
get_xrefs_to_structGet cross references/usages related to a struct name.
get_xrefs_to_typeGet xrefs/usages related to a struct or type name.
get_xrefs_to_unionGet cross references/usages related to a union type by name.
hexdump_addressHexdump data starting at an address.
hexdump_dataHexdump a data symbol by name or address.
list_all_stringsList all strings in the database (aggregated across pages).
list_binariesList managed/open binaries known to the server with ids and active flag.
list_classesList all namespace/class names in the program with pagination.
list_data_itemsList defined data labels and their values with pagination.
list_exportsList exported functions/symbols with pagination.
list_importsList imported symbols in the program with pagination.
list_local_typesList all local types in the database (paginated).
list_methodsList all function names in the program with pagination.
list_namespacesList all non-global namespaces in the program with pagination.
list_platformsList all available platform names from Binary Ninja.
list_sectionsList sections in the program with pagination.
list_segmentsList all memory segments in the program with pagination.
list_stringsList all strings in the database (paginated).
list_strings_filterList matching strings in the database (paginated, filtered).
make_function_atCreate a function at the given address.
patch_bytesPatch bytes at a given address in the binary.
rename_dataRename a data label at the specified address.
rename_functionRename a function by its current name. The configured prefix will be automatically prepended if not present.
rename_multi_variablesRename multiple local variables in one call.
rename_single_variableRename a variable in a function.
retype_variableRetype a variable in a function.
search_functions_by_nameSearch for functions whose name contains the given substring.
search_typesSearch local types whose name or declaration contains the substring.
select_binarySelect which binary to analyze by ordinal, internal view id, full path, or basename.
set_commentSet a comment at a specific address.
set_function_commentSet a comment for a function.
set_function_prototypeSet a function's prototype by name or address.
set_local_variable_typeSet a local variable's type.
BEFORE YOU INSTALL
54 tools when we connected. get_callers and get_callees are documented but not exposed by the npm bridge; list_sections and convert_number are exposed but missing from the documented table.
All 7 documented clients run the server on your machine.
CONTEXT COST
Rated by the size of the 54 tool definitions that ride along on every turn, not by how many there are
INSTALLATION
Install the Binary Ninja MCP plugin from Binary Ninja's Plugin Manager (Plugins > Manage Plugins), or copy this repository into the Binary Ninja plugins folder
Open Binary Ninja, load a binary, and click the button at the bottom-left corner to start the MCP server the client configurations connect to on localhost:9009
npx -y binary-ninja-mcp{
"mcpServers": {
"binary-ninja-mcp": {
"command": "npx",
"args": [
"-y",
"binary-ninja-mcp",
"--host",
"localhost",
"--port",
"9009"
]
}
}
}