Skip to main content
Glama
MCP Czkawka Server

MCP Czkawka Server

by MitchellV3

MCP Czkawka Server

License: MIT TypeScript

An MCP (Model Context Protocol) server that provides tools to interact with the czkawka_cli command-line tool using FastMCP.

czkawka is a multi-functional app to find duplicates, empty folders, similar images/videos, broken files, etc. This server exposes its CLI functionality as MCP tools.

πŸ“‹ Features

  • Provides MCP tools corresponding to czkawka_cli subcommands:

    • find_duplicates (dup)

    • find_empty_folders (empty-folders)

    • find_big_files (big)

    • find_empty_files (empty-files)

    • find_temporary_files (temp)

    • find_similar_images (image)

    • find_similar_videos (video)

    • find_duplicate_music (music)

    • find_invalid_symlinks (symlinks)

    • find_broken_files (broken)

    • find_invalid_extension_files (ext)

  • Built using the FastMCP framework.

  • Configurable path for the czkawka_cli executable via environment variable.

Related MCP server: ellmos-filecommander-mcp

πŸš€ Getting Started

  1. Prerequisites:

    • Ensure you have czkawka_cli accessible on your system. Download it from the Czkawka Releases page.

    • Ensure you have Node.js and npm installed (Download from nodejs.org).

  2. Install Dependencies:

    npm install
  3. Build the Server:

    npm run build

    This creates the compiled JavaScript files in the dist/ directory.

  4. Configure MCP Client: Add the server to your MCP client configuration (e.g., mcp_settings.json for Roo/VS Code or .cursor/mcp.json).

    Example mcp_settings.json entry:

    {
      "mcpServers": {
        "czkawka-server": {
          "command": "node", 
          "args": [
            "c:/path/to/your/mcp-czkawka/dist/index.js" // Use absolute path to the compiled file in dist/
          ],
          "env": {
            "CZKAWKA_CLI_PATH": "c:/path/to/your/czkawka_cli.exe" // Use absolute path
          }
        }
        // ... other servers
      }
    }
    • Replace "c:/path/to/your/mcp-czkawka/dist/index.js" with the absolute path to the compiled server file in the dist directory.

    • Replace "c:/path/to/your/czkawka_cli.exe" with the absolute path to your czkawka_cli executable.

  5. Restart MCP Client: Restart your MCP client (e.g., VS Code) to load the new server configuration.

πŸ› οΈ Usage

Once configured, you can use the tools provided by this server (e.g., find_duplicates, find_empty_folders) through your MCP client. Refer to the tool descriptions provided by the server for specific parameters.

Example Tool Call (Conceptual):

<use_mcp_tool>
  <server_name>czkawka-server</server_name>
  <tool_name>find_duplicates</tool_name>
  <arguments>
  {
    "directories": ["C:/Users/YourUser/Documents", "D:/Photos"],
    "delete_method": "AEO",
    "file_to_save": "C:/Users/YourUser/Desktop/duplicates_report.txt"
  }
  </arguments>
</use_mcp_tool>

βš™οΈ Configuration

  • CZKAWKA_CLI_PATH (Environment Variable): Required. Set this in the env section of your MCP server configuration to the absolute path of your czkawka_cli executable.

  • CZKAWKA_TIMEOUT_MS (Environment Variable): Optional. Maximum time in milliseconds to wait for a czkawka process to complete. Defaults to 600000 (10 minutes).

  • CZKAWKA_MAX_CONCURRENT (Environment Variable): Optional. Maximum number of czkawka processes to run concurrently. Defaults to 3.

  • CZKAWKA_MAX_OUTPUT_SIZE (Environment Variable): Optional. Maximum combined stdout/stderr size in bytes to buffer in memory. If exceeded, the output is written to a temporary file and the result includes an outputFile path. Defaults to 10485760 (10 MB).

πŸ“š Czkawka Documentation

For more details on czkawka_cli usage and options, refer to the official Czkawka GitHub repository.

πŸ“¦ Large Output Handling

For scans that produce very large result sets (e.g., millions of duplicate files), the MCP JSON response payload can become extremely large. The server provides two strategies to handle this:

  1. Automatic spillover to temp files: If the combined stdout/stderr output exceeds CZKAWKA_MAX_OUTPUT_SIZE (default 10 MB), the result will include an outputFile field pointing to a temporary file on disk, and the stdout/stderr fields will be empty strings. The temp file is cleaned up on server shutdown.

  2. Direct file output (recommended for very large scans): Czkawka's built-in file_to_save, compact_file_to_save, and pretty_file_to_save parameters write results directly to a file on disk. This avoids transferring large payloads over MCP entirely. For example:

    {
      "directories": ["C:/Users/YourUser/Documents"],
      "file_to_save": "C:/Users/YourUser/Desktop/results.txt",
      "compact_file_to_save": "C:/Users/YourUser/Desktop/results.json"
    }

    When using file_to_save or compact_file_to_save, czkawka writes results directly and outputs minimal status text to stdout, keeping the MCP response small.

πŸ”’ Security Considerations

  • Network exposure: This server is designed to run locally (stdio transport) or on a trusted network only. Do not expose the MCP endpoint to untrusted networks.

  • Binary execution: This server executes the czkawka_cli binary tool and passes user-supplied directory paths directly to it. Ensure the server is only accessible to trusted clients.

  • Input validation: The server validates that all directory paths are absolute and exist on disk before passing them to the CLI. Unknown fields are stripped by Zod schemas, preventing injection of unexpected CLI flags.

  • Access control: Restrict access to the MCP endpoint using firewall rules or network segmentation. In HTTP/SSE mode, consider adding authentication or a reverse proxy.

πŸ“„ License

This project is licensed under the MIT License.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      C
      quality
      D
      maintenance
      Wraps local multimodal CLIs (Google Gemini CLI and Qwen CLI) as MCP tools, enabling text-only AI assistants like Claude to analyze images through relay calls. Supports local paths, URLs, and base64 image inputs with configurable models and output formats.
      2
      4
      MIT
    • A
      license
      B
      quality
      B
      maintenance
      Comprehensive MCP server for filesystem operations, process management, interactive sessions, and async file search. Includes utilities for JSON repair, encoding fixes, duplicate detection, OCR, ZIP archives, and Markdown export.
      50
      178 npm
      6
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables AI agents to validate .tdc configs, generate deterministic test data files locally, locate language and country data packs, summarise generated files, and read the TDCv2 docs as MCP tools. Everything runs on the user's machine, producing identical output byte for byte on every run.
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Exposes the local voidtools Everything index over MCP stdio on Windows, letting AI agents search, filter, aggregate, detect duplicates and grep file contents across millions of index entries in milliseconds instead of recursively scanning disks. It provides 13 tools and 3 resources, running loopback-only and read-only by default.
      MIT