Apply patch
apply_patchValidate or apply a unified diff to a project safely: dry-run by default, confines changes to the project root, refuses mass deletions, and backs up files before writing.
Instructions
Apply a unified diff to the project. Defaults to dryRun=true. All target paths are confined to the project root, suspicious mass deletions are refused, and touched files are backed up before writing. Validates that every hunk applies cleanly first.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"projectPath": "<projectPath>",
"patch": "<patch>"
},
"name": "apply_patch"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| patch | Yes | A unified diff to apply. | |
| dryRun | No | Validate without writing (default). Set false to actually apply. | |
| projectPath | Yes | Absolute path to the project root. | |
| createBackup | No | Back up touched files under .mcp-flow-backups/ before writing. |