file_patch
Apply unified diff patches to OpenWrt router files directly via MCP, eliminating the need for the patch command. Supports standard diff -u format and dry-run checks.
Instructions
Apply a unified diff patch to a file on the OpenWrt router. The patch is parsed and applied on the MCP server side — no 'patch' command needed on the router. Supports standard unified diff format (output of 'diff -u').
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Absolute path to the target file on the router | |
| patch | Yes | Unified diff patch content with @@ hunk headers. Context lines must match the file. | |
| dry_run | No | If true, only check if the patch applies cleanly without modifying the file |