Commit graph servers/src/filesystem
Author SHA1 Message Date
olaservo
bbbc0c6381 Fix TypeScript error in filesystem tests by adding missing afterEach import
The afterEach function was used in the test file but not imported from vitest, causing a build failure. This was introduced in PR #2851.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-28 21:06:25 -07:00
Ola Hungerford
d2eb945c4d
Merge pull request #2851 from olaservo/fix-wsl-path-conversion
Resolve filesystem issue where WSL paths are incorrectly converted to Windows format
2025-10-28 18:56:58 -07:00
Ola Hungerford
ed4b36b6d5
Merge branch 'main' into fix-wsl-path-conversion 2025-10-19 11:45:07 -07:00
olaservo
b666e7f246 Migrate sequentialthinking and filesystem servers from Jest to Vitest
- Replace Jest dependencies with Vitest and @vitest/coverage-v8
- Update test scripts to use 'vitest run --coverage'
- Create vitest.config.ts for both servers with node environment and coverage settings
- Update all test files:
  - Change imports from '@jest/globals' to 'vitest'
  - Replace jest.mock() with vi.mock()
  - Replace jest.fn() with vi.fn()
  - Update mock clearing/restoring to use vi methods
- Remove jest.config.cjs files
- All 151 tests passing (24 in sequentialthinking, 127 in filesystem)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-19 11:21:58 -07:00
olaservo
c9b0135aa5 fix: preserve WSL paths and improve path normalization logic 2025-10-12 19:59:22 -07:00
olaservo
f6fbfc4c5e Merge remote-tracking branch 'upstream/main' into add-sequentialthinking-tests-update-sdk 2025-10-12 18:09:41 -07:00
olaservo
f03a4eda56 Merge remote-tracking branch 'upstream/main' 2025-10-12 18:07:29 -07:00
olaservo
072e53322b Add tests for sequential thinking and update typescript sdk versions 2025-10-07 23:01:42 -07:00
多吃点
097fdab463
docs: Fix duplicate directory_tree tool entry in API documentation 2025-09-13 13:00:02 +08:00
Sebastien Rosset (serosset)
b647cb3019 Add documentation for the read_multiple_files action. 2025-08-23 10:51:51 -07:00
Finn Andersen
fd886fac9c
Support glob pattern in search_files tool (#745)
Co-authored-by: Adam Jones <adamj+git@anthropic.com>
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Adam Jones <adamj@anthropic.com>
2025-08-23 07:37:53 +01:00
Enrico Ballardini
d381cf1ffd
feat(directory_tree): add excludePatterns support & documentation (#623)
- Update documentation with directory_tree declaration
- Add excludePatterns parameter to DirectoryTreeArgsSchema
- Implement pattern exclusion in buildTree function using minimatch
- Pass excludePatterns through recursive calls
- Support both simple and glob patterns for exclusion
- Maintain consistent behavior with search_files implementation

* Add tests and fix implementation

---------

Co-authored-by: Ola Hungerford <olahungerford@gmail.com>
Co-authored-by: Adam Jones <adamj+git@anthropic.com>
Co-authored-by: Adam Jones <adamj@anthropic.com>
2025-08-23 07:19:01 +01:00
Michael Casazza
46368832ef
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>
2025-08-18 18:23:40 +01:00
Ola Hungerford
7e1d9d9ede
fix: clarify list_allowed_directories description to mention subdirectory access (#2571)
The tool description was ambiguous about subdirectory access within allowed directories.
Updated the description to explicitly state that subdirectories are also accessible.

Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
Co-authored-by: Ola Hungerford <olaservo@users.noreply.github.com>
2025-08-17 23:32:33 +01:00
claude[bot]
54f9c6968e fix: remove incorrect resources claim from filesystem server README
The filesystem server does not actually implement MCP Resources capability
but the README incorrectly claimed it provides 'file://system' resource interface.

Fixes #399

Co-authored-by: Ola Hungerford <olaservo@users.noreply.github.com>
2025-08-17 16:38:29 +00:00
Ola Hungerford
1028b32573
Merge pull request #2328 from kunalbabre/main
docs: Update VS Code installation instructions to use mcp.json for issue  #2320
2025-08-07 07:28:32 -07:00
Sampath Vuyyuru
a688cca947
Update src/filesystem/README.md
Fix broken link to Roots
2025-07-26 18:09:30 +00:00
cliffhall
704275818f Replace read_file tool with deprecation notice in description, which is functionally just an alias for read_text_file 2025-07-25 16:01:05 -04:00
cliffhall
471ac89f55 Update SDK version 2025-07-24 14:37:49 -04:00
cliffhall
ba20bd60af Update the way the stream is concatenated
Update the ts sdk
2025-07-18 16:09:56 -04:00
Cliff Hall
2feb7cbaa5
Update src/filesystem/README.md
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2025-07-18 16:03:22 -04:00
Cliff Hall
d532a5846d Stream media file reads 2025-07-18 14:18:32 -04:00
Cliff Hall
11a064c359 Rename read_file to read_text_file and add read_media_file 2025-07-18 13:42:56 -04:00
Kunal Babre
55a36ad0dd docs: Clean up VS Code installation instructions
- Remove unnecessary explanatory note about JSON format
- JSON examples already demonstrate the correct format clearly
- Streamlines documentation to focus on essential information
- Maintains reference to official VS Code MCP documentation

The removed note was redundant since both configuration methods 
use identical JSON structure shown in the examples.
2025-07-11 22:53:13 -07:00
Kunal Babre
95a72b792f docs: Add reference to official VS Code MCP documentation
- Add link to official VS Code MCP documentation in all server READMEs
- Enhances existing VS Code installation instructions with authoritative reference
- Provides users with comprehensive documentation for advanced configuration
- Complements the existing two-method approach with additional resources

Affects: everything, filesystem, git, memory, sequentialthinking
2025-07-11 22:45:10 -07:00
Kunal Babre
20eb59590e docs: Update VS Code installation instructions to use mcp.json
- Replace outdated 'Preferences: Open Settings (JSON)' instructions
- Add proper guidance for 'MCP: Open User Configuration' command
- Update JSON examples to remove mcp wrapper key
- Clarify user vs workspace configuration methods
- Fixes issue with outdated documentation across all servers

Affects: sequentialthinking, filesystem, memory, everything, git
2025-07-11 21:36:21 -07:00
Nandha Reddy
2c922a93f9 feat(filesystem): add symlink resolution and home directory support to roots protocol
- Add symlink resolution using fs.realpath() for security consistency
- Support home directory expansion (~/) in root URI specifications
- Improve error handling with null checks, detailed error messages, and informative logging
- Change allowedDirectories from constant to variable to support roots protocol directory management
2025-07-02 13:38:22 +10:00
Nandha Reddy
f3891aaf69 Apply suggestions from code review comments on docs and logging
Co-authored-by: Ola Hungerford <olahungerford@gmail.com>
2025-07-02 09:44:16 +10:00
Nandha Reddy
f8dd74576b feat(filesystem): implement MCP roots protocol for dynamic directory management
- Extract roots processing logic from index.ts into testable roots-utils.ts module and add Test suite
- Update README to recommend MCP roots protocol for dynamic directory management
2025-07-02 09:44:16 +10:00
Nandha Reddy
b37da40003 feat(filesystem): implement MCP roots protocol for dynamic directory management
- Add support for dynamic directory updates via MCP roots protocol
- Allow clients to override command-line directories at runtime
- Maintain backwards compatibility with existing command-line args
- Add comprehensive error handling for edge cases
- Update documentation to explain both configuration methods

Fixes #401
2025-07-02 09:43:25 +10:00
Jenn Newton
d00c60df9d
Address symlink and path prefix issues with allowed directories 2025-06-30 20:04:46 -04:00
Ola Hungerford
178281230c
Update src/filesystem/package.json
Co-authored-by: Cliff Hall <cliff@futurescale.com>
2025-06-20 13:54:04 -07:00
Ola Hungerford
e9c4c9d4ba Handle unc path 2025-06-19 21:29:31 -07:00
olaservo
9dd94fd9a0 Adjust path-utils 2025-06-19 21:18:38 -07:00
Ola Hungerford
78fe5d5e47 Address PR review comments: fix UNC path handling, improve test coverage, remove problematic test files
- Fixed UNC path handling bug in normalizePath function to preserve leading double backslashes
- Added comprehensive test coverage for drive letter capitalization and UNC paths
- Removed file-operations.test.ts and core-functionality.test.ts as they were testing their own code rather than actual server functionality
- All path-utils tests now pass with 100% coverage of the actual utility functions
2025-06-18 07:29:25 -07:00
Ola Hungerford
d55afe1fa4 Add more tests 2025-06-16 17:29:44 -07:00
Ola Hungerford
098979ca2a Update SDK 2025-06-15 23:38:23 -07:00
Ola Hungerford
e84c79da2d Merge branch 'main' into add-jest-setup 2025-06-15 23:37:11 -07:00
Ola Hungerford
d2b217ac4f
Merge pull request #1027 from mjherich/feat/filesystem-read-specified-lines
Add head/tail file reading and directory size listings to filesystem server
2025-06-15 23:08:15 -07:00
olaservo
8bdd270abb Add working test config for filesystem 2025-04-13 20:02:08 -07:00
Burke Holland
090b6b7c1a Move VS Code below Claude 2025-04-10 12:10:02 -05:00
Burke Holland
e6db372447 Update READMEs with instructions for VS Code installation 2025-04-03 16:37:27 -05:00
Matt Herich
f41565ce83
Normalize line endings when splitting file chunks 2025-04-03 00:31:26 -07:00
Ola Hungerford
5309e52de2
Merge pull request #589 from g-votte/update-filesystem-readme
Fix misleading edit_file functionality docs in server-filesystem README
2025-03-27 06:42:04 -07:00
Matt Herich
db24c89c5e
Add file read and directory listing enhancements
- Add head/tail functionality for memory-efficient file reading
- Implement new list_directory_with_sizes command with file size info
- Add formatSize utility for human-readable file sizes
2025-03-21 19:29:45 -07:00
EthBerryAdmin
d7ea463aa5
allow ~ to be used in config
following config throws error

```
    "filesystem": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-filesystem",
        "~"
      ]
    },
```

```
Error accessing directory ~: Error: ENOENT: no such file or directory, stat '~'
    at async Object.stat (node:internal/fs/promises:1032:18)
    at async file:///Users/USER_NAME/.npm/_npx/a3241bba59c344f5/node_modules/@modelcontextprotocol/server-filesystem/dist/index.js:33:23━━━━━━━━━━━━━━━━━
    at async Promise.all (index 0)
    at async file:///Users/USER_NAME/.npm/_npx/a3241bba59c344f5/node_modules/@modelcontextprotocol/server-filesystem/dist/index.js:31:1 {
  errno: -2,
  code: 'ENOENT',
  syscall: 'stat',
  path: '~'
}
```

this commit fixes error and allows to set ~ as allowed directory
2025-03-16 16:39:24 +04:00
Shotaro Sano
089b7f9abe Fix misleading edit_file functionality docs in filesystem README 2025-02-03 12:00:41 +09:00
freiit
0cf470e846
"," after last element of JSON object removed. 2025-01-17 11:09:24 +01:00
André Holzmüller
0dd9ac9ea0 fix warnings: - FromAsCasing: 'as' and 'FROM' keywords' casing do not match (line 1)
On branch erdnax123-patch-2
Changes to be committed:
	modified:   src/aws-kb-retrieval-server/Dockerfile
	modified:   src/brave-search/Dockerfile
	modified:   src/everart/Dockerfile
	modified:   src/everything/Dockerfile
	modified:   src/filesystem/Dockerfile
	modified:   src/gdrive/Dockerfile
	modified:   src/github/Dockerfile
	modified:   src/gitlab/Dockerfile
	modified:   src/google-maps/Dockerfile
	modified:   src/memory/Dockerfile
	modified:   src/postgres/Dockerfile
	modified:   src/sequentialthinking/Dockerfile
	modified:   src/slack/Dockerfile
2025-01-02 12:56:40 -03:00
colinmcneil
49044156e3
Update readmes to use new mcp namespace 2024-12-19 13:11:36 -08:00