-
Notifications
You must be signed in to change notification settings - Fork 20
feat: add diff_files tool for file comparison #63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat: add diff_files tool for file comparison #63
Conversation
Implements rust-mcp-stack#60 - Add line numbering flag for read_text_file Changes: - Added `with_line_numbers` optional parameter to ReadTextFile struct - Updated read_text_file service method to format output with line numbers - Line numbers are right-aligned (6 digits) with pipe separator format - Uses 1-based indexing for line numbers - Maintains backward compatibility (defaults to false) - Added comprehensive unit tests for various scenarios - Updated CHANGELOG.md with feature description This feature enables AI agents to obtain file content with line numbers in a single tool invocation, improving efficiency for code modification tasks that require precise line-based targeting. [agent commit]
[agent commit]
[agent commit]
Implements a new diff_files tool that compares two files and returns: - Unified diff format for text files - SHA-256 hash comparison for binary files Features: - Configurable file size limit (default: 10MB) - Automatic binary detection via null bytes check - Read-only operation (no filesystem modification) - Comprehensive test coverage (8 test cases) Closes rust-mcp-stack#62 [agent commit]
|
|
||
| ## [0.3.7](https://github.com/rust-mcp-stack/rust-mcp-filesystem/compare/v0.3.6...v0.3.7) (2025-10-31) | ||
|
|
||
| ## [Unreleased] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any changes made to CHANGELOG.md should be discarded.
|
|
||
| <!-- mcp-discovery-render --> | ||
| ## rust-mcp-filesystem 0.3.8 | ||
| | 🟢 Tools (24) | <span style="opacity:0.6">🔴 Prompts</span> | <span style="opacity:0.6">🔴 Resources</span> | <span style="opacity:0.6">🔴 Logging</span> | <span style="opacity:0.6">🔴 Completions</span> | <span style="opacity:0.6">🔴 Experimental</span> | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any changes made to capabilities.md should be discarded.
| @@ -0,0 +1,10 @@ | |||
| { | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like a leftover artifact from Claude. it should be removed.
Summary
Implements a new
diff_filestool that enables file comparison within the MCP filesystem server.Closes #62
Changes
New Tool:
diff_filesParameters:
path1(string): First file path to comparepath2(string): Second file path to comparemaxFileSizeBytes(optional, default: 10MB): Maximum file size limitBehavior:
Implementation Details
Files Modified/Created:
src/tools/diff_files.rs- Tool definition with schemasrc/fs_service.rs- Service layer implementation with binary detectionsrc/tools.rs- Tool registration in macrossrc/handler.rs- Handler dispatch registrationCargo.toml- Addedhexdependency for hash encodingdocs/capabilities.md- Updated documentation (24→25 tools)tests/test_tools.rs- 8 comprehensive test casesKey Features:
Test Coverage
Added 8 test cases covering:
All 131 tests passing (cargo make check ✓)
Test Plan
Manual testing completed:
[agent pull request]