Folder Restructure MCP Server
Analyzes file access times, duplicates, and sizes to identify rarely used files and suggest cleanup for folder restructuring.
README
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 filesduplicates <dir> [min_kb]- Find duplicate filesextensions <dir> [top_n]- Analyze by file typestats <dir>- Get access statisticsrarely-used <dir> [days] [min_kb]- Find old filescleanup <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:
-
"Find duplicates in ~/Downloads"
- Shows duplicate files and how much space you could save
-
"What are my largest files in ~/Documents?"
- Lists files over 10MB sorted by size
-
"Analyze file types in ~/Projects"
- Shows which extensions (.js, .py, .mp4) take up the most space
-
"Suggest cleanup for ~/Downloads"
- Smart suggestions for old, large files you might want to delete
-
"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:
uvx fastmcp dev folder_restructure_mcp/server.py
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。