Skip to main content
Glama
TTTTTakumi

rea_patch_server

by TTTTTakumi

rea-toolkit

rea(Reverse Engineer Anything)MCP 生态的补丁执行层:补齐「分析 → 写回 → 验证」闭环。

PyPI - Version Python Versions License: MIT

基于 rea 6.8.0

本项目基于 rea(Reverse Engineer Anything,REA Agents) 6.8.0 版本修改而来,在其之上扩展了补丁执行层(rea_patcher / rea_text_patcher / rea_patch_server)。上游 rea 采用 MIT License,本项目同样以 MIT 协议开源。

Related MCP server: re-patch

为什么做这个

rea-agents 是目前最热门的逆向分析 MCP server(约 1.7 万星),提供 170+ 个只读分析工具:反编译、伪代码、字符串、引用、抓包、APK/固件拆解……原始文件字节永不被修改。

但逆向工作流最后一步往往是写回:改掉某个跳转、改配置、调参数。rea 本身不做这件事——这就是 rea-toolkit 的定位:

rea

rea-toolkit

定位

只读分析(170+ 工具)

补丁写回(12 工具)

文件改动

永不改动原文件

保护式写回 + 备份回滚

使用方式

MCP / CLI

MCP / CLI,与 rea 互补

两层补丁能力,覆盖从 exe 到配置文件的全部写回场景:

  • 二进制补丁 rea_patcher:PE/ELF/Mach-O 三格式认知(VA/偏移自动按段映射换算)、hex 补丁、掩码通配、JSON 批量清单、dry-run 预览、回读校验、失败自动回滚。

  • 多语言文本/代码补丁 rea_text_patcher:replace / regex / line / json / ini 五种操作原语,编码自适应(UTF-8/GBK/UTF-16),保留结构、注释与缩进,同样带备份回滚。

v1.1.1 新特性

  • ELF / Mach-O 支持:文件格式自动识别(pe | elf | macho),ELF 走 PT_LOAD 段映射、Mach-O 走 LC_SEGMENT 段映射做 VA→文件偏移换算,rea_patcher info/patch/verify 全链路适配 ELF32/64、Mach-O 32/64 及大小端。

  • 审批闸门(Approval Gate):通过环境变量 REA_PATCH_APPROVAL_ROOTS 配置需审批的目录列表(如系统关键路径),命中审批区且未显式授权时直接拒绝写入;调用方显式传 require_approval=true 才放行。

  • 审计日志(Audit Log):所有 apply / restore / manifest 操作(含批准与拒绝)写入 audit/rea_patch_audit.jsonl(默认位于模块目录下,可用环境变量 REA_PATCH_AUDIT_LOG 覆盖),记录动作、目标文件、结果与审批状态,供事后核查。

安装

pip install mcp
pip install rea-toolkit     # 或从源码: pip install .

CLI 快速开始

二进制补丁(rea-patcher)

# 查看 PE 概况(镜像基址 / 段表 / SHA-256)
rea-patcher info game.exe

# dump 文件偏移处字节
rea-patcher dump game.exe 0x434 16

# 打补丁:偏移:旧字节:新字节(可多次 -p;va0x 前缀自动按 image base 换算)
rea-patcher patch game.exe -p 0x434:7508EB02:90909090

# 掩码通配(? 任意字节)+ dry-run 预览
rea-patcher patch game.exe -p "0x100:75??EB??:9090E9??" --dry-run

# JSON 清单批量补丁(可复用、可交接)
rea-patcher patch game.exe --manifest patches.json

# 校验 / 恢复 / 哈希
rea-patcher verify game.exe 0x434 90909090
rea-patcher restore game.exe --force
rea-patcher sha256 game.exe

文本/代码补丁(rea-text-patcher)

# 只读查看(自动识别编码)
rea-text-patcher view app.py -s 1 -e 20

# 只读搜索定位
rea-text-patcher search main.py "hp_max" -r

# 打文本补丁(op 为 JSON,可多次 -o):
rea-text-patcher patch app.py -o '{"op":"replace","old":"a","new":"b"}'
rea-text-patcher patch cfg.json -o '{"op":"json","path":"player.hp","new_value":9999}'
rea-text-patcher patch game.ini -o '{"op":"ini","section":"Graphics","key":"Width","new_value":2560}'

# 校验 / 恢复
rea-text-patcher verify app.py --contains "b"
rea-text-patcher restore app.py --force

文本补丁 ops 一览

op

用途

关键参数

replace

字符串精确替换

old, new, count / occurrence

regex

正则替换

pattern, replace, flags

line

行级操作

action=replace/insert_before/insert_after/delete, line, content, expected

json

JSON 键值修改

path(a.b[0].c), new_value, old_value

ini

INI/CFG 键值修改

section, key, new_value, expected_value

安全网:所有 ops 顺序执行,任一失败整批拒绝;自动备份 <file>.reapat_txt_bak;dry-run 只预览;写回后回读校验,失败自动回滚。

MCP server(rea_patch_server)

作为 MCP server 接入任意支持 MCP 的 Agent(Claude Code / Codex / Cursor / Marvis 等),注册示例(stdio):

command: python
args:    [<absolute path>\rea_patch_server.py]

二进制层工具

工具

说明

rea_patch_pe_info

只读:PE 概况

rea_patch_dump

只读:偏移处字节

rea_patch_va_to_offset

VA 转文件偏移

rea_patch_apply

打补丁(保护式写回)

rea_patch_verify

只读:校验偏移字节

rea_patch_restore

从备份恢复

rea_patch_sha256

只读:文件哈希

文本/代码层工具

工具

说明

rea_patch_text_view

只读:按行查看文本/代码(编码自适应)

rea_patch_text_search

只读:搜索定位关键字/正则,返回命中行号

rea_patch_text_apply

打文本补丁(replace/regex/line/json/ini,保护式写回)

rea_patch_text_verify

只读:校验包含/不包含

rea_patch_text_restore

从文本备份恢复

所有偏移参数支持 0x 前缀十六进制字符串。

与同类项目对比

rea-toolkit

re-patch (RE-AI 生态)

hex-mcp

pyghidra-lite

二进制补丁

✅ hex + 掩码通配 + 批量清单

✅ 单偏移写入

✅ hex 查看+补丁

⚠️ 仅分析,写回受限

PE/VA 换算

✅ 内置

❌

❌

✅(Ghidra)

文本/代码补丁

✅ 5 种 op 结构感知

❌

❌

❌

配置文件(JSON/INI)

✅ 保留格式/注释

❌

❌

❌

备份/回滚

✅ 双引擎

✅ manifest

⚠️ .bak

⚠️ 部分

回读校验后回滚

✅

❌

❌

❌

dry-run 预览

✅

❌

✅

❌

与 rea(REA) 直接互补

✅

❌(独立生态)

❌

❌

测试

python -m pytest tests/ -v

License

MIT

Available Tools

12 tools
rea_patch_applyA

打补丁(写回原文件)。

patches 每项: {"offset": "0x434 或 va0x140001234", "old": "AA??BB", "new": "909090"}

  • old 支持 ? 通配(任意字节)

  • 自动创建 .reapat_bak 备份;旧字节不匹配整批拒绝

  • 写回后逐字节回读校验,不匹配自动从备份回滚 force=true: 已有备份时仍以当前文件为基准(覆盖旧备份) dry_run=true: 只校验与预览,不写盘

NameRequiredDescriptionDefault
forceNo
dry_runNo
patchesYes
file_pathYes
image_baseNo

TDQS

A3.9/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations present, the description takes on the full disclosure burden and handles it well: it states that a .reapat_bak backup is created automatically, that a mismatched old-byte aborts the whole batch, that each byte is read back and verified after writing, and that a failure triggers an automatic rollback from the backup. It does not cover file locking, permissions, or the response format, which keeps it from a 5.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The purpose is front-loaded in the first line, followed by a clear patch-record example and a short bullet list of invariants. Every line adds information an agent needs, with no restatement of the name or title.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 5-parameter mutation tool with no annotations and no output schema, the description covers the critical behaviors (backup, atomic rejection, readback verification, rollback, preview mode) that an agent needs before invoking it. Gaps remain around image_base semantics and what the tool returns on success or partial failure.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate, and it explains the patches array structure (offset/old/new), accepts 0x or va0x offsets, supports '?' byte wildcards in old, and defines the force and dry_run flags precisely. file_path and image_base remain undocumented, and image_base's interaction with va0x offsets is left unstated.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The definition opens with a specific verb and resource ('打补丁(写回原文件)'), making clear that this tool writes the patched bytes back to the target file rather than verifying or restoring it. The 'write back to the original file' phrasing distinguishes it from siblings such as rea_patch_verify and rea_patch_restore, though neither sibling is named explicitly.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is implied through the dry_run and force flags, and the atomic-rejection semantics hint at when a preview run is warranted. However, the description never states when to reach for this tool versus rea_patch_verify or rea_patch_restore, nor does it prescribe a verify-after-apply workflow.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

rea_patch_dumpC

只读查看文件偏移处字节(offset 支持 0x 前缀十六进制)。

NameRequiredDescriptionDefault
lengthNo
offsetYes
file_pathYes

TDQS

C2.8/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full behavioral burden. It usefully discloses that the operation is read-only and that offset accepts a 0x hexadecimal prefix, but it omits output format, length behavior, error conditions, and any limits on how many bytes can be dumped.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single front-loaded sentence with no wasted words, stating the core action and the most important parameter format immediately.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with no annotations, no output schema, and 0% schema description coverage, the definition is too sparse. It does not explain the return value (which is important without an output schema), the default length of 16, or how length constrains the dump.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate for all three parameters. It only addresses offset by mentioning 0x-prefix hexadecimal support, which is useful but also potentially conflicts with the schema's integer type; file_path and length are not explained at all.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states a specific operation: read-only viewing of bytes at a file offset. It identifies the resource (file bytes at an offset) and the read-only nature, but does not explicitly differentiate this from sibling tools such as rea_patch_text_view or rea_patch_text_search.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The only usage signal is '只读查看' (read-only view), which implies safe inspection but gives no guidance on when to use this tool versus text_view, text_search, or other dump/inspection siblings. There are no exclusions or alternative conditions provided.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

rea_patch_pe_infoA

只读查看 PE 文件概况:镜像基址、段表、大小、SHA-256。

NameRequiredDescriptionDefault
file_pathYes

TDQS

A3.8/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full behavioral burden and does disclose the key trait: this is a read-only, non-mutating inspection. It also names what is returned, so an agent knows no changes occur. It stops short of stating failure behavior for invalid or non-PE paths.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single front-loaded clause: read-only qualifier first, then the resource, then the returned fields. No wasted words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a one-parameter read tool with no output schema, the description adequately signals the return contents and safety profile. Only minor gaps remain (error cases, path expectations).

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

There is one parameter (file_path) at 0% schema description coverage, and the description adds no semantics for it. The parameter is largely self-explanatory, but nothing confirms it should be a local filesystem path versus a PE-relative path.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb (查看/read-only view) and resource (PE file overview) and enumerates the returned content (image base, section table, size, SHA-256). It implicitly separates itself from the mutation siblings (apply/restore/patch), though it never names an alternative explicitly.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The '只读' qualifier implies this is the inspection step before patching, but there is no explicit when-to-use rule or pointer to a sibling such as rea_patch_sha256 for hash-only needs. Usage is inferable but not stated.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

rea_patch_restoreB

从 .reapat_bak 备份恢复原文件。force 覆盖当前文件。

NameRequiredDescriptionDefault
forceNo
file_pathYes

TDQS

B3.1/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations exist, so the description carries the full disclosure burden. It does usefully disclose that force overwrites the current file, which is the key destructive nuance, but says nothing about what happens if no .reapat_bak exists, whether the current file is preserved first, or what the tool returns.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two short sentences, both earning their place, with the restore action front-loaded before the force caveat. It is efficient, though arguably too terse for a mutation tool with zero schema documentation.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

A destructive mutation tool with no annotations, no output schema, and 0% parameter documentation needs more: backup-absence behavior, file_path meaning, and routing against rea_patch_text_restore are all missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0%, so the description must compensate. It explains force well (overwrites the current file), but file_path is ambiguous — it is unclear whether it names the original file whose backup is restored or the backup itself. Half the parameters are effectively undocumented.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb (restore) and resource (the original file, sourced from the .reapat_bak backup), so the agent knows exactly what it does. It does not differentiate itself from the near-identical sibling rea_patch_text_restore, leaving the agent to infer which restore applies to which artifact.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to restore versus rea_patch_apply/verify, or versus the text_restore sibling. The implied usage (undo an applied patch) is only inferable from the name, not stated.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

rea_patch_sha256B

只读计算文件 SHA-256。

NameRequiredDescriptionDefault
file_pathYes

TDQS

B3/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the burden and does disclose the key behavioral trait '只读' (read-only, no file mutation). However, it says nothing about error behavior (e.g., missing file), or the format of the computed hash, leaving meaningful behavioral gaps.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single short sentence, front-loaded with the read-only trait and the core operation. Zero waste, though the terseness borders on under-specification.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple one-parameter read-only tool with no output schema, the description conveys the core operation, but omits what is returned (the hash string/format) and any parameter or error handling detail. Adequate but with clear gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0%, so the description must compensate. It only implies that '文件' (file) is the input being hashed, without clarifying the format, path conventions, or whether directories are accepted. This is marginal guidance over an undocumented file_path parameter.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb+resource ('计算文件 SHA-256' / compute file SHA-256), which is unambiguous. It doesn't explicitly contrast with siblings, but no sibling performs hashing, so the purpose is inherently distinguishable. Slightly weaker because it doesn't name what it is not.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No explicit when-to-use guidance or alternatives are provided. The '只读' qualifier hints at a non-mutating use case, but the agent is left to infer when hashing is appropriate versus the other rea_patch_* tools.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

rea_patch_text_applyA

对文本/代码文件打补丁(多语言通用)。

ops 按顺序执行,每一项: {"op": "replace", "old": "...", "new": "...", "count": n|None, "occurrence": n|None} 字符串精确替换;count=只替换前 n 次;occurrence=只替换第 n 次出现 {"op": "regex", "pattern": "...", "replace": "...", "flags": re 数值} 正则替换(全部命中) {"op": "line", "action": "replace|insert_before|insert_after|delete", "line": 行号(1-based), "content": "...", "expected": "可选行内容校验"} 行级操作 {"op": "json", "path": "a.b[0].c", "new_value": ..., "old_value": 可选预期校验} JSON 配置键值修改(保留缩进与编码) {"op": "ini", "section": "...", "key": "...", "new_value": "...", "expected_value": 可选预期校验} INI/CFG 配置键值修改(保留注释与格式)

安全网:自动备份 .reapat_txt_bak;全部 ops 先内存模拟,任一失败整批拒绝; 写盘后回读校验,失败自动从备份回滚;dry_run=true 只预览不写盘。

NameRequiredDescriptionDefault
opsYes
forceNo
dry_runNo
encodingNo
file_pathYes

TDQS

A3.8/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden and does so well: it discloses automatic backup to <file>.reapat_txt_bak, in-memory simulation of all ops with whole-batch rejection on any failure, post-write readback verification with rollback from backup, and dry_run preview semantics. It omits what `force` overrides and any permission/encoding caveats, which keeps it from a 5.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is front-loaded with the one-line purpose, then the op table, then the safety-net paragraph, with no filler. The op table is long but every line corresponds to a genuine schema gap, so the length is earned.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a mutation tool with no annotations and no output schema, the description covers the essentials an agent needs: atomicity, backup, rollback, verification, and preview. The remaining gaps (`force`, `encoding`, and what a successful call reports back) are minor but real.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate, and it does for the hardest part: the `ops` array items are untyped in the schema, and the description supplies the full op vocabulary (replace/regex/line/json/ini) with field meanings including count and occurrence. Two of five parameters, `force` and `encoding`, get no explanation at all, so it falls short of complete.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The opening line names a specific verb and resource: patch text/code files, and adds scope ('多语言通用'). It implicitly separates this tool from the binary-oriented sibling rea_patch_apply by specifying text/code files, but it never names a sibling explicitly, so an agent must infer the split.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explains how each op type behaves and that dry_run only previews, which implies usage for the common cases. However, it never states when to choose this tool over rea_patch_text_search, rea_patch_text_verify, or rea_patch_apply, nor when not to use it (e.g., binary files).

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

rea_patch_text_restoreB

从 .reapat_txt_bak 文本备份恢复原文件。force 覆盖当前文件。

NameRequiredDescriptionDefault
forceNo
file_pathYes

TDQS

B3.4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description does flag the key destructive trait: it overwrites the current file, and `force` controls that overwrite. It is silent on what happens when force=false and the target exists (refuse? skip?), whether the backup is consumed after restore, and whether the backup must exist.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two short sentences, no waste, with the backup-suffix scoping stated before the overwrite condition. Well front-loaded for such a small tool.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

No annotations and no output schema, so the description is the sole behavioral source — and it omits error/precondition behavior (missing backup, existing target without force) and whether the restore is reversible. Adequate for the happy path, thin for a file-mutating operation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must carry the params — and it largely does: `file_path` is the original file whose '.reapat_txt_bak' companion is read, and `force` overwrites the current file. Only the exact force=false behavior is left ambiguous.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

Names a specific verb+resource: restoring the original file from a '<file>.reapat_txt_bak' text backup. The backup-suffix convention separates it from the generic sibling rea_patch_restore, though the description never says so explicitly.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

States the mechanics but never when to use this instead of rea_patch_restore, rea_patch_restore, or rea_patch_text_apply. An agent must infer the recovery-after-text-apply workflow from the tool name and backup suffix alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

rea_patch_text_verifyC

只读校验文本/代码文件是否包含/不包含某关键字或正则。

NameRequiredDescriptionDefault
regexNo
containsNo
encodingNo
file_pathYes
not_containsNo

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full disclosure burden. It does state the operation is read-only, which is useful. But it says nothing about what happens when the assertion fails (error thrown vs. boolean returned), how encoding is handled, or whether regex mode changes matching semantics—all critical for a verify tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single front-loaded sentence with no filler. It is appropriately sized for what it covers, though the size itself reflects the under-specification rather than deliberate economy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 5-parameter tool with no annotations and no output schema, one terse sentence is insufficient. The agent cannot determine result semantics (return value vs. exception on failed verification), encoding behavior, or the interaction between contains and not_contains.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 5 parameters at 0% schema description coverage, the schema supplies bare titles only. The description alludes to the contains/not_contains distinction and regex matching, but says nothing about file_path, encoding, or the type/meaning of the regex boolean. Most parameters remain undocumented in both places.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description names a specific verb (只读校验) and resource (文本/代码文件) with a clear scope: checking for presence or absence of a keyword or regex. An agent can grasp the operation immediately. It stops short of differentiating itself from the close sibling rea_patch_text_search, which likely performs a similar content lookup.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The phrase 只读校验 implies a validation/assertion use case rather than a discovery/search use case, which hints at when to prefer this over rea_patch_text_search. However, no explicit when-to-use, when-not-to-use, or alternative tool is named, leaving the routing decision to inference.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

rea_patch_text_viewC

只读按行查看文本/代码文件(自动识别 UTF-8/GBK/UTF-16 等编码)。

NameRequiredDescriptionDefault
encodingNo
end_lineNo
file_pathYes
start_lineNo

TDQS

C2.9/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It does disclose two real behavioral traits: the operation is read-only, and encoding is auto-detected across UTF-8/GBK/UTF-16. It omits what happens on binary files, output/line-number format, size limits, and behavior when end_line is null.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single compact sentence with the read-only guarantee and encoding detection front-loaded and no filler. It is efficient, though its brevity is partly the cause of the documentation gaps elsewhere.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With no annotations, no output schema, and 0% schema description coverage on 4 parameters, the description should explain line-range semantics, output shape, and limits. It covers only the read-only nature and encoding handling, leaving an agent unable to predict what a call returns.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0% across 4 parameters, so the description must compensate and largely does not. The encoding auto-detection remark hints at the encoding parameter's role, but start_line and end_line — the core of 'by-line' viewing — are never explained (defaults, inclusivity, omitted end_line semantics).

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb (按行查看 / view by line) and resource (文本/代码文件) plus a read-only constraint. An agent can distinguish it from siblings like rea_patch_text_search or rea_patch_text_apply by the 'view' action, though the description never names those alternatives explicitly.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this versus rea_patch_text_search, rea_patch_dump, or the apply/verify siblings. Usage is only implied by the word 'view' — no preconditions, no exclusions, no routing advice.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

rea_patch_va_to_offsetA

把 VA 虚拟地址换算为文件偏移(image_base 不传时自动读 PE 头)。

NameRequiredDescriptionDefault
vaYes
file_pathYes
image_baseNo

TDQS

A3.5/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full behavioral burden. It usefully discloses that omitting image_base triggers automatic PE header reading, but it does not state the return format, error behavior for invalid PE files, or validation constraints.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The definition is a single front-loaded sentence with the key optional-parameter behavior in parentheses. Every part earns its place and there is no redundant text.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a three-parameter conversion helper with no output schema and no annotations, the description covers the core action and image_base fallback. It still leaves out the return value and error conditions, so an agent has enough to attempt the call but not full context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. It clarifies va as a virtual address and explains image_base's fallback behavior, but file_path remains undocumented beyond its name, leaving partial compensation for the coverage gap.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description names a specific verb and resource: converting a VA virtual address to a file offset, and it adds the image_base fallback. It does not explicitly distinguish itself from sibling patch tools, but the operation is clear and unlikely to be confused with PE info, dump, apply, or text tools.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is implied by the conversion purpose: use it when a VA needs to become a file offset. However, the description gives no explicit when-not conditions, prerequisites, or alternative-tool routing, so guidance is only minimal.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

rea_patch_verifyB

校验文件偏移处字节是否符合预期(不写文件)。expected 十六进制串,如 90909090。

NameRequiredDescriptionDefault
offsetYes
expectedYes
file_pathYes

TDQS

B3.4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden, and it does disclose the key trait: it does not modify the file. However, it says nothing about what verification returns (boolean? error?), permissions, or failure behavior at the offset.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two short sentences, purpose front-loaded, then the parameter example. No wasted words. Nothing padded, though it could afford one more sentence on the offset format.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 3-param tool with no annotations and no output schema, the definition is thin: it doesn't specify the offset format or what the verification result looks like. The critical non-write behavior is covered, but key calling details are missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0%, so the description must compensate. It adds real meaning for 'expected' (hex string, with example 90909090), but leaves 'offset' ambiguous (byte offset? decimal or hex?) and 'file_path' undocumented. Partial compensation only.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb+resource: verify bytes at a file offset. The parenthetical '(不写文件)' explicitly frames it as the non-mutating counterpart to rea_patch_apply, aiding sibling differentiation. It stops short of naming the alternative tool explicitly, so not a full 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

'Does not write the file' implies this is the safe pre-check before rea_patch_apply, but the description never explicitly says when to use this versus rea_patch_apply, rea_patch_dump, or rea_patch_text_verify. Usage is implied rather than stated.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

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

  1. 12 tool updatesv1.1.0
    • First observedrea_patch_apply
    • First observedrea_patch_dump
    • First observedrea_patch_pe_info
    • First observedrea_patch_restore
    • First observedrea_patch_sha256
    • First observedrea_patch_text_apply
    • First observedrea_patch_text_restore
    • First observedrea_patch_text_search
    • First observedrea_patch_text_verify
    • First observedrea_patch_text_view
    • First observedrea_patch_va_to_offset
    • First observedrea_patch_verify

TDQS

A3.5/5.0

Scored across 12 tools

Disambiguation4/5

The set cleanly splits into binary-patch tools (pe_info, dump, va_to_offset, apply, verify, restore, sha256) and text-patch tools (text_view, text_search, text_apply, text_verify, text_restore), with the text_ prefix making the split obvious. The only real overlaps are that rea_patch_pe_info also reports SHA-256 (duplicating rea_patch_sha256), and verify/restore exist in both halves without names that scream which is which at a glance.

Naming Consistency4/5

All tools use the rea_patch_ snake_case prefix with clear verb/noun endings, so the pattern is predictable. The asymmetry is that only the text family gets the text_ qualifier while binary tools are unprefixed (rea_patch_apply vs rea_patch_text_apply), which is mildly inconsistent but still readable.

Tool Count5/5

Twelve tools is squarely in the well-scoped range, and each tool maps to a distinct step in the patch workflow (inspect, locate, apply, verify, restore) for both binary and text files. No tool feels redundant or padding.

Completeness4/5

Both halves cover a full patch lifecycle: inspect (pe_info/dump/text_view), search (text_search), transform (apply/text_apply), verify (verify/text_verify), and rollback (restore/text_restore), plus address math and hashing. The main gap is a binary byte-pattern/signature search — an agent hunting bytes must fall back to repeated dump calls, since only the text family has a search tool.

Maintenance

ActivityMaintained
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables applying unified diff patches to files with comprehensive security validation, automatic backup/rollback, and atomic multi-file operations. Provides 7 tools and 4 error recovery patterns for safe patch management workflows.
    2
    MIT
  • A
    license
    A
    quality
    C
    maintenance
    MCP server for on-disk patching of binary artifacts with SHA-256 manifest, byte-level patch application, and manifest-driven restore, ensuring auditability and reversibility.
    4
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables precise file patching using SEARCH/REPLACE blocks, with mandatory directory sandboxing, automatic Python QA (Ruff/Black/MyPy), and git versioning for rollback.
    1
    MIT
  • A
    license
    C
    quality
    B
    maintenance
    Enables an AI agent to auto-detect a game's engine (Unity, Unreal, Godot, Java, or native) from its files and then inspect, search, and patch the underlying binaries with in-process PE analysis, hex editing, pattern scanning, string extraction, checksums, diffing, and disassembly. Everything runs locally and offline with no cloud dependency or telemetry.
    10
    100
    55 npm
    5
    MIT