BinjaLattice MCP Server

Local setup required. This server has to be cloned and prepared on your machine before you register it in Claude Code.
1

Set the server up locally

Run this once to clone and prepare the server before adding it to Claude Code.

Run in terminal
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
2

Register it in Claude Code

After the local setup is done, run this command to point Claude Code at the built server.

Run in terminal
claude mcp add -e "BNJLAT=${BNJLAT}" binja-lattice -- node "<FULL_PATH_TO_BINJA_LATTICE_MCP>/dist/index.js"

Replace <FULL_PATH_TO_BINJA_LATTICE_MCP>/dist/index.js with the actual folder you prepared in step 1.

Required:BNJLAT
README.md

Secure communication protocol for Binary Ninja and MCP servers

BinjaLattice Logo

BinjaLattice

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.

Demo

Features

  • Secure Authentication: Token-based authentication system
  • Encrypted Communication: Optional SSL/TLS encryption
  • Binary Analysis Context: Export pseudocode, disassembly, variable names, binary information etc.
  • Binary Modification: Update function names, add comments, rename variables
  • Token Management: Automatic expiration and renewal of authentication tokens

Installation

Windows (Automated)

Run the PowerShell installer for a one-shot setup:

.\scripts\install_windows.ps1

This will:

  • Install the plugin to %APPDATA%\Binary Ninja\plugins\
  • Create a Python virtual environment (.venv)
  • Install all dependencies
  • Output a ready-to-use MCP configuration

Manual Installation (All Platforms)

  1. Copy plugin/lattice_server_plugin.py to your Binary Ninja plugins directory:

    • Linux: ~/.binaryninja/plugins/
    • macOS: ~/Library/Application Support/Binary Ninja/plugins/
    • Windows: %APPDATA%\Binary Ninja\plugins\
  2. Create a virtual environment:

    python -m venv .venv
    
  3. Activate and install dependencies:

    # Linux/macOS
    source .venv/bin/activate
    
    # Windows
    .venv\Scripts\activate
    
    pip install -r requirements.txt
    

Usage

Starting the Server in Binary Ninja

  1. Open Binary Ninja and load a binary file
  2. Go to Plugins > Start Lattice Protocol Server
  3. The server will start and display the API key in the log console
  4. Set the API key as the BNJLAT environment variable in your MCP configuration

Example 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.

Available MCP Tools

The following tools are available through the MCP server:

Binary Information
  • 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 binary
  • get_strings: Get strings with optional min_length and substring filter
  • get_imports: List imported functions with addresses and source libraries
  • get_exports: List exported functions with addresses
  • get_analysis_progress: Get Binary Ninja analysis status and progress percentage
Function Analysis
  • get_function_disassembly: Get assembly instructions for function by name
  • get_function_pseudocode: Get decompiled C-like pseudocode for function
  • get_function_variables: Get parameters, local variables, and global variables
  • get_cross_references_to_function: List functions that call the specified function
  • get_call_graph: Get callers and callees of function with configurable depth
  • get_global_variable_data: Read data from global variable referenced in function
Data Access
  • get_data_at_address: Read bytes at address with optional type interpretation
  • search_bytes: Search for hex byte pattern with wildcard support (e.g., '48 89 ?? 24')
Type Management
  • get_types: List defined types (structs, enums, typedefs) with optional filter
  • create_struct: Create a new struct type with JSON member definitions
  • update_struct: Update an existing struct type
Annotations
  • update_function_name: Rename a function
  • update_variable_name: Rename a variable in a function
  • set_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 address
  • add_comment_to_function: Add comment to function
  • create_tag: Create tag at address with type and optional description
  • get_tags: List all tags with optional type filter

Client Library Usage

The Lattice client library provides a Python interface for interacting with the BinjaLattice server:

from lib.lattice import Lattice

# Initialize c

Tools (5)

get_binary_infoGet metadata about the binary including architecture, entry point, and segments.
get_function_pseudocodeGet decompiled C-like pseudocode for a specific function.
update_function_nameRename a function within the Binary Ninja database.
add_comment_to_addressAdd a comment at a specific memory address.
search_bytesSearch for hex byte patterns with wildcard support.

Environment Variables

BNJLATrequiredThe API key generated by the Binary Ninja plugin server.

Configuration

claude_desktop_config.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"}}}}

Try it

Analyze the current binary and provide a summary of its architecture, entry point, and total function count.
Decompile the function 'main' and explain what it does in plain English.
Find all cross-references to the 'decrypt_data' function.
Rename the function at the current address to 'init_network_socket' and add a comment explaining its purpose.
Search for the byte pattern '48 89 ?? 24' to identify potential stack operations.

Frequently Asked Questions

What are the key features of BinjaLattice MCP?

Secure token-based authentication for Binary Ninja interactions. Export pseudocode, disassembly, and binary metadata. Modify Binary Ninja databases including renaming functions and variables. Add comments and tags to specific memory addresses. Support for searching binary data via hex patterns.

What can I use BinjaLattice MCP for?

Automating reverse engineering tasks by letting AI suggest function names. Quickly querying binary metadata and imports during security audits. Generating documentation for complex functions using AI-assisted decompilation. Searching for specific byte sequences across large binaries to identify cryptographic constants.

How do I install BinjaLattice MCP?

Install BinjaLattice MCP by running: .\scripts\install_windows.ps1

What MCP clients work with BinjaLattice MCP?

BinjaLattice MCP works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Turn this server into reusable context

Keep BinjaLattice MCP docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Need the old visual installer? Open Conare IDE.
Open Conare