Skip to content

Core Tools

MCP Filesystem Ultra v4.5.29 provides 20 tools (17 core + git + minify_js + help). Each tool is intelligent — it auto-selects the optimal strategy based on file size, context, and parameters provided.


Read file contents. Supports full reads, line ranges, head/tail mode, and base64 encoding for binary files. Auto-converts WSL/Windows paths.

Replaces: mcp_read, read_file, read_file_range, read_base64, chunked_read_file, intelligent_read

Annotations:

AnnotationValue
readOnlytrue
destructivefalse
idempotenttrue

Parameters:

ParameterRequiredTypeDescription
pathYesstringPath to file (WSL or Windows format)
max_linesNonumberMax lines to return (0 = all)
modeNostringRead mode: all, head, tail
start_lineNonumberStarting line number (1-indexed) for range read
end_lineNonumberEnding line number (inclusive) for range read
encodingNostringSet to "base64" to read file as base64-encoded binary

Examples:

// Read entire file
read_file({ path: "C:\\project\\main.go" })
// Read first 50 lines
read_file({ path: "/mnt/c/project/main.go", max_lines: 50, mode: "head" })
// Read last 20 lines (log tailing)
read_file({ path: "server.log", max_lines: 20, mode: "tail" })
// Read specific line range (most token-efficient)
read_file({ path: "main.go", start_line: 100, end_line: 150 })
// Read binary file as base64
read_file({ path: "image.png", encoding: "base64" })

Write file atomically. Supports text content or base64-encoded binary. Auto-creates parent directories. Auto-converts WSL/Windows paths.

Replaces: mcp_write, write_file, create_file, write_base64, streaming_write_file, intelligent_write

Annotations:

AnnotationValue
readOnlyfalse
destructivetrue
idempotenttrue

Parameters:

ParameterRequiredTypeDescription
pathYesstringPath where to write (WSL or Windows format)
contentNostringText content to write to the file
content_base64NostringBase64-encoded binary content to write
encodingNostringSet to "base64" when content is base64-encoded

Examples:

// Write text file
write_file({ path: "config.json", content: "{}" })
// Write binary file from base64
write_file({ path: "image.png", content_base64: "iVBORw0KGgo..." })
// Alternative base64 via encoding flag
write_file({ path: "data.bin", content: "SGVsbG8=", encoding: "base64" })

Edit file with multiple modes. Default mode: smart text replacement with auto-backup and risk validation. Risk level never blocks — CRITICAL edits include a VERIFY instruction. The accidental-rewrite guard and --auto-occ=block can block independently. Auto-converts WSL/Windows paths.

Since v4.5.10, an accidental-rewrite guard is active: when new_text is more than 2× the size of old_text, the file has substantial content outside the match (>50%), AND new_text is large (>500 B and >50% of file), the call is BLOCKED with a clear error suggesting write_file. Pass allow_rewrite: true to override (creates a safety backup). The force flag does not bypass the rewrite guard as of v4.5.14 — allow_rewrite is the only override.

Replaces: mcp_edit, edit_file, smart_edit_file, intelligent_edit, recovery_edit, search_and_replace, replace_nth_occurrence, regex_transform_file

Annotations:

AnnotationValue
readOnlyfalse
destructivetrue
idempotentfalse

Parameters:

ParameterRequiredTypeDescription
pathYesstringPath to file (WSL or Windows format)
old_textNostringText to be replaced (default mode)
new_textNostringNew text to replace with (default mode)
old_strNostringAlias for old_text
new_strNostringAlias for new_text
forceNobooleanForce operation even if CRITICAL risk (default: false)
modeNostringEdit mode: "replace" (default), "search_replace", "regex"
occurrenceNonumberWhich occurrence to replace: 1=first, 2=second, -1=last, -2=second-to-last (default: all)
patternNostringRegex or literal pattern (for search_replace and regex modes)
replacementNostringReplacement text (for search_replace mode)
patterns_jsonNostringJSON array of patterns for regex mode: [{"pattern": "regex", "replacement": "$1...", "limit": -1}]
case_sensitiveNobooleanCase sensitive matching (default: true, for regex mode)
create_backupNobooleanCreate backup before transformation (default: true, for regex mode)
dry_runNobooleanValidate without applying changes (default: false, for regex mode)
whole_wordNobooleanMatch whole words only (default: false, for occurrence mode)
expected_hashNostringOCC token (FNV-1a from a prior read_file StructuredContent). If the file content hash on disk differs, the edit is rejected with a stale edit: error (v4.5.6+; structured since v4.5.13).
start_lineNonumberFor delete_range / replace_range: 1-indexed first line (v4.5.14 / v4.5.16).
end_lineNonumberFor delete_range / replace_range: inclusive 1-indexed last line (v4.5.14 / v4.5.16).
tolerant_whitespaceNobooleanTreat one tab as 4 spaces and CRLF/CR as LF in the matcher (v4.5.7).
diff_formatNostring"auto", "full", "summary", "stat", "none" (v4.5.14).
allow_rewriteNobooleanBypass the accidental-rewrite guard (v4.5.10, decoupled from force in v4.5.14).

Modes:

ModeWhen to Use
replace (default)Simple find-and-replace in a single file. Use old_text/new_text.
search_replaceRecursive search-and-replace across a directory. Use pattern/replacement.
regexAdvanced regex transformations with capture groups. Use patterns_json.
delete_range (v4.5.14)Removes lines [start_line, end_line] (1-indexed, inclusive). Atomic with backup. No text match needed.
replace_range (v4.5.16)Line-numbered partner of delete_range: replaces lines [start_line, end_line] with new_text. Reuses the byte-exact splice from delete_range.

Examples:

// Simple replacement (default mode)
edit_file({ path: "main.go", old_text: "v3.0.0", new_text: "v4.0.0" })
// Replace only the first occurrence
edit_file({ path: "config.ts", old_text: "TODO", new_text: "DONE", occurrence: 1 })
// Replace last occurrence with whole-word matching
edit_file({ path: "app.js", old_text: "count", new_text: "total", occurrence: -1, whole_word: true })
// Recursive search and replace across directory
edit_file({ path: "src/", mode: "search_replace", pattern: "oldFunc", replacement: "newFunc" })
// Regex transformation with capture groups
edit_file({
path: "types.go",
mode: "regex",
patterns_json: JSON.stringify([
{ pattern: "func (\\w+)\\(\\)", replacement: "func $1(ctx context.Context)", limit: -1 }
]),
dry_run: true
})

List directory contents with caching. Auto-converts WSL/Windows paths.

Replaces: mcp_list, list_directory

Annotations:

AnnotationValue
readOnlytrue
destructivefalse
idempotenttrue

Parameters:

ParameterRequiredTypeDescription
pathYesstringPath to directory (WSL or Windows format)
output_formatNostringResponse format: "compact" (default, one-liner), "json" (structured {path, total, truncated, entries:[{name,type,size,modified}]}), "tree" (recursive JSON tree, pairs with max_depth). Added in v4.5.25.
max_depthNonumberRecursion depth for output_format:"tree" (default 2). Added in v4.5.25.

Examples:

list_directory({ path: "C:\\project\\src" })
list_directory({ path: "/mnt/c/project" })

Search files by name or content. Supports regex and literal patterns. Auto-routes between fast search and advanced text search based on parameters. Auto-converts WSL/Windows paths.

Replaces: mcp_search, smart_search, advanced_text_search, count_occurrences

Annotations:

AnnotationValue
readOnlytrue
destructivefalse
idempotenttrue

Parameters:

ParameterRequiredTypeDescription
pathYesstringBase directory or file (WSL or Windows format)
patternYesstringRegex or literal pattern
include_contentNobooleanInclude file content search (default: false). Since v4.5.24 it is auto-enabled when path is a regular file or when content-only params are passed.
includeNostringAlias for file_types (added v4.5.x).
file_typesNostringComma-separated file extensions (e.g., .go,.txt)
case_sensitiveNobooleanCase sensitive search (default: false)
whole_wordNobooleanMatch whole words only (default: false)
include_contextNobooleanInclude surrounding context lines (default: false)
context_linesNonumberNumber of context lines (default: 3)
count_onlyNobooleanCount pattern occurrences without full search (default: false)
return_linesNostringReturn line numbers of count matches ("true"/"false", for count_only mode). Accepts bool too (v4.5.3).
output_formatNostring"text" (default) or "json" — structured matches with {pattern, path, total_matches, matches:[...]}.
outputNostringAlias for output_format.

Auto-routing (v4.5.24 false-negative fix): By default search_files is filename-only (SmartSearch). Content search (include_content: trueAdvancedTextSearch) is forced in two cases:

  1. path resolves to a regular file (not a directory) — a filename match on a single explicit file is meaningless.
  2. Any of these params is passed: output_format, output, context_lines.

When the search returns zero hits and content was not searched, the response says: No filename matches for pattern 'X' in <path> (filename-only search — file contents were NOT searched; pass include_content:true to search inside files).

Examples:

// Fast file name search
search_files({ path: "C:\\project", pattern: "main.go" })
// Content search with file type filter
search_files({ path: ".", pattern: "TODO", include_content: true, file_types: ".go,.ts" })
// Advanced search with context
search_files({ path: ".", pattern: "func.*Error", case_sensitive: true, include_context: true })
// Count occurrences in a file
search_files({ path: "main.go", pattern: "fmt\\.Sprintf", count_only: true })
// Count with line numbers
search_files({ path: "main.go", pattern: "TODO", count_only: true, return_lines: "true" })

Analyze a file operation without executing (Plan Mode / dry-run). Useful for previewing the impact of writes, edits, and deletes before committing.

Annotations:

AnnotationValue
readOnlytrue
destructivefalse
idempotenttrue

Parameters:

ParameterRequiredTypeDescription
operationYesstringOperation to analyze: file, optimize, write, edit, delete
pathYesstringPath to the file
contentNostringContent for write analysis
old_textNostringText to be replaced (for edit analysis)
new_textNostringReplacement text (for edit analysis)

Operations:

OperationPurpose
fileAnalyze file size, type, recommendations
optimizeGet optimization strategy suggestion
writeDry-run write analysis
editDry-run edit with risk assessment
deleteDry-run delete impact analysis

Examples:

// Analyze a file
analyze_operation({ operation: "file", path: "large-data.json" })
// Preview edit risk
analyze_operation({ operation: "edit", path: "config.go", old_text: "v3", new_text: "v4" })
// Preview delete impact
analyze_operation({ operation: "delete", path: "old-module/" })

Create a new directory (and parent directories if needed).

Annotations:

AnnotationValue
readOnlyfalse
destructivefalse
idempotenttrue

Parameters:

ParameterRequiredTypeDescription
pathYesstringPath to the directory to create

Examples:

create_directory({ path: "src/components/ui" })

Delete a file or directory. Default: soft-delete (moves to trash). Use permanent: true for hard delete.

Annotations:

AnnotationValue
readOnlyfalse
destructivetrue
idempotentfalse

Parameters:

ParameterRequiredTypeDescription
pathYesstringPath to the file or directory to delete
permanentNobooleanPermanently delete instead of soft-delete (default: false)

Examples:

// Soft-delete (recoverable)
delete_file({ path: "old-config.json" })
// Permanent delete
delete_file({ path: "temp/cache", permanent: true })

Move or rename a file or directory to a new location.

Replaces: move_file, rename_file

Annotations:

AnnotationValue
readOnlyfalse
destructivetrue
idempotentfalse

Parameters:

ParameterRequiredTypeDescription
source_pathYesstringCurrent path of the file/directory
dest_pathYesstringNew path for the file/directory

Examples:

// Move file
move_file({ source_path: "src/old.go", dest_path: "src/new.go" })
// Rename directory
move_file({ source_path: "components", dest_path: "ui-components" })

Copy a file or directory to a new location. Preserves permissions.

Annotations:

AnnotationValue
readOnlyfalse
destructivefalse
idempotenttrue

Parameters:

ParameterRequiredTypeDescription
source_pathYesstringPath of the file/directory to copy
dest_pathYesstringDestination path for the copy

Examples:

copy_file({ source_path: "config.json", dest_path: "config.backup.json" })
copy_file({ source_path: "templates/", dest_path: "templates-backup/" })

Get detailed information about a file or directory (size, modification time, permissions, type).

Annotations:

AnnotationValue
readOnlytrue
destructivefalse
idempotenttrue

Parameters:

ParameterRequiredTypeDescription
pathYesstringPath to the file or directory

Examples:

get_file_info({ path: "main.go" })

Apply multiple edits to a single file atomically. Much faster than calling edit_file multiple times. Risk level never blocks — CRITICAL edits include a VERIFY instruction. The accidental-rewrite guard and --auto-occ=block can block independently.

Annotations:

AnnotationValue
readOnlyfalse
destructivetrue
idempotentfalse

Parameters:

ParameterRequiredTypeDescription
pathYesstringPath to the file to edit
edits_jsonYesstringJSON array of edits: [{"old_text": "...", "new_text": "..."}, ...]
forceNobooleanForce operation even if CRITICAL risk (default: false)
expected_hashNostringOCC token (FNV-1a from a prior read_file). Same semantics as edit_file’s expected_hash (v4.5.13).
diff_formatNostringDiff rendering: "auto" (default — full for small batches, summary for large), "full", "summary", "stat", "none". Aggregate one diff across the batch (v4.5.25).
dry_runNobooleanPreview without applying (v4.5.25).
tolerant_whitespaceNobooleanTreat one tab as 4 spaces and CRLF/CR as LF in the matcher (v4.5.7).

Examples:

// Rename a variable across a file
multi_edit({
path: "main.go",
edits_json: JSON.stringify([
{ old_text: "oldVarName", new_text: "newVarName" },
{ old_text: "OldFuncName", new_text: "NewFuncName" }
])
})
// Apply multiple fixes atomically
multi_edit({
path: "config.ts",
edits_json: JSON.stringify([
{ old_text: "port: 3000", new_text: "port: 8080" },
{ old_text: "debug: true", new_text: "debug: false" },
{ old_text: "v1.0.0", new_text: "v2.0.0" }
])
})

Project-wide find/replace in a single call. Replaces N calls to multi_edit with 1. Scans directory tree, matches pattern, replaces all occurrences. Creates single consolidated backup.

Annotations:

AnnotationValue
readOnlyfalse
destructivetrue
idempotentfalse

Parameters:

ParameterRequiredTypeDescription
pathYesstringRoot directory to scan (WSL or Windows format)
findYesstringText or regex pattern to find
replaceYesstringReplacement text
literalNoboolIf false, find is regex (default: true)
case_sensitiveNoboolCase sensitive matching (default: true)
file_typesNostringComma-separated extensions (“.php,.html”)
include_pathsNostringJSON array of glob patterns to include
exclude_pathsNostringJSON array of glob patterns to exclude
previewNoboolDiff without writing (default: false)
create_backupNoboolSingle consolidated backup (default: true)
parallelNoboolProcess files concurrently (default: true)
max_filesNonumberSafety cap (default: 1000)

Response:

{
"files_changed": 45,
"total_replacements": 230,
"backup_id": "20260520-...",
"risk_level": "MEDIUM",
"per_file": [
{"path": "src/main.php", "replacements": 12},
{"path": "src/utils.php", "replacements": 5}
]
}

Example — Replace across PHP files, excluding vendor:

project_replace({
path: "C:\\project\\public_html",
find: "utf8_encode(",
replace: "utf8e(",
file_types: ".php",
exclude_paths: JSON.stringify(["jotajotape/**", "vendor/**"]),
preview: false
})

Example — Regex find/replace:

project_replace({
path: "src/",
find: "item_(\\d+)",
replace: "obj_$1",
literal: false,
file_types: ".go,.ts"
})

Example — Preview only (dry-run):

project_replace({
path: "src/",
find: "TODO",
replace: "DONE",
preview: true
})

Execute multiple file operations atomically, run multi-step pipelines, or batch rename files. Provide exactly one of: request_json, pipeline_json, or rename_json.

Replaces: batch_operations, execute_pipeline, batch_rename_files

Annotations:

AnnotationValue
readOnlyfalse
destructivetrue
idempotentfalse

Parameters:

ParameterRequiredTypeDescription
request_jsonNostringJSON with operations array and options. Fields: operations (array), atomic (bool), create_backup (bool), validate_only (bool)
pipeline_jsonNostringJSON pipeline definition with name, steps, and optional flags (dry_run, force, stop_on_error, create_backup, verbose, parallel)
rename_jsonNostringJSON with batch rename parameters. Fields: path, mode, find, replace, prefix, suffix, pattern, extension, start_number, padding, recursive, file_pattern, preview, case_sensitive

Supported operations: write, edit, search_and_replace, copy, move, delete, create_dir, extract

batch_operations({
request_json: JSON.stringify({
operations: [
{ type: "write", path: "file1.go", content: "package main" },
{ type: "copy", source: "a.txt", destination: "b.txt" },
{ type: "create_dir", path: "new_folder" }
],
atomic: true,
create_backup: true
})
})

Multi-step file transformation pipeline with 12 actions, conditional logic, template variables, and parallel execution. See Pipeline Tools for full reference.

Supported steps: search, read_ranges, edit, multi_edit, count_occurrences, regex_transform, copy, rename, delete, aggregate, diff, merge

batch_operations({
pipeline_json: JSON.stringify({
name: "refactor-todos",
parallel: true,
stop_on_error: true,
create_backup: true,
steps: [
{ id: "find", action: "search", params: { path: ".", pattern: "TODO", file_types: [".go"] } },
{ id: "count", action: "count_occurrences", input_from: "find", params: { pattern: "TODO" } },
{ id: "fix", action: "edit", input_from: "find",
condition: { type: "count_gt", step_ref: "count", value: "0" },
params: { old_text: "TODO", new_text: "DONE" } }
]
})
})

Modes: find_replace, add_prefix, add_suffix, number_files, regex_rename, change_extension, to_lowercase, to_uppercase

batch_operations({
rename_json: JSON.stringify({
path: "src/",
mode: "find_replace",
find: "old_",
replace: "new_",
recursive: true,
preview: true
})
})

Manage file backups. Backups are created automatically before destructive operations. Use this tool to list, inspect, compare, clean up, or restore backups.

Replaces: backup, restore_backup, list_backups, get_backup_info, compare_with_backup, cleanup_backups

Annotations:

AnnotationValue
readOnlyfalse
destructivefalse
idempotentfalse

Parameters:

ParameterRequiredTypeDescription
actionNostringAction: see Action routing below (10 values).
backup_idNostringBackup ID (required for info, compare, restore)
sd_idNostringSD-ID for trash actions (restore_trash, purge_trash) (v4.5.11).
file_pathNostringFile path for compare, selective restore, or undo_last step-through (v4.3.8).
limitNonumberMax backups to return for list (default: 20)
filter_operationNostringFilter by operation: edit, delete, batch, all
filter_pathNostringFilter by file path (substring match)
newer_than_hoursNonumberOnly backups newer than N hours
older_than_daysNonumberFor cleanup / purge_trash: age threshold in days
dry_runNobooleanPreview without executing (cleanup, restore, purge_trash)
previewNobooleanFor undo_last: show what would be undone without applying

Action routing:

ActionRequired ParamsDescription
list(none)List all backups with optional filters
infobackup_idShow detailed backup information
comparebackup_id, file_pathCompare current file with backup version
cleanupolder_than_days?Delete old backups; pass dry_run:true for preview (default dry_run:true)
restorebackup_idRestore file(s) from a backup (atomic). Pass dry_run:true / preview:true.
undo_last(optional file_path)Step-through one backup in the chain. Without file_path, undoes the most recent. With file_path, walks the chain for that file; pass preview:true to peek. (v4.3.8)
undo_chainfile_pathShow the full chain of backups for a file (v4.3.8)
list_trash(none)List soft-deleted files (sd_id, original path). Added v4.5.11.
restore_trashsd_idMove a soft-deleted file back to its original path. Added v4.5.11.
purge_trash(none; optional older_than_days / sd_id)Permanently delete trash entries. Added v4.5.11.

Soft-delete integration (v4.5.11+): delete_file without permanent:true stores files under <backup-dir>/filesdelete/<sd-id>/<basename> with a metadata.json sidecar when --backup-dir is configured. The SD-ID is returned in the delete_file response so the trash actions above can find it. Requires --backup-dir.

Examples:

// List recent backups
backup({})
backup({ action: "list", newer_than_hours: 24 })
// Get backup details
backup({ action: "info", backup_id: "20260313-143022-abc123" })
// Compare file with backup
backup({ action: "compare", backup_id: "20260313-143022-abc123", file_path: "main.go" })
// Preview restore
backup({ action: "restore", backup_id: "20260313-143022-abc123", preview: true, file_path: "main.go" })
// Restore from backup
backup({ action: "restore", backup_id: "20260313-143022-abc123" })
// Step-through undo (file_path is the chain key)
backup({ action: "undo_last", file_path: "main.go", preview: true })
backup({ action: "undo_last", file_path: "main.go" })
// Show the entire undo chain for a file
backup({ action: "undo_chain", file_path: "main.go" })
// Clean up old backups
backup({ action: "cleanup", older_than_days: 30, dry_run: true })
// Trash workflows (v4.5.11)
backup({ action: "list_trash" })
backup({ action: "restore_trash", sd_id: "sd-..." })
backup({ action: "purge_trash", older_than_days: 30, dry_run: true })

WSL/Windows file integration. Sync files between WSL and Windows, or check integration status.

Auto-sync (write/edit-time syncing) is configured via the MCP_WSL_AUTOSYNC environment variable or the deprecated autosync_config/autosync_status params — not as wsl actions. The wsl tool itself only exposes sync and status.

Replaces: wsl_sync, wsl_status (configure_autosync/autosync_status were v3 tools — now env-var driven).

Annotations:

AnnotationValue
readOnlyfalse
destructivefalse
idempotenttrue

Parameters:

ParameterRequiredTypeDescription
actionNostringAction: sync (default) or status. The legacy autosync_config / autosync_status actions are not dispatched.
wsl_pathNostringSource WSL path for sync
windows_pathNostringDestination or source Windows path for sync
directionNostringSync direction: wsl_to_windows, windows_to_wsl, bidirectional
create_dirsNobooleanCreate destination directories (default: true)
filter_patternNostringFile filter pattern for workspace sync
dry_runNobooleanPreview changes without executing (default: false)
enabledNoboolean(Legacy auto-sync param — no longer dispatched. Use the MCP_WSL_AUTOSYNC env var.)
sync_on_writeNoboolean(Legacy auto-sync param)
sync_on_editNoboolean(Legacy auto-sync param)
silentNoboolean(Legacy auto-sync param)

Action routing:

ActionDescription
sync (default)Copy files between WSL and Windows. Auto-detects direction from path format.
statusShow WSL/Windows integration status

Examples:

// Check WSL status
wsl({ action: "status" })
// Copy file from WSL to Windows
wsl({ wsl_path: "/home/user/project/main.go" })
// Copy file from Windows to WSL
wsl({ windows_path: "C:\\project\\config.json" })
// Workspace sync with filter
wsl({ direction: "wsl_to_windows", filter_pattern: "*.go", dry_run: true })

Get server information, help, performance stats, and manage code artifacts.

Replaces: stats, get_help, artifact, performance_stats, get_edit_telemetry, capture_last_artifact, write_last_artifact, artifact_info

Annotations:

AnnotationValue
readOnlytrue
destructivefalse
idempotenttrue

Parameters:

ParameterRequiredTypeDescription
actionNostringAction: help (default), stats, artifact
topicNostringHelp topic: overview, workflow, tools, read, write, edit, search, batch, errors, examples, tips, all
sub_actionNostringFor artifact: capture, write, info
contentNostringArtifact content to capture
pathNostringPath for writing artifact

Action routing:

ActionDescription
help (default)Show usage instructions. Use topic to narrow.
statsShow performance metrics and edit telemetry
artifactManage code artifacts via sub_action

Examples:

// Get help
server_info({})
server_info({ action: "help", topic: "edit" })
// Performance stats
server_info({ action: "stats" })
// Capture artifact in memory
server_info({ action: "artifact", sub_action: "capture", content: "function hello() {}" })
// Write artifact to file
server_info({ action: "artifact", sub_action: "write", path: "output.js" })
// Check artifact info
server_info({ action: "artifact", sub_action: "info" })

Built-in git version control inside repositories. Calls git directly via a hardened command constructor (no shell). 9 actions since v4.5.25: init, status, diff, log, show, add, commit, restore, branch. paths is a native array; rev is the revision/range parameter; output is an action-specific enum. See Git Tools for the full reference.

Annotations:

AnnotationValue
readOnlyfalse
destructivetrue (restore, branch delete)
idempotentfalse

Pure-Go JavaScript minifier — no Node, no external tools, no API calls. Strips // and /* */ comments, collapses whitespace, optionally joins onto a single line, while preserving string / template / regex literals.

Annotations:

AnnotationValue
readOnlyfalse
destructivetrue (overwrites the file; auto-creates a backup before destructive mode by default)
idempotenttrue (idempotent on already-minified content)

Parameters:

ParameterRequiredTypeDescription
pathYesstringPath to the JS file to minify (overwritten in place)
output_pathNostringWrite to a different file instead of overwriting
remove_commentsNobooleanStrip // and /* */ comments (default: true)
collapse_whitespaceNobooleanCollapse runs of whitespace (default: true)
single_lineNobooleanJoin everything onto a single line (default: true)
dry_runNobooleanPreview reductions without writing (default: false)
create_backupNobooleanBackup before overwriting (default: true when not dry_run)

Examples:

// Dry run
minify_js({ path: "app.js", dry_run: true })
// → "MINIFY (dry-run) app.js | 87342→31045B (-56297, 64.4%) | comments:42"
// Live minify
minify_js({ path: "app.js" })
// → file overwritten; UNDO:20260607-xxxxx is the backup ID

See the dedicated page under Minify JS.


Discovery tool — call first to list all 20 tools (17 core + git + minify_js + help) with their parameters and short descriptions. No parameters.

Annotations:

AnnotationValue
readOnlytrue
destructivefalse
idempotenttrue

For topic-specific help (e.g. recovery workflow, hooks example), call server_info({action: "help", topic: "..."}) — see Server Info help topics.


Since v4.5.26, read_file, write_file, edit_file, and multi_edit publish an MCP outputSchema and return a typed structuredContent payload alongside the byte-identical text fallback. The text response is unchanged — Claude and other agents that read Content[0].Text keep working. New clients that read structuredContent get a JSON object instead of having to parse the human-readable text.

Quick reference (full schemas and worked example: Structured Output):

ToolstructuredContent shape
read_file{content, content_hash?} (content_hash absent on multi-file reads)
write_file{path, bytes_written, content_hash, message, [backup_id], [feedback]}
edit_file{path, replacements, lines_added, lines_removed, total_lines, content_hash, message, [backup_id], [parent_backup_id], [risk_warning], [structure_warning], [integrity], [external_change]}
multi_edit{path, successful_edits, total_edits, lines_added, lines_removed, total_lines, content_hash, message, [backup_id], [parent_backup_id], [risk_warning], [structure_warning], [integrity]}

Two practical consequences:

  • content_hash from write_file can now be chained directly into edit_file.expected_hash without re-reading — fixes a long-standing false-positive external_change warning in the write→edit pattern (the session was missing RecordWriteHash until v4.5.26).
  • parent_backup_id on edit_file / multi_edit lets an agent walk the undo chain (backup(action:"undo_last", file_path:...)) without scraping the chain: segment from the text.

CategoryCountTools
Reading1read_file
Writing1write_file
Editing3edit_file, multi_edit, project_replace
Search1search_files
File Management4delete_file, move_file, copy_file, get_file_info
Directory2list_directory, create_directory
Analysis1analyze_operation
Batch / Pipeline1batch_operations
Backup1backup (10 actions: list, info, compare, cleanup, restore, undo_last, undo_chain, list_trash, restore_trash, purge_trash)
WSL1wsl (sync, status, autosync_config, autosync_status)
Server1server_info
Version Control1git (9 actions)
JavaScript1minify_js
Discovery1help

Total: 20 tools (17 core + git + minify_js + help, consolidated from 59 in v3.x)