-
released this
2025-10-10 12:09:24 +02:00 | 0 commits to main since this releaseFilesystem MCP v2.0.0
🎉 Major Refactor
Complete refactor to improve code quality, maintainability, and developer experience.
🏗️ Architecture
Modular Structure
- Split monolithic 241-line index.ts into focused modules
- types.ts: Complete TypeScript type definitions
- tool-definitions.ts: MCP tool schemas with input validation
- handlers.ts: Tool execution logic
- filesystem-service.ts: Secure file operations
- index.ts: Minimal server setup (52 lines, 78% reduction)
Type Safety
- 100% TypeScript type safety - eliminated all
anytypes - Proper interfaces for all data structures
- Type-safe tool arguments and responses
Documentation
- Complete JSDoc documentation for all public APIs
- Detailed parameter descriptions
✨ Features
File Operations
read_file: Read file contents with size limit validationwrite_file: Write content with size limit validationlist_files: List directory contents with optional glob patternssearch_files: Search for text in files with regex support and file type filteringcreate_directory: Create directories recursivelydelete_file: Delete files or directories recursivelyget_file_info: Get detailed file/directory metadata
Security
- Path validation to prevent directory traversal attacks
- Sandboxed operations within allowed directories
- Configurable allowed paths via
ALLOWED_PATHSenvironment variable - File size limits (default: 10MB, configurable via
MAX_FILE_SIZE) - Secure glob pattern support for file filtering
🧪 Testing
- 19 comprehensive unit tests using Vitest
- Type definition tests validating all interfaces
- Tool schema validation tests
- 100% test pass rate
📦 Dependencies
- MCP SDK upgraded: 0.5.0 → 1.20.0
- Moved to devDependencies (runtime not needed)
- Added Vitest ^3.2.4 for testing
- Added @vitest/coverage-v8 for coverage reporting
📊 Code Quality Metrics
- index.ts: 241 → 52 lines (78% reduction)
- Modules: 5 focused files
- Type Safety: 100% (zero
anytypes) - JSDoc Coverage: 100%
- Test Coverage: 19 tests, all passing
- Build: Clean compilation, zero warnings
🔄 Migration Guide
No breaking changes to the MCP tool interface - all existing tool calls remain compatible.
🤖 Generated with Claude Code
Downloads
-
Source code (ZIP)
0 downloads
-
Source code (TAR.GZ)
0 downloads