feat(filesystem): add append_file and write_or_update_file tools #2816
+253
−4
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Fixes #2807
Added two new tools to the filesystem MCP server for enhanced file modification capabilities:
append_file
: Appends content to existing files without overwritingwrite_or_update_file
: Creates new files or appends to existing ones (smart create-or-append)These tools complement the existing
write_file
tool by providing non-destructive file operations, addressing the common use case where users want to add content to files while preserving existing data.Server Details
Motivation and Context
The existing
write_file
tool always overwrites file content, which is problematic when users want to:These new tools solve this by providing:
How Has This Been Tested?
Breaking Changes
No breaking changes. These are new tools that don't affect existing functionality.
Types of changes
Checklist
Additional context
Implementation details: