Skip to main content
Glama
deerajd

MCP Duplicate File Manager Server

by deerajd

MCP Duplicate File Manager Server

A Model Context Protocol (MCP) server that enables LLM-based AI agents to manage duplicate files efficiently. Designed for seamless integration with LLMs and AI agents using the MCP protocol with intelligent duplicate detection and safe deletion capabilities.


Features

  • Exposes file management tools for LLM agents via MCP:

    • list_files: List files in directories with optional filtering

    • find_duplicates: Find duplicate files based on content hash (MD5)

    • delete_duplicates: Safely delete duplicate files with intelligent copy detection

  • Smart copy detection: Prioritizes deleting files with copy indicators ("copy", "(1)", "(2)", etc.)

  • Content-based duplicate detection using MD5 hashing for accuracy

  • Recursive directory scanning with optional pattern matching

  • Dry-run mode for safe preview before actual deletion

  • Simple integration with Claude, MCP clients, or other LLM-based agents


Related MCP server: ChromaDB Local MCP Server

Quickstart

1. Install & Run

Run the MCP Duplicate File Manager Server using uvx:

uvx --from git+https://github.com/deerajd/DuplicateFileRemover-MCP.git mcp-server

2. Integrate with Your LLM Agent

Add the following to your tool configuration (for Claude, MCP clients, etc.):

{
  "mcpServers": {
    "DuplicateListor": {
      "command": "uvx",
      "args": [
        "--from",
        "git+https://github.com/deerajd/DuplicateFileRemover-MCP.git",
        "mcp-server"
      ]
    }
  }
}

This configuration launches the MCP Duplicate File Manager Server as a subprocess, exposing file management tools to your LLM agent.


3. Usage

From your LLM agent, you can call:

List Files in Directory

list_files(directory="./Documents", pattern="*.pdf")        # List PDF files
list_files(directory="/home/user", include_hidden=True)     # Include hidden files
list_files()                                                # List all files in current directory

Find Duplicate Files

find_duplicates(directory="./Downloads")                    # Find duplicates in Downloads
find_duplicates(directory="/Users/john/Desktop", recursive=False)  # Non-recursive search
find_duplicates()                                           # Find duplicates in current directory

Delete Duplicate Files

delete_duplicates(directory="./Documents", dry_run=True)    # Preview what would be deleted
delete_duplicates(directory="./Documents", dry_run=False)   # Actually delete duplicates
delete_duplicates(directory="./Pictures", recursive=True)   # Recursive deletion with preview

The server provides detailed responses including:

  • List of files with metadata (name, size, type, path)

  • Duplicate file groups organized by content hash

  • Deletion results with preserved originals and deleted copies

  • Error handling for inaccessible files or directories


API Reference

list_files(directory=".", pattern="*", include_hidden=False)

  • Parameters:

    • directory (str): Directory path to list files from (default: current directory)

    • pattern (str): File pattern to match (e.g., ".py", ".txt") (default: "*")

    • include_hidden (bool): Whether to include hidden files (default: False)

  • Returns: List of dictionaries containing file information (name, size, type, path, modified)

find_duplicates(directory=".", recursive=True)

  • Parameters:

    • directory (str): Directory path to search for duplicates (default: current directory)

    • recursive (bool): Whether to search recursively in subdirectories (default: True)

  • Returns: Dictionary with hash as key and list of duplicate file paths as values

delete_duplicates(directory=".", recursive=True, dry_run=True)

  • Parameters:

    • directory (str): Directory path to search for duplicates (default: current directory)

    • recursive (bool): Whether to search recursively in subdirectories (default: True)

    • dry_run (bool): If True, only show what would be deleted without actually deleting (default: True)

  • Returns: Dictionary with information about deleted files and preserved originals

Smart Copy Detection

The server intelligently identifies and prioritizes deletion of files with copy indicators:

  • copy - Files containing "copy" in the filename

  • (1), (2), etc. - Files with numbered suffixes

  • _copy, -copy - Files with copy prefixes/suffixes

  • duplicate, dup - Files marked as duplicates

  • Multiple language variants (copie, kopia, copia)


Development

Requirements

Project Structure

DuplicateListor/
├── duplicatelist.py             # Main server implementation
├── main.py                      # Entry point
├── pyproject.toml               # Project configuration
└── README.md                    # This file

Safety Features

  • Dry-run Mode: Preview changes before actual deletion

  • Smart Original Detection: Preserves files without copy indicators

  • Error Handling: Graceful handling of inaccessible files

  • Content-based Matching: Uses MD5 hashing for accurate duplicate detection

  • Detailed Reporting: Comprehensive feedback on all operations


License

MIT License


Available Tools

3 tools
delete_duplicatesA

Delete duplicate files in a directory, keeping only one copy of each file. Uses intelligent copy detection to prioritize deleting files with copy indicators (like "copy", "(1)", "(2)", etc.) over original files.

Args: directory: Directory path to search for duplicates (default: current directory) recursive: Whether to search recursively in subdirectories (default: True) dry_run: If True, only show what would be deleted without actually deleting (default: True)

Returns: Dictionary with information about deleted files and preserved originals

Example: delete_duplicates(directory="./documents", dry_run=True) # Preview only delete_duplicates(directory="./documents", dry_run=False) # Actually delete

ParametersJSON Schema
NameRequiredDescriptionDefault
dry_runNo
directoryNo.
recursiveNo

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.6/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden. It discloses the dry_run behavior, the copy-indicator detection logic, and the return type. However, it does not explicitly state that deletions are permanent or how originals are chosen when no copy indicator exists, which keeps it from a perfect score.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with a concise overview, a clear Args list, a Returns line, and practical examples. Every sentence adds value without redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a moderately complex tool with no annotations, the description covers purpose, behavior, parameters, return value, and usage examples. The presence of an output schema further reduces the need to detail return values, so the description is complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema provides no descriptions (0% coverage), but the description thoroughly explains each parameter, including its purpose, default value, and effect (e.g., dry_run prevents actual deletion). This fully compensates for the schema gap.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool deletes duplicate files in a directory while keeping one copy. It distinguishes itself from siblings by specifying the deletion action and the copy-indicator prioritization, making its purpose unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context: it is used to delete duplicate files, with parameters controlling directory, recursion, and dry-run. It includes example calls showing preview and actual deletion, but does not explicitly mention when to use it over sibling tools like find_duplicates.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

find_duplicatesA

Find duplicate files in a directory based on content hash.

Args: directory: Directory path to search for duplicates (default: current directory) recursive: Whether to search recursively in subdirectories (default: True)

Returns: Dictionary with hash as key and list of duplicate file paths as values

Example: find_duplicates(directory="./documents") find_duplicates(directory="/home/user", recursive=False)

ParametersJSON Schema
NameRequiredDescriptionDefault
directoryNo.
recursiveNo

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.6/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It discloses that duplicates are found via content hash, returns a dictionary, and shows default recursive behavior. While it does not explicitly state it is read-only or cover error handling, the operation's non-destructive nature is implied by 'Find duplicate files' and the described return format.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise and well-structured into Purpose, Args, Returns, and Example. Every section serves a purpose, with no redundant or extraneous information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple two-parameter tool with an output schema, the description covers purpose, parameter semantics, return format, and includes examples. No critical information is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema has no parameter descriptions (0% coverage), but the description thoroughly explains both parameters: 'directory' with default current directory and 'recursive' with default True, plus example usage. This fully compensates for the schema's lack of description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description states 'Find duplicate files in a directory based on content hash' with a specific verb and resource, and clearly distinguishes from sibling tools 'list_files' and 'delete_duplicates' by focusing on duplicate detection rather than listing or deletion.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context on what the tool does and includes parameter defaults and examples. However, it does not explicitly mention when to use this tool instead of the sibling tools, so it lacks explicit alternative guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

list_filesA

List files in a specified directory with optional filtering.

Args: directory: Directory path to list files from (default: current directory) pattern: File pattern to match (e.g., ".py", ".txt") (default: "*") include_hidden: Whether to include hidden files (default: False)

Returns: List of dictionaries containing file information (name, size, type, path)

Example: list_files(directory=".", pattern="*.py") list_files(directory="/home/user/documents", include_hidden=True)

ParametersJSON Schema
NameRequiredDescriptionDefault
patternNo*
directoryNo.
include_hiddenNo

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.1/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description must disclose behavior on its own. It clearly indicates this is a read-only listing operation and describes the return format (list of dictionaries with name, size, type, path). However, it does not mention edge cases like permission errors, sorting, recursion, or whether paths are absolute/relative.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with Args, Returns, and Example sections. Every sentence adds value: parameter explanations, return type, and practical usage examples. It is appropriately sized for the tool's complexity without redundant repetition of the schema.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple, all-optional-parameter listing tool, the description is largely complete. It documents all parameters, return values, and provides two examples. However, it lacks explicit usage guidance or exclusions (e.g., when to prefer find_duplicates), and it does not mention potential errors, which slightly limits completeness.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description carries the full burden. It explains each parameter with meaningful detail beyond the schema: 'directory' defaults to current directory, 'pattern' shows example glob patterns, and 'include_hidden' controls hidden file visibility. The examples further clarify parameter usage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description is specific: 'List files in a specified directory with optional filtering.' This clearly states the verb (list), resource (files in a directory), and scope (optional filtering). It also distinguishes itself from sibling tools focused on duplicates (find_duplicates, delete_duplicates) by focusing on basic file listing.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage through examples like list_files(directory='.', pattern='*.py') and parameter explanations, but it never explicitly states when to choose this tool over alternatives. There is no mention of when not to use it or how it relates to the sibling duplicate-related tools.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

TDQS

A4.5/5.0
Disambiguation5/5

Each tool has a distinct purpose: list_files for directory exploration, find_duplicates for identifying duplicates, and delete_duplicates for removing them. There is no overlap or ambiguity between the tool functions.

Naming Consistency5/5

All tools follow the verb_noun pattern with consistent snake_case and plural nouns (list_files, find_duplicates, delete_duplicates). The naming is uniform and intuitive.

Tool Count5/5

With 3 tools, the server is tightly scoped to the core duplicate file management workflow. Each tool is essential and none are redundant, making the count appropriate.

Completeness5/5

The tool set covers the full lifecycle: listing files to explore, finding duplicates, and then deleting them with a dry-run option for safety. No critical operations are missing for the stated purpose.

Maintenance

ActivityInactive
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables LLMs to organize and manage Windows file systems with intelligent file analysis, automated grouping, renaming with date prefixes, and safe operations through dry-run mode and sandbox restrictions.
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    Provides AI assistants with persistent memory through local ChromaDB vector storage, featuring automated file ingestion and batch processing for over 70 file types. It enables advanced vector search, EXIF metadata extraction for photos, and duplicate file detection across local directories.
    MIT
  • A
    license
    Not graded
    quality
    B
    maintenance
    Enables AI agents and LLMs to perform comprehensive file system operations including CRUD, search, archive, hashing, and duplicate detection via the Model Context Protocol.
    1
    MIT

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/deerajd/DuplicateFileRemover-MCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server