Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Principle:2akouwu Reverify MCP Tool Integration

From Leeroopedia
Knowledge Sources
Domains MCP, LLM_Agents, Tool_Integration, Reverse_Engineering
Last Updated 2026-10-24 12:00 GMT

Overview

Integration pattern that exposes a deterministic reverse-engineering toolkit to AI agents via the Model Context Protocol (MCP), so agents can parse, disassemble, verify, and reconstruct binaries with tools as ground truth — never reporting a structural fact the tools did not confirm.

Description

MCP Tool Integration bridges the gap between deterministic RE tools and AI agent environments (Claude Code, Cursor, Cline, OpenCode). Instead of the agent guessing at binary structure, the agent calls MCP tools that read the real bytes and return structured results. The toolkit provides 10 tools:

  • Parsing: re_auto_triage (format/arch/sections summary), re_parse / re_parse_pe (full BinaryInfo), re_backends (engine report).
  • Disassembly: re_pattern_scan (AOB signature scan), re_disasm (hex → instructions).
  • Semantic: re_semantic (angr-based function boundaries, call graph, xrefs, reachability).
  • Verification: re_verify_claim (the core loop: check claims, return verdicts with evidence, record to ledger).
  • State: re_ledger (recover grounded facts after compaction), re_checkpoint (save/load task hand-off).

The server communicates via stdio JSON-RPC 2.0. The initialize response includes LEDGER_INSTRUCTIONS — guidance telling the agent to call re_ledger after a context reset to restore grounded state rather than re-deriving it.

The key principle: the agent proposes, the tools judge. The agent calls re_verify_claim before reporting any structural fact. Verified results are recorded in the durable ledger automatically, so they survive compaction. A claim already in the ledger returns known=true with weight 0 — restating it says nothing new.

Usage

Use this principle when:

  • You want AI agents (Claude Code, Cursor, Cline, OpenCode) to verify binary claims with deterministic tools.
  • You need the agent to recover state after context compaction via the ledger.
  • You want the agent to checkpoint and resume long tasks across sessions.
  • You need a stdio-based tool server that any MCP-compatible client can connect to.

Theoretical Basis

The integration follows the MCP JSON-RPC 2.0 protocol:

# Abstract algorithm (NOT real implementation)
# Server loop: read JSON-RPC from stdin, write responses to stdout
for line in stdin:
    request = json.loads(line)
    if request.method == "initialize":
        respond(protocolVersion, capabilities, serverInfo, instructions)
    elif request.method == "tools/list":
        respond(TOOLS_MANIFEST)  # 10 tool definitions with inputSchema
    elif request.method == "tools/call":
        result = handle_tool_call(request.params.name, request.params.arguments)
        respond(result)
    elif request.method == "resources/list":
        respond(list_ledgers_as_resources())  # each ledger is a resource
    elif request.method == "resources/read":
        respond(read_ledger(request.params.uri))  # reverify://ledger/<sha24>
    # notifications get no response

Key properties:

  • Tools as ground truth: Every tool result comes from deterministic engines reading the actual bytes. The agent trusts tool output, not its own guesses.
  • Automatic ledger recording: re_verify_claim records verified results to the ledger by default (record=true). After compaction, re_ledger restores them.
  • Known-claim detection: A claim already in the ledger returns known=true, weight 0 — the agent learns it already knows this.
  • Checkpoint hand-off: re_checkpoint saves the model's working state (done/todo/decisions/next_step) as UNVERIFIED, separate from the ledger's verified facts.
  • Resources: Each binary's ledger is exposed as an MCP resource (reverify://ledger/<sha24>), readable via resources/read.

Practical Guide

To integrate reverify as an MCP server:

  1. Install: pip install reverify (the MCP server is reverify-mcp).
  2. Configure the client: Add the server to your MCP client config (e.g., Claude Code's .mcp.json) with command reverify-mcp.
  3. Agent calls tools: The agent calls re_auto_triage to inspect a binary, re_verify_claim to check claims, re_ledger to recover state.
  4. After compaction: The agent calls re_ledger with the file path to restore grounded facts.
  5. Checkpoint long tasks: The agent calls re_checkpoint save before compaction, re_checkpoint load after.

Related Pages

Implemented By

Related Principles

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment