Repository navigation
MCP Server Guide
robocopy2rust embeds a pure-Rust JSON-RPC 2.0 over stdio Model Context Protocol server implementing protocol version 2024-11-05, exposed both via robocopy2rust mcp and as a dedicated standalone binary robocopy2rust-mcp (crates/robocopy2rust-mcp/src/).
{
"mcpServers": {
"robocopy2rust": {
"command": "robocopy2rust",
"args": [
"mcp"
],
"env": {
"RUST_LOG": "warn"
}
}
}
}Using robocopy2rust-mcp directly avoids even the subcommand argument ("command": "robocopy2rust-mcp"). Notice that robocopy2rust-mcp starts reading JSON-RPC requests immediately from stdin (it does not accept --help), while all diagnostic tracing logs go strictly to stderr so JSON-RPC stdout framing stays pristine.
Supported JSON-RPC methods: initialize, ping, tools/list, tools/call, plus notifications notifications/initialized and notifications/cancelled. Invalid JSON returns -32700; unknown methods return -32601.
Probes the host OS, robocopy.exe availability (C:\Windows\System32\robocopy.exe first, then PATH), resolved executable path, and ProfileStore config directory.
-
Arguments:
{}
Returns all 8 built-in JobPreset definitions with categories, destructive flags, summaries, and complete RobocopyJob configurations.
-
Arguments:
{}
Constructs and validates a Robocopy command plus optional .rcj, .bat, .ps1, and Windows Task Scheduler schtasks outputs.
-
Arguments:
-
job(object, optional) — FullRobocopyJobJSON -
preset(string, optional) — Preset ID or name -
source/destination(string, optional) -
file_specs(string[], optional) -
dry_run(bool, optional) -
include_scripts(bool, optional) — Includesrcj,batch_script, andpowershell_script -
task_name(string, optional) — Triggersschtasksgeneration -
cadence(string, optional) —daily,weekly,hourly,onstart,onlogon(defaultdaily) -
start_time(string, optional) —HH:MM(default"02:00")
-
Parses a raw command-line string or on-disk .rcj file (UTF-8 or UTF-16LE/BE) into normalized command_line, parser warnings, validation findings, and structured job JSON.
-
Arguments: Either
command(string) orrcj_path(string).
Decodes a Robocopy exit code (0..=16, or < 0 cancelled) into severity, short_label, is_success (0..=7 = true), summary, and bit_descriptions.
-
Arguments:
code(integer, required).
Full persistent profile CRUD against profiles.json (or an isolated store_dir for testing/workspaces).
-
Arguments:
-
action(enum, required):"list"|"get"|"save"|"delete" -
name(string) — Required forget,save,delete -
description(string, optional) — Used onsave -
job(object, optional) — Used onsave -
store_dir(string, optional) — Custom directory override
-
Executes a non-destructive /L simulation (with_list_only()), enforcing all Error-level validation rules first. Returns full RunResult JSON (summary, file_actions, errors, exit_code, log_sha256). Verified in unit tests against real Windows robocopy.exe.
-
Arguments: Any combination of
job,command,preset,source,destination.
Executes a live Robocopy transfer after running validate_job.
-
Arguments:
job,command,preset,source,destination,confirm_destructive(bool, optional). -
Safety Gate: If
job.has_destructive_flags()istrue(/MIR,/PURGE,/MOVE, or/MOVwithout/L) andconfirm_destructiveis nottrue,robocopy2rust_runrefuses immediately withisError: true:SAFETY REFUSAL: Job includes destructive flag(s) (/MIR, /PURGE). Re-run with robocopy2rust_dry_run first or set confirm_destructive=true.
Generates offline HTML, JSON, Markdown, or all three (all) from either an existing log_path or a live /L dry-run job.
-
Arguments:
output(string, required),format(html|json|markdown|all, defaulthtml), plus eitherlog_pathor job parameters (job/source/destination). -
Returns:
{ "status": "success", "files_written": [...], "exit_code": ..., "log_sha256": "..." }.
- Call
robocopy2rust_environmentto verifyrobocopy_available: trueon the host. - Call
robocopy2rust_presetsorrobocopy2rust_build_commandto assemble and validate flags (checkfindingsforErrororWarningdiagnostics). - Call
robocopy2rust_dry_runto inspect exactsummarycounts and plannedfile_actionswithout touching destination files. - Present any destructive deletions (
*EXTRA File//MIR//PURGE//MOVE) to the human user for explicit approval. - Only after approval, call
robocopy2rust_run(settingconfirm_destructive: trueif destructive) and verify exit code viarobocopy2rust_decode_exit_code. - Persist an audit trail via
robocopy2rust_report(format: "all").
robocopy2rust (v0.1.0) • GUAP Ecosystem (guap.ca) • Rust 2024 Edition • Apache-2.0 License • Repository • Security Policy