multiedit
Apply multiple text replacements to a single file atomically, with dry-run preview. Preserves file encoding and line endings across sequential edits.
Instructions
Applies multiple old_string -> new_string replacements to a single file in one call. Edits are applied sequentially in order; each edit sees the result of the previous one. Atomic: if any edit fails, the file is not modified at all. Encoding-aware: preserves original file encoding (UTF-8, EUC-KR, Shift-JIS, etc.). Line-ending aware: old_string matches whether the file uses CRLF or LF, and inserted newlines follow the region being edited (mixed-newline files stay intact). Accepts "path" as alias for "file_path". Use dry_run=true to preview all changes without modifying the file.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | No | Alias for file_path | |
| edits | Yes | Ordered list of replacements to apply sequentially | |
| dry_run | No | Preview changes without modifying the file: true or false. Default: false | |
| file_path | No | File to edit. Relative paths use the configured workspace or MCP client root |