loading…
Search for a command to run...
loading…
BinjaLattice provides a secure interface for Binary Ninja that enables AI agents to perform binary analysis and database modifications via the Model Context Pro
BinjaLattice provides a secure interface for Binary Ninja that enables AI agents to perform binary analysis and database modifications via the Model Context Protocol. It allows for the extraction of pseudocode, disassembly, and metadata while supporting automated updates to function names, variables, and comments.

BinjaLattice is a secure communication protocol for Binary Ninja that enables interaction with external Model Context Protocol (MCP) servers and tools. It provides a structured way to acquire information from Binary Ninja and the ability to modify an active Binary Ninja database over HTTP with a REST API.
Run the PowerShell installer for a one-shot setup:
.\scripts\install_windows.ps1
This will:
%APPDATA%\Binary Ninja\plugins\.venv)Copy plugin/lattice_server_plugin.py to your Binary Ninja plugins directory:
~/.binaryninja/plugins/~/Library/Application Support/Binary Ninja/plugins/%APPDATA%\Binary Ninja\plugins\Create a virtual environment:
python -m venv .venv
Activate and install dependencies:
# Linux/macOS
source .venv/bin/activate
# Windows
.venv\Scripts\activate
pip install -r requirements.txt
Plugins > Start Lattice Protocol ServerBNJLAT environment variable in your MCP configurationExample MCP configuration (mcp.json):
{
"mcpServers": {
"binja-lattice-mcp": {
"command": "/path/to/BinjaLattice/.venv/bin/python",
"args": ["/path/to/BinjaLattice/mcp_server.py"],
"env": {
"BNJLAT": "your_api_key_here"
}
}
}
}
On Windows, use backslashes:
{
"mcpServers": {
"binja-lattice-mcp": {
"command": "C:\\path\\to\\BinjaLattice\\.venv\\Scripts\\python.exe",
"args": ["C:\\path\\to\\BinjaLattice\\mcp_server.py"],
"env": {
"BNJLAT": "your_api_key_here"
}
}
}
}
Tip: The Windows installer outputs a ready-to-paste configuration with the correct paths.
The following tools are available through the MCP server:
get_binary_info: Get metadata about the binary (filename, architecture, entry point, segments, sections, function count)get_all_function_names: List all function names in the binaryget_strings: Get strings with optional min_length and substring filterget_imports: List imported functions with addresses and source librariesget_exports: List exported functions with addressesget_analysis_progress: Get Binary Ninja analysis status and progress percentageget_function_disassembly: Get assembly instructions for function by nameget_function_pseudocode: Get decompiled C-like pseudocode for functionget_function_variables: Get parameters, local variables, and global variablesget_cross_references_to_function: List functions that call the specified functionget_call_graph: Get callers and callees of function with configurable depthget_global_variable_data: Read data from global variable referenced in functionget_data_at_address: Read bytes at address with optional type interpretationsearch_bytes: Search for hex byte pattern with wildcard support (e.g., '48 89 ?? 24')get_types: List defined types (structs, enums, typedefs) with optional filtercreate_struct: Create a new struct type with JSON member definitionsupdate_struct: Update an existing struct typeupdate_function_name: Rename a functionupdate_variable_name: Rename a variable in a functionset_variable_type: Set variable type annotation (C-style like 'uint32_t')set_function_signature: Set function prototype (C-style like 'int foo(char* arg1)')add_comment_to_address: Add comment at addressadd_comment_to_function: Add comment to functioncreate_tag: Create tag at address with type and optional descriptionget_tags: List all tags with optional type filterThe Lattice client library provides a Python interface for interacting with the BinjaLattice server:
from lib.lattice import Lattice
# Initialize client
client = Lattice(host='localhost', port=9000, use_ssl=False)
# Authenticate with API key
client.authenticate("username", "API_KEY")
# Example: Get binary information
binary_info = client.get_binary_info()
# Example: Update function name
client.update_function_name("old_name", "new_name")
# Example: Add comment to function
client.add_comment_to_function("function_name", "This function handles authentication")
The project includes lattice_client.py, which provides an interactive command-line interface for testing and debugging the BinjaLattice server:
python lattice_client.py --host localhost --port 9000 [--ssl] --username user --password YOUR_API_KEY
--host: Server host (default: localhost)--port: Server port (default: 9000)--ssl: Enable SSL/TLS encryption--interactive, -i: Run in interactive mode--username: Username for authentication--password: Password/API key for authentication--token: Authentication token (if you have one from previous authentication)The interactive mode provides a menu-driven interface with the following options:
Example usage with interactive mode:
python lattice_client.py -i --ssl --username user --password YOUR_API_KEY
You can also use the client to execute single commands:
# Get binary information
python lattice_client.py --username user --password YOUR_API_KEY --get-binary-info
# Get function disassembly
python lattice_client.py --username user --password YOUR_API_KEY --get-function-disassembly "main"
# Add comment to a function
python lattice_client.py --username user --password YOUR_API_KEY --add-comment-to-function "main" "Entry point of the program"
plugin/lattice_server_plugin.pymcp_server.pylib/lattice.pyTo add new functionality:
LatticeRequestHandler class in lattice_server_plugin.pyLattice class in lib/lattice.pymcp_server.pyrequirements.txtinstall_api.py provided in your Binary Ninja installation directorypytest tests/ -vДобавь это в claude_desktop_config.json и перезапусти Claude Desktop.
{
"mcpServers": {
"binjalattice-mcp": {
"command": "npx",
"args": []
}
}
}Query your database in natural language
Read-only database access with schema inspection.
Interact with Redis key-value stores.
Database interaction and business intelligence capabilities.