Skip to main content
Glama
Heretek-RE

re-dotnet-patch

by Heretek-RE

re-dotnet-patch

MCP server for structured patching of Mono / .NET assemblies.

Status

v2.8.0 — SKELETON. Tool contracts are final and pinned by tests (tests/test_re_dotnet_patch.py). The actual round-trip patcher backend (dnlib / Mono.Cecil / pythonnet) lands in v2.8.1.

Every mutating tool currently returns a structured {status: "not_implemented", reason, remediation, schema_for_replay} dict, so:

  1. Downstream skills can target the tool names today.

  2. Callers can serialize the operation as a patch descriptor for later replay once v2.8.1 lands.

  3. The CHANGELOG entry for v2.8.0 can advertise the new server even though the backend is deferred.

Related MCP server: revula

Tools

Tool

Status

What it does

check_dnlib

WARN (stub)

Probe for the future backend

nop_method

not_implemented

Replace a method body with a NOP-sled (return default)

replace_method_body

not_implemented

Replace a method body with caller-supplied IL bytes

replace_string_ldstr

not_implemented

Replace a specific ldstr operand within a method body

patch_assembly

not_implemented

Apply a list of operations atomically

rollback_patch

delegate

Delegate to re-patch.restore_original

Why a new server (not a helper in re-patch)?

re-patch is byte-splice only, pure-stdlib + mcp/pydantic. Adding a heavy dnlib / Mono.Cecil dep would bloat re-patch's surface for callers that only need a byte-splice. Per the v2.8.0 plan (approved 2026-06-07, LO decision), the Mono dnlib patcher ships as a new server to keep the dep boundary clean. Costs 1 server-count entry in .mcp.json (30 → 31).

What this server does NOT do

  • It does NOT NOP a method body today. v2.8.1 will. For v2.8.0, decompile the assembly with re-dotnet.decompile_type, edit the C# source by hand to stub the target method, then recompile.

  • It does NOT touch native / non-.NET binaries. Use re-patch for byte-splice; use re-vm-reverse for VM-protected native code.

  • It does NOT restore originals — call re-patch.restore_original directly. The rollback_patch tool delegates by-documentation.

Closing CD-3

The r03-stress run identified MonoLauncher::PASystemInfoScanner.MainWindow as the Mono Steam-gate target (see See the RE-AI output directory. for the full decompile). Once v2.8.1 lands the dnlib backend, nop_method("PASystemInfoScanner.MainWindow::GetSteamRegistryKey") will close CD-3 as a HIGH-confidence patch (currently DOC-ONLY).

License

MIT.

Available Tools

6 tools
check_dnlibA

Probe for the dnlib / Mono.Cecil backend.

v2.8.0: always returns status: WARN (stub backend). v2.8.1 replaces this with a real backend probe.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A3.9/5.0
Behavior3/5

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

With no annotations, the description must disclose behavior. It reveals version-dependent behavior (stub vs. real probe) but does not describe the return format or side effects (likely none). More detail on what the 'real backend probe' returns would improve transparency.

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 extremely concise: two sentences that front-load the purpose. Every sentence is informative, and there is no redundant information.

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?

The description is adequate for a simple, parameterless tool, but it lacks specification of the output format for the v2.8.1 real probe. An agent parsing the response would need that information. With no output schema, the description should be more complete.

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?

The tool has zero parameters, and the description does not need to add parameter meaning. According to the guidelines, 0 parameters yields a baseline of 4.

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

Purpose5/5

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

The description clearly states the tool's purpose: to probe the dnlib/Mono.Cecil backend. It includes version-specific behavior, which adds precision. This tool is distinct from its siblings (patch, replace, rollback) as it is diagnostic.

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 implies usage for checking backend availability, but it does not explicitly state when to use this tool versus alternatives. No 'when to use' or 'when not to use' guidance is provided.

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

nop_methodA

Replace a method body with a NOP-sled (return default).

The patched copy is written to dst (must differ from path); the original is never modified. The round-trip preserves the type graph outside the NOPed method (counts of types / methods / fields / properties / events all unchanged).

Args: path: source .NET assembly method_fqn: e.g. "Namespace.Type::Method" dst: destination path for the patched copy confirm_legal: free-text audit-trail justification

Use case: stub a store-gate / license-gate / telemetry-gate method in a Mono / .NET launcher. Closes the CD-3 patch path (see See the RE-AI output directory. MainWindow.cs for the canonical example).

v2.8.0: returns status: not_implemented with a schema_for_replay descriptor; v2.8.1 lands the round-trip backend.

ParametersJSON Schema
NameRequiredDescriptionDefault
pathYes
method_fqnYes
dstNo
confirm_legalNo

TDQS

A4.6/5.0
Behavior5/5

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

No annotations provided, but description details that original is never modified, patched copy written to dst, type graph preserved, and version behavior (v2.8.0 returns status, v2.8.1 lands round-trip). Full disclosure of effects.

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?

Description is mostly concise with a clear structure, but includes some tangential references (RE-AI output directory, MainWindow.cs) that add minor clutter.

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?

Given no output schema, the description mentions return status and schema_for_replay, and covers type graph invariants. For a 4-param tool with clear use case, it is sufficiently complete.

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

Parameters5/5

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

Schema coverage is 0%, but the description's Args section adds key details: method_fqn format, dst must differ from path, confirm_legal as audit trail. Fully compensates for missing schema descriptions.

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

Purpose5/5

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

Description clearly states 'Replace a method body with a NOP-sled (return default)', which is a specific verb and resource. It distinguishes from sibling tools like replace_method_body by specifying the NOP replacement.

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

Usage Guidelines4/5

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

Provides a concrete use case (stubbing store/license/telemetry gates) and notes that dst must differ from path. However, it does not explicitly compare with sibling tools or state when not to use.

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

patch_assemblyD

Apply a list of operations atomically.

v2.8.0: returns status: not_implemented.

ParametersJSON Schema
NameRequiredDescriptionDefault
pathYes
operationsYes
dstNo
confirm_legalNo

TDQS

D1.9/5.0
Behavior1/5

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

With no annotations, the description carries full burden but only mentions atomicity and a version note about returning 'status: not_implemented'. It fails to disclose side effects, permission needs, or what happens to the assembly. Critical behavioral details are missing.

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

Conciseness3/5

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

The description is short, but the version note is misplaced and not helpful. While it is concise, it sacrifices clarity and completeness. The structure could be improved by separating behavior and version info.

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

Completeness1/5

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

Given the complexity of patching an assembly with multiple parameters including a legal confirmation field, the description is severely incomplete. It lacks essential context about what constitutes an operation, the effect of confirm_legal, and return value expectations.

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

Parameters1/5

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

Schema description coverage is 0% and the tool description adds no explanation for any of the 4 parameters (path, operations, dst, confirm_legal). The 'operations' array of objects is left completely undefined, leaving the agent with no semantic understanding.

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

Purpose3/5

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

Description states 'Apply a list of operations atomically', which identifies the action and atomicity, but it is vague about what types of operations or what resource is patched. The version note about 'not_implemented' adds confusion. It distinguishes from siblings by naming 'patch_assembly' but does not differentiate behavior.

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 is provided on when to use this tool versus alternatives like nop_method or replace_method_body. There is no mention of prerequisites, limitations, or typical use cases.

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

replace_method_bodyC

Replace a method body with caller-supplied IL bytes.

v2.8.0: returns status: not_implemented.

ParametersJSON Schema
NameRequiredDescriptionDefault
pathYes
method_fqnYes
new_il_b64Yes
dstNo
confirm_legalNo

TDQS

C2.9/5.0
Behavior3/5

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

Discloses a key behavioral fact: the tool returns 'not_implemented' as of v2.8.0. However, with no annotations, it fails to describe other important behaviors (e.g., whether it modifies files, need for permissions, error handling).

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 sentences with no fluff. First sentence is the core purpose. The second sentence is a version note. Could be more efficient by integrating parameter details instead.

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 5 parameters, no output schema, and no annotations, the description is too sparse. It does not explain what IL bytes should look like, the role of 'confirm_legal', error conditions, or side effects. The agent lacks context to use it correctly.

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% and the description adds no information about parameters (path, method_fqn, new_il_b64, dst, confirm_legal). The agent must rely solely on parameter names, which may be insufficient for correct usage.

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?

Description clearly states the action ('Replace a method body') and resource ('with caller-supplied IL bytes'). It distinguishes from sibling tools like nop_method and patch_assembly. However, the note about returning 'not_implemented' introduces ambiguity about whether the tool currently functions.

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 tool versus alternatives, no prerequisites, no when-not-to-use advice. The note about v2.8.0 hints at a limitation but does not provide clear usage direction.

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

replace_string_ldstrB

Replace a specific ldstr operand within a method body.

v2.8.0: returns status: not_implemented.

ParametersJSON Schema
NameRequiredDescriptionDefault
pathYes
method_fqnYes
oldYes
newYes
dstNo
confirm_legalNo

TDQS

B3.2/5.0
Behavior4/5

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

With no annotations, the description carries full behavioral transparency burden. It explicitly states that in v2.8.0 it returns 'status: not_implemented', which is a critical behavioral trait. However, it does not disclose other traits like side effects, permissions, or success/failure conditions, which would be needed for a fully transparent description.

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 very concise at two sentences. The first sentence states the core function, and the second provides an important version note. However, the note about 'not_implemented' could be more prominent, and there is no structural separation like bullet points. Still, it is not verbose.

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?

Given the tool has 6 parameters (4 required) and no output schema, the description is incomplete. It does not explain what 'ldstr' is, how to use the parameters together, or what the return value means beyond 'not_implemented'. The version note is useful but insufficient for effective use.

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

Parameters1/5

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

The input schema has 6 parameters with 0% description coverage. The description adds no information about the parameters, their formats, or relationships. For example, 'path', 'method_fqn', 'old', 'new', 'dst', 'confirm_legal' are all unexplained. The description fails to compensate for the schema's lack of parameter documentation.

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

Purpose5/5

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

The description clearly states the tool's purpose: 'Replace a specific ldstr operand within a method body'. The verb 'replace' and the specific resource 'ldstr operand' make the function unambiguous. It also distinguishes from sibling tools like 'replace_method_body', which targets the entire method.

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 description provides no guidance on when to use this tool versus alternatives. It does not mention prerequisites, when-not to use, or how it differs from sibling tools like 'patch_assembly' or 'replace_method_body'. The only usage hint is that it returns 'not_implemented' in v2.8.0, which is more of a limitation than guidance.

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

rollback_patchC

Delegate to re-patch.restore_original for the byte-restore step.

re-dotnet-patch does not duplicate the byte-level restore primitive; this stub returns status: delegate with a remediation hint pointing at re-patch.restore_original.

ParametersJSON Schema
NameRequiredDescriptionDefault
originalYes
restore_targetYes
expected_sha256No
confirm_legalNo

TDQS

C2.9/5.0
Behavior3/5

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

With no annotations, the description carries full burden. It discloses that the tool returns status 'delegate' with a remediation hint and does not perform the restore itself. However, it does not mention side effects, authentication needs, or whether the operation is destructive or read-only.

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 very short (3 sentences) and gets the main point across immediately. It is efficiently structured, though slightly more detail could be added without harming conciseness.

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?

The tool is a simple stub with no output schema. The description explains the delegation but lacks parameter explanations and concrete usage context, making it insufficient for the agent to use the tool correctly without additional guesswork.

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

Parameters1/5

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

Schema description coverage is 0%, and the description does not explain any of the four parameters (original, restore_target, expected_sha256, confirm_legal). The agent receives no guidance on parameter meaning beyond the schema, which has only titles.

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 that the tool delegates to re-patch.restore_original for byte-restore, distinguishing it from sibling patching tools. However, it could be more explicit about the overall goal of rolling back a patch.

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 implies that when a byte-restore is needed, this stub should be called and then re-patch.restore_original should be used. However, it does not explicitly state when to use this tool versus alternatives or provide when-not conditions.

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. Dates show when Glama detected each change.

  1. 6 tool updatesv0.1.0
    • First observedcheck_dnlib
    • First observednop_method
    • First observedpatch_assembly
    • First observedreplace_method_body
    • First observedreplace_string_ldstr
    • First observedrollback_patch

TDQS

B3.1/5.0
Disambiguation4/5

Tools have distinct purposes (probing, NOP, atomic patch, IL replacement, string replacement, rollback), but nop_method and replace_method_body both modify method bodies, causing slight overlap.

Naming Consistency4/5

Naming pattern is mostly consistent with verb_noun (e.g., patch_assembly, replace_method_body), but check_dnlib and nop_method deviate slightly from the pattern.

Tool Count5/5

6 tools is well-scoped for a .NET assembly patching server, covering essential operations without being overwhelming.

Completeness3/5

Core patching operations are covered, but missing tools for reading assembly metadata or scanning methods, and several tools are stubs (not_implemented) in v2.8.0, limiting practical completeness.

Maintenance

ActivitySlowing
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Heretek-RE/re-dotnet-patch'

If you have feedback or need assistance with the MCP directory API, please join our Discord server