• v2.0.0 d4e909be4b

    v2.0.0
    All checks were successful
    Publish Package / publish (push) Successful in 25s
    Stable

    jack released this 2025-10-10 12:09:24 +02:00 | 0 commits to main since this release

    Filesystem 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 any types
    • 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 validation
    • write_file: Write content with size limit validation
    • list_files: List directory contents with optional glob patterns
    • search_files: Search for text in files with regex support and file type filtering
    • create_directory: Create directories recursively
    • delete_file: Delete files or directories recursively
    • get_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_PATHS environment 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 any types)
    • 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