Featured

Deploy OpenClaw in 60 seconds — 20% off logoDeploy OpenClaw in 60 seconds — 20% off

Launch OpenClaw on Hostinger in about 60 seconds and keep your agent live 24/7. Our referral link gives you 20% off, no coupon code needed.

Launch on Hostinger
Run your Hermes agent on Hostinger, fully managed logoRun your Hermes agent on Hostinger, fully managed

Launch Hermes on Hostinger in one click, fully managed, no VPS knowledge needed. Use code ZACAARON10 for 10% off.

Launch on Hostinger
Crawl and scrape any site into clean data, 10% off logoCrawl and scrape any site into clean data, 10% off

Firecrawl crawls and scrapes any site into clean markdown for your agent. Get 1,000 free credits, and new users get 10% off their first purchase.

Try Firecrawl free
Your own AI agent, running 24/7 with QwikClaw logoYour own AI agent, running 24/7 with QwikClaw

QwikClaw sets up and runs an always-on OpenClaw agent for you. One click, no config files, no server setup.

Deploy now
One API to scrape, enrich, and extract the internet. logoOne API to scrape, enrich, and extract the internet.

Context.dev gives your agents a single API to scrape, enrich, and extract live web data — no proxies, no parsers, no maintenance.

Start building free
SetupClaw: done-for-you OpenClaw for founders & exec teams logoSetupClaw: done-for-you OpenClaw for founders & exec teams

White-glove OpenClaw for founders and exec teams (4–50+ employees): we install, harden, integrate your tools, and maintain it — secured from day one.

Get it set up for you
SEO data APIs for your agent, $1 free credit logoSEO data APIs for your agent, $1 free credit

DataForSEO gives your agent live access to SERP results, keyword data, backlinks, and on-page SEO data through one API. New accounts get a $1 credit, good for up to 20,000 keyword or backlink lookups.

Try DataForSEO free
Reach 47,000+ AI builders

A flat monthly placement in front of developers actively installing AI tools. No lock-in, cancel anytime.

Advertise here

Works with

Claude CodeClaude DesktopCursorVS CodeClineCodex CLIOpenClaw+ any MCP client

Install to Claude Code

This server doesn't publish a one-line install command. Follow the setup in the source repository.

Summary

Analyzes file access times, duplicates, and sizes to identify rarely used files and suggest cleanup for folder restructuring.

README.md

Folder Restructure MCP Server

An MCP server that analyzes file access times to help identify rarely used files for folder restructuring.

Features

  • find_rarely_used_files: Find files that haven't been accessed in a specified number of days
  • get_file_stats: Get overall statistics about file access patterns in a directory
  • find_duplicates: Find duplicate files based on size and name, calculate wasted space
  • find_large_files: Identify the largest files taking up space
  • analyze_by_extension: Group files by type (.jpg, .mp4, etc.) showing count and total size
  • suggest_cleanup: Smart cleanup suggestions based on age and size

Installation

# Install uv (required)
brew install uv

# The server will be run via uvx, no additional installation needed

Configuration

Already configured in .kiro/settings/mcp.json:

{
  "mcpServers": {
    "folder-restructure": {
      "command": "uvx",
      "args": [
        "--directory",
        "/Users/swarupravi/Downloads/MCP_server_folder",
        "fastmcp",
        "run",
        "folder_restructure_mcp/server.py"
      ],
      "disabled": false,
      "autoApprove": []
    }
  }
}

How to Use

Method 1: Through Kiro AI (Easiest)

Just ask me in natural language:

"Find duplicate files in ~/Downloads"
"Show me the largest files in ~/Documents over 50MB"
"What file types are taking up space in ~/Projects"
"Find files in ~/Downloads not accessed in 6 months"
"Suggest cleanup for ~/Downloads"

I'll automatically call the right MCP tools and show you the results!

Method 2: Terminal CLI (Direct Access)

Use the folder-analyze command:

# Find large files over 100MB
./folder-analyze large ~/Downloads 100 10

# Find duplicates
./folder-analyze duplicates ~/Downloads

# Analyze by file extension
./folder-analyze extensions ~/Projects

# Get file access statistics
./folder-analyze stats ~/Documents

# Find rarely used files (not accessed in 180 days)
./folder-analyze rarely-used ~/Downloads 180

# Get cleanup suggestions
./folder-analyze cleanup ~/Downloads 180 5

Available Commands:

  • large <dir> [min_mb] [max_results] - Find largest files
  • duplicates <dir> [min_kb] - Find duplicate files
  • extensions <dir> [top_n] - Analyze by file type
  • stats <dir> - Get access statistics
  • rarely-used <dir> [days] [min_kb] - Find old files
  • cleanup <dir> [days] [min_mb] - Get cleanup suggestions

Method 2: Direct Testing (Terminal)

Test the server directly:

# Run in development mode with interactive testing
uvx fastmcp dev folder_restructure_mcp/server.py

# Or run the server
uvx --directory /Users/swarupravi/Downloads/MCP_server_folder fastmcp run folder_restructure_mcp/server.py

Method 3: Python Script

Create a test script:

from folder_restructure_mcp.server import (
    find_rarely_used_files,
    find_duplicates,
    find_large_files,
    analyze_by_extension,
    suggest_cleanup
)

# Find large files
result = find_large_files("~/Downloads", min_size_mb=50, max_results=10)
print(result)

# Find duplicates
result = find_duplicates("~/Downloads", min_size_kb=100)
print(result)

Tool Reference

find_rarely_used_files

Find files not accessed recently.

  • directory: Path to analyze (required)
  • days_threshold: Days since last access (default: 90)
  • min_size_kb: Minimum file size in KB (optional)
  • max_results: Maximum results to return (default: 100)

get_file_stats

Get overall file access statistics.

  • directory: Path to analyze (required)

find_duplicates

Find duplicate files and wasted space.

  • directory: Path to analyze (required)
  • min_size_kb: Only check files larger than this (default: 0)

find_large_files

Find the largest files.

  • directory: Path to analyze (required)
  • min_size_mb: Minimum file size in MB (default: 10)
  • max_results: Maximum results to return (default: 50)

analyze_by_extension

Analyze files grouped by extension.

  • directory: Path to analyze (required)
  • top_n: Number of top extensions to return (default: 20)

suggest_cleanup

Smart cleanup suggestions.

  • directory: Path to analyze (required)
  • days_threshold: Files not accessed in this many days (default: 180)
  • min_size_mb: Minimum file size in MB (default: 1)

Examples

Ask me any of these:

  1. "Find duplicates in ~/Downloads"
  • Shows duplicate files and how much space you could save
  1. "What are my largest files in ~/Documents?"
  • Lists files over 10MB sorted by size
  1. "Analyze file types in ~/Projects"
  • Shows which extensions (.js, .py, .mp4) take up the most space
  1. "Suggest cleanup for ~/Downloads"
  • Smart suggestions for old, large files you might want to delete
  1. "Find files in ~/Desktop not accessed in 1 year"
  • Lists files you haven't touched in 365+ days

Automated Analysis (Cron Job)

Run analysis automatically every 6 hours and save reports:

# Setup cron job (runs at 00:00, 06:00, 12:00, 18:00)
./setup-cron.sh

# Run analysis manually
./run-analysis.sh

# View reports
./view-reports.sh --latest

# Check cron job status
crontab -l

# Remove cron job
crontab -l | grep -v 'run-analysis.sh' | crontab -

Reports Location: analysis-reports/analysis_YYYYMMDD_HHMMSS.json

Each report includes:

  • Large files (>50MB)
  • Duplicate files (>100KB)
  • File statistics
  • File type analysis
  • Cleanup suggestions

Reports are automatically cleaned up (keeps last 30).

Development

Run locally for testing: ``bash uvx fastmcp dev folder_restructure_mcp/server.py ``

See related servers & alternatives →

Related MCP servers

Browse all →

Related guides

Hand-picked reading to help you choose and use Files & Docs servers.