Sponsored by Deepsite.site

BinAssist-MCP

Created By
jtang6136 months ago
Binary Ninja plugin to provide MCP functionality.
Content

BinAssist-MCP

Comprehensive MCP Server for Binary Ninja Reverse Engineering

Binary Ninja

Seamless integration between Binary Ninja and LLM clients through the Model Context Protocol

Overview

BinAssist-MCP is a comprehensive Model Context Protocol (MCP) server that exposes Binary Ninja's powerful reverse engineering capabilities to LLM clients like Claude Desktop. It provides dual transport support (SSE and STDIO), extensive binary analysis tools, and seamless multi-binary session management.

Key Features

  • Dual Transport Support: Both SSE (Server-Sent Events) and STDIO transports
  • Comprehensive Tool Set: 35+ reverse engineering tools combining the best from existing implementations
  • Advanced Architecture: FastMCP-based server with intelligent context management
  • Configurable Settings: Flexible configuration with Binary Ninja integration
  • Multi-Binary Support: Handle multiple binaries simultaneously with automatic lifecycle management
  • Plugin Integration: Native Binary Ninja plugin with menu integration and auto-startup
  • CLI Interface: Full command-line interface for standalone operation

Installation

Via Binary Ninja Plugin Manager

  1. Open Binary Ninja
  2. Go to Plugins > Manage Plugins
  3. Search for "BinAssist-MCP"
  4. Click Install

Manual Installation

  1. Clone the repository:
git clone https://github.com/binassist/binassist-mcp.git
cd BinAssist-MCP
  1. Install the package:
pip install -r requirements.txt
  1. For Binary Ninja plugin installation, copy to your plugins directory:
# Linux/macOS
cp -r src/binassist_mcp ~/.binaryninja/plugins/

# Windows
copy src\binassist_mcp "%APPDATA%\Binary Ninja\plugins\"

Quick Start

Binary Ninja Plugin

  1. Open Binary Ninja and load a binary file
  2. Go to BinAssist-MCP > Start Server (or enable auto-startup in settings)
  3. The server will start automatically and expose your binary for analysis

Standalone Server

# Start server with a binary file
binassist-mcp serve /path/to/binary.exe

# Start server with multiple binaries
binassist-mcp serve binary1.exe binary2.so binary3.dll

# Custom host/port
binassist-mcp serve --host 0.0.0.0 --port 9000 binary.exe

STDIO Transport for MCP Clients

# For Claude Desktop or other STDIO MCP clients
binassist-mcp stdio

Configuration

Binary Ninja Settings

BinAssist-MCP integrates with Binary Ninja's settings system. Configure through:

  • Settings > Preferences > binassist.*

Key settings:

  • binassist.server.host: Server host address (default: localhost)
  • binassist.server.port: Server port (default: 9090)
  • binassist.server.transport: Transport type (sse/stdio/both)
  • binassist.plugin.auto_startup: Auto-start server on file open
  • binassist.binary.max_binaries: Maximum concurrent binaries

Environment Variables

export BINASSIST_SERVER__HOST=localhost
export BINASSIST_SERVER__PORT=9090
export BINASSIST_SERVER__TRANSPORT=both
export BINASSIST_PLUGIN__AUTO_STARTUP=true

Configuration File

Create a JSON configuration file:

{
  "server": {
    "host": "localhost",
    "port": 9090,
    "transport": "both"
  },
  "plugin": {
    "auto_startup": true,
    "show_notifications": true
  },
  "binary": {
    "max_binaries": 10,
    "auto_analysis": true
  }
}

Available Tools

BinAssist-MCP provides comprehensive reverse engineering tools across multiple categories:

Core Analysis Tools

  • rename_symbol: Rename functions and data variables
  • decompile_function: High-level decompilation
  • get_function_pseudo_c: Pseudo C code generation
  • get_function_high_level_il / get_function_medium_level_il: IL representations
  • get_disassembly: Function and range disassembly
  • get_assembly_function: Annotated assembly with comments

Class & Type Management

  • get_classes: List all classes/structs in the binary
  • create_class: Create new class/struct types
  • add_class_member: Add members to existing classes
  • get_namespaces: List all namespaces and their symbols
  • create_type: Create custom type definitions
  • get_types: List all user-defined types
  • create_enum: Create enumeration types
  • create_typedef: Create type aliases
  • get_type_info: Get detailed type information

Data Management

  • create_data_var: Create data variables at addresses
  • get_data_vars: List all data variables
  • get_data_at_address: Read and interpret data at addresses

Variable Management

  • create_variable: Create local variables in functions
  • get_variables: List function parameters and local variables
  • rename_variable: Rename variables in functions
  • set_variable_type: Set/change variable types

Comment Management

  • set_comment: Add comments at addresses
  • get_comment: Get comment at specific address
  • get_all_comments: List all comments in the binary
  • remove_comment: Remove comments
  • set_function_comment: Set comments for entire functions

Function Analysis

  • get_call_graph: Generate call graphs (single function or global)
  • analyze_function: Comprehensive function analysis with metrics
  • get_cross_references: Find code/data cross-references
  • get_functions_advanced: Advanced function listing with filtering
  • search_functions_advanced: Multi-target function search
  • get_function_statistics: Binary-wide function statistics

Information Retrieval

  • get_functions: List all functions with metadata
  • search_functions_by_name: Search functions by substring
  • get_imports / get_exports: Symbol import/export analysis
  • get_strings: String analysis with metadata
  • get_segments / get_sections: Memory layout information
  • get_triage_summary: Comprehensive binary overview

Session Management

  • list_binaries: List loaded binaries
  • get_binary_status: Binary status and metadata
  • update_analysis_and_wait: Force analysis update

MCP Resources

All tools are also available as URI-accessible resources:

binassist://{filename}/triage_summary
binassist://{filename}/functions
binassist://{filename}/imports
binassist://{filename}/exports
binassist://{filename}/strings
binassist://{filename}/segments
binassist://{filename}/sections

Integration Examples

Claude Desktop

Add to your Claude Desktop configuration (claude_desktop_config.json):

{
  "mcpServers": {
    "binassist-mcp": {
      "command": "binassist-mcp",
      "args": ["stdio"]
    }
  }
}

SSE Integration

For web-based MCP clients:

SSE Endpoint: http://localhost:9090/sse

Development

Setup Development Environment

# Clone repository
git clone https://github.com/binassist/binassist-mcp.git
cd BinAssist-MCP

# Install in development mode
pip install -e ".[dev]"

# Install pre-commit hooks
pre-commit install

Running Tests

# Run all tests
pytest

# Run with coverage
pytest --cov=binassist_mcp

# Run specific test categories
pytest -m unit
pytest -m integration

Code Quality

# Format code
ruff format

# Lint code
ruff check

# Type checking
mypy src/binassist_mcp

CLI Commands

Server Commands

# Start server with binaries
binassist-mcp serve binary1.exe binary2.so

# STDIO transport only
binassist-mcp stdio

# Show configuration
binassist-mcp config

# System check
binassist-mcp check

Analysis Commands

# Quick binary analysis
binassist-mcp analyze /path/to/binary.exe

# Show version
binassist-mcp version

Architecture

BinAssist-MCP uses a modular architecture:

  • Server Layer: FastMCP-based server with dual transport support
  • Context Management: Multi-binary session handling with lifecycle management
  • Tools Layer: Comprehensive Binary Ninja API integration
  • Configuration: Pydantic-based settings with Binary Ninja integration
  • Plugin Integration: Native Binary Ninja plugin with UI integration

Performance

  • Concurrent Binaries: Supports up to 50 concurrent binaries (configurable)
  • Memory Management: Automatic cleanup and eviction policies
  • Analysis Caching: Optional result caching for improved performance
  • Transport Efficiency: Optimized SSE and STDIO transport implementations

Contributing

Contributions welcome!

Development Workflow

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes with tests
  4. Run the test suite and linting
  5. Submit a pull request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

  • Binary Ninja: For providing the comprehensive reverse engineering platform
  • Anthropic: For the Model Context Protocol specification
  • FastMCP: For the excellent MCP server framework
Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
WindsurfThe new purpose-built IDE to harness magic
Serper MCP ServerA Serper MCP Server
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
Amap Maps高德地图官方 MCP Server
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
Playwright McpPlaywright MCP server
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
ChatWiseThe second fastest AI chatbot™
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
DeepChatYour AI Partner on Desktop
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
CursorThe AI Code Editor
Context7Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
Tavily Mcp