Skip to main content
Glama
BinDiff MCP Tool

BinDiff MCP Tool

by u21h2

BinDiff MCP Tool

A Model Context Protocol (MCP) server that provides binary comparison capabilities using IDA Pro and BinDiff.

Features

  • Compare Binaries: Compare two binary files (e.g., original vs. patched).

  • Function Analysis: Get a summary of similarity and a list of changed functions.

  • Headless Operation: Uses IDA Pro in headless mode and IDAPython for automation.

Related MCP server: ida-pro-mcp-plus

Installation

Prerequisites

  • Python 3.10+

  • IDA Pro (9.0+ recommended)

  • BinDiff (installed and capable of running from command line).

  • uv (recommended for package management).

Installing BinDiff on Linux (Ubuntu/Debian)

  1. Download the latest .deb package (e.g., bindiff_8_amd64.deb) from the official releases.

  2. Install using dpkg:

    sudo dpkg -i bindiff_8_amd64.deb
  3. Verify installation:

    which bindiff

Platform-Specific Configuration

The tool attempts to auto-detect IDA and BinDiff. You can override these by setting environment variables or editing src/config.py.

macOS

  • IDA Pro: 9.1 (recommended) or 9.0+.

  • BinDiff: Installed via installer.

  • Environment:

    • IDADIR: Path to IDA installation (e.g., /Applications/IDA91/IDA Professional 9.1.app/Contents/MacOS).

    • BINDIFF_PATH: Path to bindiff binary (e.g., /usr/local/bin/bindiff).

Linux (Ubuntu etc.)

  • IDA Pro: 9.0+ installed (e.g., in /opt/idapro-9.1).

  • BinDiff: Installed and accessible.

  • Environment:

    • IDADIR: Required. Set to your IDA installation base directory containing libidalib.so (e.g., /opt/idapro-9.1).

    • BINDIFF_PATH: Path to bindiff executable (default checks $PATH).

    • Ensure idalib is present in $IDADIR/idalib.

Configuration

Environment Variables

  • IDADIR: Path to the IDA Pro installation directory (containing idat and idalib).

  • BINDIFF_PATH: Path to the bindiff executable.

  • MCP_TIMEOUT: Timeout for analysis steps in seconds (default: 3600).

Installation

  1. Clone this repository.

  2. Install dependencies using uv:

    uv sync

Usage

Start the server in SSE mode so it can be accessed by remote or local clients via HTTP:

Linux (Docker/Server):

IDADIR=/app/ida-pro-9.1 BINDIFF_PATH=/usr/bin/bindiff uv run bindiff-mcp --transport sse --host 0.0.0.0 --port 8001

macOS:

IDADIR="/Applications/IDA91/IDA Professional 9.1.app/Contents/MacOS" BINDIFF_PATH=/usr/local/bin/bindiff uv run bindiff-mcp --transport sse --host 0.0.0.0 --port 8001

Client Configuration (Antigravity, Claude Desktop, etc.)

Configure your MCP client to connect via the /sse endpoint:

{
  "mcpServers": {
    "bindiff-mcp": {
      "type": "remote",
      "url": "http://127.0.0.1:8001/sse"
    }
  }
}

Development

  • Structure:

    • src/server.py: Main MCP server entry point.

    • src/core/: Core logic for IDA export, BinDiff execution, and parsing.

    • src/config.py: Configuration handling.

Available Tools

1 tool
bindiff_compareA
Compares two binary files using IDA Pro and BinDiff.
Resulting detailed difference lists are saved to the specified directory (default: current directory).
Generated files:
1. matched_similar.json (Identical functions)
2. matched_different.json (Matched but Changed functions)
3. primary_only.json (Unmatched in Primary)
4. secondary_only.json (Unmatched in Secondary)

Args:
    primary_binary: Path to the first binary (e.g. original)
    secondary_binary: Path to the second binary (e.g. patched)
    output_results_dir: Directory to save the result files (default: current dir)

Inputs: primary_binary (required), secondary_binary (required), output_results_dir. Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.1/5.0

    Scored across 1 tool

    Disambiguation5/5

    With only one tool, there is no possibility of ambiguity or overlap between tools. The single tool has a clearly defined purpose of comparing binary files using BinDiff and IDA Pro.

    Naming Consistency5/5

    The single tool name 'bindiff_compare' follows a clear verb_noun pattern and is consistent with itself. There are no other tools to create inconsistency.

    Tool Count2/5

    A single tool is generally too few for most server purposes, making the surface feel thin and incomplete. While this might be appropriate for a very narrow utility, it limits functionality and suggests the server may be under-scoped.

    Completeness2/5

    The server appears focused on binary comparison, but with only a compare tool, there are significant gaps. Missing operations might include analyzing results, managing comparisons, or integrating with other BinDiff features, making the surface incomplete for typical binary analysis workflows.

    Maintenance

    ActivityInactive
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      An enhanced MCP server for IDA Pro that integrates bulk binary export, multi-instance management via Broker mode, and 80+ analysis tools for AI-assisted reverse engineering.
      6
      MIT
    • A
      license
      A
      quality
      C
      maintenance
      Enables AI agents to perform Ghidra binary diffing, returning structured match statistics, function changes, and code diffs as JSON.
      13
      2
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables reverse-engineering agents to export binaries to BinExport format and compare two builds, returning matched, changed, and build-unique functions with addresses, names, similarity, and confidence scores. Diff results are written as JSON files with overall similarity and confidence summaries.
      56 PyPI
      1
      MIT