Skip to content

Commit 4636883

Browse files
mfcasazzaolaservodomdomegg
authored
Windows filesystem MCP enhancements (#543)
* fix: comprehensive Windows path handling improvements - Add path-utils module for consistent path handling - Handle Windows paths with spaces via proper quoting - Support Unix-style Windows paths (/c/path) - Support WSL paths (/mnt/c/path) - Add comprehensive test coverage - Fix path normalization for all path formats Closes #447 * tested locally and working now * Add filesystem path utils and tests * Ensure Windows drive letters are capitalized in normalizePath * adding test for gh pr comment * pushing jest and windows testing config * last commit? fixing comments on PR * Fix bin and bump sdk * Remove redundant commonjs version of path-utils and import from ts version * Remove copying cjs file * Remove copying run-server * Remove complex args parsing and do other cleanup * Add missing tools details to Readme * Move utility functions from index to lib * Add more tests and handle very small and very large files edge cases * Finish refactoring and include original security fix comments * On Windows, also check for drive root * Check symlink support on restricted Windows environments * Fix tests * Bump SDK and package version * Clean up --------- Co-authored-by: olaservo <olahungerford@gmail.com> Co-authored-by: adam jones <adamj+git@anthropic.com>
1 parent 7e1d9d9 commit 4636883

File tree

9 files changed

+1291
-402
lines changed

9 files changed

+1291
-402
lines changed

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/filesystem/README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ The server's directory access control follows this flow:
7373
- `head` (number, optional): First N lines
7474
- `tail` (number, optional): Last N lines
7575
- Always treats the file as UTF-8 text regardless of extension
76+
- Cannot specify both `head` and `tail` simultaneously
7677

7778
- **read_media_file**
7879
- Read an image or audio file
@@ -119,6 +120,23 @@ The server's directory access control follows this flow:
119120
- List directory contents with [FILE] or [DIR] prefixes
120121
- Input: `path` (string)
121122

123+
- **list_directory_with_sizes**
124+
- List directory contents with [FILE] or [DIR] prefixes, including file sizes
125+
- Inputs:
126+
- `path` (string): Directory path to list
127+
- `sortBy` (string, optional): Sort entries by "name" or "size" (default: "name")
128+
- Returns detailed listing with file sizes and summary statistics
129+
- Shows total files, directories, and combined size
130+
131+
- **directory_tree**
132+
- Get a recursive tree view of files and directories as a JSON structure
133+
- Input: `path` (string): Starting directory path
134+
- Returns JSON structure with:
135+
- `name`: File/directory name
136+
- `type`: "file" or "directory"
137+
- `children`: Array of child entries (for directories only)
138+
- Output is formatted with 2-space indentation for readability
139+
122140
- **move_file**
123141
- Move or rename files and directories
124142
- Inputs:

0 commit comments

Comments
 (0)