feat(filesystem): add append_file and write_or_update_file tools#2816
Open
agn-7 wants to merge 7 commits intomodelcontextprotocol:mainfrom
Open
feat(filesystem): add append_file and write_or_update_file tools#2816agn-7 wants to merge 7 commits intomodelcontextprotocol:mainfrom
agn-7 wants to merge 7 commits intomodelcontextprotocol:mainfrom
Conversation
Author
|
Hi I really need this feature. could you please take a look? |
This commit adds two new tools to the filesystem server: 1. **append_file**: Appends content to the end of an existing file. - File must already exist - Preserves existing content, adds new content at the end 2. **write_or_update_file**: Creates a new file or appends to an existing file. - If file doesn't exist: creates it with the provided content - If file exists: appends new content to the end - Useful when you want to add content while preserving existing data Changes include: - Added `appendFileContent` and `writeOrUpdateFileContent` functions to lib.ts - Added tool registrations and schemas to index.ts - Updated README.md with new tool documentation - Added comprehensive tests for the new functions 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
d4d0d52 to
d15eb75
Compare
Author
|
I just resolved the merge conflicts in my previously submitted PR. Could you please review it to help prevent future conflicts? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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_filetool 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_filetool 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: