Principle:2akouwu Reverify MCP Tool Integration
| 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_claimrecords verified results to the ledger by default (record=true). After compaction,re_ledgerrestores 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_checkpointsaves 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 viaresources/read.
Practical Guide
To integrate reverify as an MCP server:
- Install:
pip install reverify(the MCP server isreverify-mcp). - Configure the client: Add the server to your MCP client config (e.g., Claude Code's
.mcp.json) with commandreverify-mcp. - Agent calls tools: The agent calls
re_auto_triageto inspect a binary,re_verify_claimto check claims,re_ledgerto recover state. - After compaction: The agent calls
re_ledgerwith the file path to restore grounded facts. - Checkpoint long tasks: The agent calls
re_checkpoint savebefore compaction,re_checkpoint loadafter.
Related Pages
Implemented By
- Implementation:2akouwu_Reverify_run_mcp_server
- Implementation:2akouwu_Reverify_handle_tool_call
- Implementation:2akouwu_Reverify_Verifier
- Implementation:2akouwu_Reverify_Ledger
Related Principles
- Principle:2akouwu_Reverify_Tool_Grounded_Verification — the tools exposed via MCP implement this principle.
- Principle:2akouwu_Reverify_Durable_Ledger — the ledger is exposed via
re_ledgerand resources. - Principle:2akouwu_Reverify_Context_Rollover — checkpoints complement the ledger for model-written state.