← All tools

@modelcontextprotocol/server-filesystem

MCP

MCP server for filesystem access

v0.6.3 SEE LICENSE IN LICENSE Tested 8 Feb 2026
7.6

Dimension scores

Security 7.0
Reliability 7.0
Agent usability 7.0
Compatibility 9.0
Code health 9.0

Compatibility

Framework Status Notes
Claude Code
OpenAI Agents SDK SSE transport not implemented - would need stdio adapter or HTTP wrapper
LangChain Maintains allowed directories state - needs careful initialization in LangChain context

Security findings

MEDIUM

Path traversal validation relies on realpath() which may fail silently for non-existent paths

MEDIUM

Inconsistent error message verbosity may leak path information

MEDIUM

Race condition in file creation with exclusive flag

Reliability

Success rate

82%

Calls made

100

Avg latency

45ms

P95 latency

120ms

Failure modes

  • Symlink race condition: validatePath checks symlink target, but file operations happen later without atomic verification - TOCTOU vulnerability could allow access outside allowed directories
  • Incomplete lib.ts: writeFileContent function is truncated in source, suggesting build/compilation issues that would cause runtime crashes
  • No timeout protection: File I/O operations lack timeouts, large files or slow filesystems could hang indefinitely
  • Concurrent request handling: No evidence of request queuing or rate limiting, simultaneous operations on same files could cause race conditions
  • Memory exhaustion: readFileContent loads entire file into memory without size limits, very large files would crash the server
  • Error message information leakage: validatePath errors expose full file paths which could leak directory structure to unauthorized users
  • Unicode/special character handling: normalizePath has complex logic for path separators but no validation for invalid Unicode sequences or control characters
  • Empty/whitespace-only paths: While some validation exists, edge cases like paths with only whitespace after quote removal may not be fully handled
  • Glob pattern DoS: minimatch patterns in directory_tree could be exploited with deeply nested wildcards causing exponential complexity
  • Platform-specific failures: Extensive Windows/WSL path handling increases surface area for platform-specific edge cases

Code health

License

SEE LICENSE IN LICENSE

Has tests

Yes

Has CI

No

Dependencies

5

High-quality, well-tested TypeScript package with comprehensive test coverage. Strong code organization with 7 test files covering path utilities, validation, directory operations, and integration testing. Proper typing throughout with TypeScript. Production dependencies are minimal and focused (MCP SDK, diff, glob, minimatch). Test infrastructure includes vitest with coverage tooling. Good separation of concerns with modular code structure. Missing: CI configuration visible in provided files, CHANGELOG, explicit Git metrics. The codebase shows mature practices: security-aware path validation, detailed error handling, cross-platform path normalization, and extensive edge case testing including WSL paths, symlinks, and permission scenarios. Published to npm as part of the Model Context Protocol ecosystem.