
Binary Ninja
STDIOBinary Ninja反编译器的AI模型集成服务
Binary Ninja反编译器的AI模型集成服务
English | 中文
The tests/binary/beleaf.elf is taken from CSAW'19: Beleaf - Nightmare. You can also find the complete writeup from the link above!
See: Key Differences from the Existing Plugin
There are two ways to run the MCP server:
Binary Ninja UI Plugin:
Settings - MCP Server - Auto Start
Settings - MCP Server - Server port number
Binary Ninja Headless Mode:
uvx binaryninja-mcp install-api # only run once uvx binaryninja-mcp server <filename> [filename]...
filename
could be any binary files or BNDB, like in UI mode, all opened
files are available to the MCP client.--port
flag to specify a different portClaude Desktop (stdio relay client): Configure the client to connect via stdio transport using built-in relay.
{ "mcpServers": { "binaryninja": { "command": "uvx", "args": ["binaryninja-mcp", "client"] } } }
Cherry Studio:
http://localhost:7000/sse
uvx
binaryninja-mcp
client
Add --port 12345
to both server and client command line if you prefer to run
MCP server on port other than default.
The MCP server provides the following tools:
rename_symbol
: Rename a function or a data variablepseudo_c
: Get pseudo C code of a specified functionpseudo_rust
: Get pseudo Rust code of a specified functionhigh_level_il
: Get high level IL of a specified functionmedium_level_il
: Get medium level IL of a specified functiondisassembly
: Get disassembly of a function or specified rangeupdate_analysis_and_wait
: Update analysis for the binary and wait for
completionget_triage_summary
: Get basic information from BinaryNinja Triage viewget_imports
: Get dictionary of imported symbolsget_exports
: Get dictionary of exported symbolsget_segments
: Get list of memory segmentsget_sections
: Get list of binary sectionsget_strings
: Get list of strings found in the binaryget_functions
: Get list of functionsget_data_variables
: Get list of data variablesMCP Resources can be accessed via URIs in the format:
binaryninja://{filename}/{resource_type}
The server provides these resource types for each binary:
triage_summary
: Basic information from BinaryNinja Triage viewimports
: Dictionary of imported symbols/functionsexports
: Dictionary of exported symbols/functionssegments
: List of memory segmentssections
: List of binary sectionsstrings
: List of strings found in the binaryfunctions
: List of functionsdata_variables
: List of data variablesuv is the recommanded package management tool for this project.
git clone https://github.com/MCPPhalanx/binaryninja-mcp.git "${env:APPDATA}\Binary Ninja\plugins\MCPPhalanx_binaryninja_mcp"
Binary Ninja API must be installed into virtualenv manually.
uv venv uv sync --dev # install binaryninja API binaryninja-mcp install-api # check API is correctly installed uv run python -c 'import binaryninja as bn; assert bn._init_plugins() is None; assert bn.core_ui_enabled() is not None; print("BN API check PASSED!!")'
For MCP clients with stdio transport like Claude Desktop, change working directory to development folder.
{ "mcpServers": { "binaryninja": { "command": "uv", "args": [ "--directory", "C:/path/to/binaryninja-mcp", "run", "binaryninja-mcp", "client" ] } } }
SSE-enabled MCP clients can connect using: http://localhost:7000/sse
uv build
pytest # To update test snapshots: pytest --snapshot-update
The PyPI package version is automatically derived from Binary Ninja's
plugin.json
(using package.json format), maintaining version consistency
between the BN plugin and PyPI package.
# bump alpha version uvx hatch version a # bump release version uvx hatch version minor,rc uvx hatch version release
See: Versioning - Hatch
uv publish