re-patch
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@re-patchApply a byte-level patch to the firmware binary at offset 0x100 with value 0x90"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
re-patch
MCP server for on-disk patching of binary artifacts. Provides:
SHA-256 manifest of a binary (so the original can be verified / restored)
Byte-level patch application: copy a file, write
new_bytesatoffset, save the resultManifest-driven restore: read the manifest, copy the original back
The server does not enforce policy — it surfaces an audit log
(confirm_legal parameter) so the calling agent records the
justification for every patch. The user / run policy is the
caller's responsibility.
Why
The 2026-06-05 stress test surfaced a need for an on-disk patch primitive that's:
Auditable — every call carries a
confirm_legaltext the analyst must type inReversible — the SHA-256 manifest + restore_original tool let the analyst roll back to the exact original bytes
Non-destructive —
apply_patchwrites a copy atdst, not in place; the original atsrcis never modified
Related MCP server: hashline-mcp
Tools
Tool | What it does |
| Health check — |
| Return the SHA-256 of path (hex-encoded) |
| Copy |
| Copy |
Install
Part of the RE-AI plugin; ./install.sh installs the package. To
install standalone:
pip install -e ./servers/re-patchRun
re-patch # stdio transport (default for MCP)
python -m re_patch # equivalentAvailable Tools
4 toolsapply_patchA
Copy src to dst, then splice new_bytes_b64 at offset.
This is the on-disk patch primitive. The original bytes at src are never modified; the patch is written to a copy at dst. The function returns both the pre-patch and post-patch SHA-256 so the analyst can record the patch's net effect in the report.
Args: src: source file (the original; never modified) dst: destination file (created or overwritten with the patched copy) offset: byte offset into dst at which to write (0-based) new_bytes_b64: base64-encoded bytes to splice in confirm_legal: free-text justification (the audit trail; the server does not enforce policy)
Returns::
{
"src": "...",
"dst": "...",
"src_sha256": "<original>",
"dst_sha256": "<patched>",
"src_size": N,
"dst_size": N,
"offset": N,
"patched_bytes": M,
"confirm_legal": "...",
}Override-scope contract: this tool is gated behind
the run's policy override (see override-scope.md of
the active run). The override authorizes on-disk patches
only inside Output/<run-id>/patches/; the
confirm_legal text must reference the override file
and the rationale.
| Name | Required | Description | Default |
|---|---|---|---|
| src | Yes | ||
| dst | Yes | ||
| offset | Yes | ||
| new_bytes_b64 | Yes | ||
| confirm_legal | No |
check_patchA
Return server status + version. Always status: OK —
re-patch has no external system dependencies (pure
Python stdlib + mcp / pydantic).
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
restore_originalA
Copy original back to restore_target, optionally verifying the original's SHA-256 against expected_sha256 first.
This is the rollback primitive. The function:
Computes the SHA-256 of original.
If expected_sha256 is non-empty, verifies the computed hash matches (refuses to proceed otherwise).
Copies original to restore_target (overwriting).
Args: original: file whose bytes are the canonical "original" (typically the source the patch was applied from) restore_target: file to write the original bytes to (typically the patched copy) expected_sha256: optional hex-encoded SHA-256 to verify original against confirm_legal: free-text justification (audit trail)
Returns::
{
"original": "...",
"restore_target": "...",
"original_sha256": "<hash>",
"expected_sha256": "<hash>" or null,
"verified": bool,
"confirm_legal": "...",
}
| Name | Required | Description | Default |
|---|---|---|---|
| original | Yes | ||
| restore_target | Yes | ||
| expected_sha256 | No | ||
| confirm_legal | No |
sha256_manifestA
Compute the SHA-256 manifest of path.
Args: path: file to hash
Returns::
{
"path": "...",
"size": N,
"sha256": "<64 hex chars>",
}Use this to record the canonical SHA-256 of the original
binary before any patch is applied. The hash is the
rollback key: restore_original(original, target, expected_sha256=...) will refuse to proceed if the
original's hash has drifted.
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes |
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
4 tool updates
v0.1.0- First observed
apply_patch - First observed
check_patch - First observed
restore_original - First observed
sha256_manifest
TDQS
Scored across 4 tools
Each tool has a distinct purpose: applying patches, health check, rollback, and hash computation. No overlap or ambiguity.
All tool names follow a consistent verb_noun pattern in snake_case (apply_patch, check_patch, restore_original, sha256_manifest).
4 tools is well-scoped for a focused patching utility; each tool is necessary and justified.
Core patching workflow (hash, apply, rollback, health) is covered, though a tool to list applied patches is missing.
Related MCP Connectors
MCP server for mandates, delegation, policy-gated execution, credential grants, and audit.
The MCP server that vets MCP servers: identity, risk grade and per-tool risk before you install.
Guarded MCP server for agent-readable business truth, provenance, readiness, and discovery.
A MCP server built for developers enabling Git based project management with project and personal…
Related MCP Servers
- AlicenseNot gradedqualityNot gradedmaintenanceA deterministic MCP server that enforces auditable workflows by requiring AI agents to provide structured justifications and obtain human approval for file operations. It provides a secure, tamper-evident pipeline for tracking agent intent and codebase changes through cryptographic signatures and SQLite indexing.AGPL 3.0
- FlicenseAqualityDmaintenanceAn MCP server for precise, hash-referenced file editing that enables atomic edits using line:hash references instead of fragile line numbers or full content reproduction.2-
- AlicenseNot gradedqualityBmaintenanceA filesystem MCP server that journals every file operation (write, delete, move, mkdir) and outbound commands (exec, http) into an append-only ledger, enabling undo and compensation of actions.MIT
- AlicenseAqualityDmaintenanceA local-first, model-neutral MCP server for collecting and normalizing change-scoped release evidence. It provides deterministic Git change summaries, evidence collection, and review bundles for agent review.77 npmApache 2.0