Skip to main content
Glama
re-binary-diff

re-binary-diff

by Heretek-RE

re-binary-diff

MCP server for read-only binary comparison: a unified diff between two files, and a per-section fingerprint of one file. Dry-run only — the server never writes a byte to disk.

Why

The 2026-06-05 stress test surfaced a need to compare an original binary against a patched copy (the Output/.../patches/ workflow) without re-introducing the on-disk patch primitive. re-binary-diff is the read-only cousin: it reports the diff, it never applies it.

Related MCP server: BinaryAnalysis-MCP

Tools

Tool

What it does

check_binary_diff

Health check — re-binary-diff has no system deps; always status: OK

unified_diff

Run difflib.unified_diff over the byte streams of two files (or, if too large, hash their chunks) and return a structured diff

fingerprint_sections

Return per-chunk SHA-256 + offset + size for a single file (a structural fingerprint, like re-lief.normalize_for_diff but at chunk granularity)

Install

Part of the RE-AI plugin; ./install.sh installs the package. To install standalone:

pip install -e ./servers/re-binary-diff

Run

re-binary-diff                              # stdio transport (default for MCP)
python -m re_binary_diff                    # equivalent

Available Tools

3 tools
check_binary_diffA

Return server status + version. Always status: OK — re-binary-diff has no external system dependencies.

Inputs: no named parameters.

fingerprint_sectionsA

Return a per-chunk SHA-256 + offset + size fingerprint of path.

Useful for finding the structural delta between two versions of a binary without loading either into memory. Pair with unified_diff (chunk mode) for large files.

Args: path: file to fingerprint chunk_size: bytes per chunk (default 1 MiB) max_chunks: 0 = no cap; > 0 = return at most N chunks

Returns::

{
  "path": "...",
  "size": N,
  "chunk_size": N,
  "truncated": bool,
  "chunks": [
    {"index": 0, "offset": 0, "size": 1048576, "sha256": "..."},
    ...
  ],
}

Inputs: path (required), chunk_size, max_chunks.

unified_diffA

Compute a unified-style diff between path_a and path_b.

For small files (<= 8 MiB per side) the function runs difflib.unified_diff over the byte streams (decoded as latin-1). For large files it falls back to a per-chunk SHA-256 diff.

Args: path_a: first file (the "before" or "original") path_b: second file (the "after" or "patched")

Returns::

{
  "path_a": "...",
  "path_b": "...",
  "size_a": N,
  "size_b": N,
  "mode": "sha256_equal" | "inline_unified_diff" | "chunk_sha256_diff",
  "equal": bool,
  "diff_lines": ["...", ...],   (inline mode)
  "chunk_diff": [{...}, ...],   (chunk mode)
}

The function is read-only. The "patched" copy at path_b is not modified.

Inputs: path_a (required), path_b (required).

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A3.9/5.0

    Scored across 3 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose: a health check, a single-file fingerprint, and a two-file diff. There is no ambiguity about which tool to use for a given task.

    Naming Consistency3/5

    Tool names use different patterns: 'check_binary_diff' (verb_noun), 'fingerprint_sections' (verb_noun), and 'unified_diff' (adjective_noun). The mixing of conventions reduces consistency.

    Tool Count4/5

    With 3 tools, the server is well-scoped for binary diffing tasks. It covers the essential operations without excess, though some might argue a tool to list chunks could be merged.

    Completeness4/5

    The tool set covers the core workflow: fingerprint a file, compare two files, and check server status. There are minor gaps (e.g., no explicit tool to fetch specific chunks), but the provided tools are sufficient for the domain.

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      Not graded
      maintenance
      Enables intelligent file and folder comparison with advanced text normalization, duplicate detection, and line-level diff analysis. Provides secure workspace-constrained file operations with CRC32-based exact matching and smart text comparison capabilities.
      -
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables analysis of binary files (PE, ELF, Mach-O, COFF) by providing tools to retrieve info, headers, sections, imports, exports, libraries, security hardening, signatures, and COFF object file details.
      26
      GPL 3.0