loading…
Search for a command to run...
loading…
A powerful, security-hardened MCP server for intelligent file organization. Provides high-level atomic tools for organizing files into categories, detecting dup
A powerful, security-hardened MCP server for intelligent file organization. Provides high-level atomic tools for organizing files into categories, detecting duplicates, extracting EXIF/ID3 metadata, scheduling automatic organization, and more — for use with Claude, Cursor, and Gemini CLI.
Version: 3.4.2 | MCP Protocol: 2024-11-05 | Node: ≥18.0.0
New in v3.3.0 - Smart Organization:
organize_smart - Auto-detects and organizes mixed folders (music, photos, documents)organize_music - Music by Artist/Album structure with ID3 metadataorganize_photos - Photos by EXIF date with GPS strippingorganize_by_content - Documents by topic extractionbatch_read_files - Read multiple files efficientlyPrevious v3.2.8:
Why Specialized Tools • Quick Start • Features • Tools • Examples • API • Security • Architecture
npm version npm downloads Security Node License Tests
A powerful, security-hardened Model Context Protocol (MCP) server for intelligent file organization.
Traditional filesystem MCP servers provide primitive tools: read, write, make, delete. When an AI organizes folders using only these tools, it results in:
We provide high-level, atomic tools that encapsulate complex file operations:
| Primitive Approach | File Organizer MCP |
|---|---|
Multiple read/write/rename calls |
organize_files() - Atomic execution |
| 50+ reasoning steps | 1 reasoning step |
| High token usage | Minimal token usage |
| Error-prone | Rollback-safe operations |
Install from MCP Registry • View on NPM • Report Issues
Run the following command to start the interactive setup:
npx file-organizer-mcp --setup
The wizard will:
Once configured, you can ask your AI:
| Method | Command | Use Case |
|---|---|---|
| npx | npx file-organizer-mcp --setup |
Occasional use / Trial |
| Global | npm install -g file-organizer-mcp |
Regular use / Faster startup |
file_organizer_scan_directoryScan directory with detailed file information.
directory (required): Full path to directory.include_subdirs (optional): Recursive scan.file_organizer_read_fileSecure file reading with 8-layer validation.
path (required): Absolute path.encoding (optional): utf-8, base64, or binary.file_organizer_organize_smartUnified tool that handles music, photos, and documents automatically using the best strategy for each.
file_organizer_batch_renameRename multiple files using patterns, regex, or numbering.
file_organizer_undo_last_operationReverse previous organization actions.
| Category | Typical Extensions |
|---|---|
| Executables | .exe, .msi, .bat, .sh |
| Videos | .mp4, .avi, .mkv, .mov |
| Documents | .pdf, .doc, .docx, .txt, .md |
| Images | .jpg, .jpeg, .png, .gif, .webp |
| Audio | .mp3, .wav, .flac, .m4a |
| Archives | .zip, .rar, .7z, .tar.gz |
| Code | .py, .js, .ts, .java, .go, .json |
Result: Clean, organized Downloads folder with duplicates identified
---
### Workflow 2: Project Organization
User: "Claude, organize my project folder at ~/myproject"
Claude:
Result: Clean project structure with organized documentation and assets
---
### Workflow 3: Duplicate File Management
User: "Claude, find and analyze duplicates in C:/Users/[YOUR_USERNAME]/Documents"
Claude:
User can manually delete or ask Claude to organize to remove duplicates
---
### Workflow 4: Large File Discovery
User: "Claude, show me the 20 largest files taking up space in my Downloads folder"
Claude:
Result: Clear visibility into space usage with actionable insights
---
### Workflow 5: Music Organization
User: "Claude, organize my music folder at C:/Users/[YOUR_USERNAME]/Music"
Claude:
Result: Music files organized by Artist/Album/Title structure using ID3 metadata
Before: ├── Downloads/ │ ├── song1.mp3 │ ├── track02.mp3 │ └── music_file.mp3
After: ├── Music/ │ ├── Coldplay/ │ │ ├── A Rush of Blood to the Head/ │ │ │ ├── Clocks.mp3 │ │ │ └── The Scientist.mp3 │ └── Radiohead/ │ ├── OK Computer/ │ │ ├── Paranoid Android.mp3 │ │ └── Karma Police.mp3
---
### Workflow 6: Photo Organization
User: "Claude, organize my photos at C:/Users/[YOUR_USERNAME]/Pictures"
Claude:
Result: Photos organized by capture date (YYYY/MM/DD) using EXIF metadata
Before: ├── Pictures/ │ ├── IMG_001.jpg │ ├── photo123.png │ └── DSC_4567.raw
After: ├── Pictures/ │ ├── 2023/ │ │ ├── 12/ │ │ │ ├── 25/ │ │ │ │ ├── IMG_001.jpg │ │ │ └── 31/ │ │ │ └── photo123.png │ └── 2024/ │ ├── 01/ │ │ └── 15/ │ │ └── DSC_4567.raw
---
### Workflow 7: Security Screening with Metadata
User: "Claude, scan my Documents folder for security issues"
Claude:
Result: Comprehensive security scan with metadata-based threat detection
---
### Workflow 8: Set Up Automatic Organization
User: "Claude, automatically organize my Downloads folder every day at 9am"
Claude:
User: "Also watch my Desktop folder every hour"
Claude: 4. Adds second watch → file_organizer_watch_directory({ directory: "/Users/john/Desktop", schedule: "0 * * * *", max_files_per_run: 50 })
Result: Automatic background organization with smart scheduling
---
## <a id="security-configuration"></a>Security Configuration 🔐
### Security Score: 10/10 🌟
The server uses a **Secure by Default** approach. Access is restricted to a specific whitelist of user directories. All system directories are blacklisted.
### ✅ Allowed Directories (Default)
The server automatically detects and allows access to these safe user locations:
| Platform | Allowed Directories |
| ----------- | ------------------------------------------------------------------------------------------------------- |
| **Windows** | `Desktop`, `Documents`, `Downloads`, `Pictures`, `Videos`, `Music`, `OneDrive`, `Projects`, `Workspace` |
| **macOS** | `Desktop`, `Documents`, `Downloads`, `Movies`, `Music`, `Pictures`, `iCloud Drive`, `Projects` |
| **Linux** | `Desktop`, `Documents`, `Downloads`, `Music`, `Pictures`, `Videos`, `~/dev`, `~/workspace` |
_> Note: Only directories that actually exist on your system are enabled._
### ❌ Always Blocked
To prevent accidents, the following are **always blocked**, even if added to config:
- **Windows:** `C:\Windows`, `Program Files`, `AppData`, `$Recycle.Bin`
- **macOS:** `/System`, `/Library`, `/Applications`, `/private`, `/usr`
- **Linux:** `/etc`, `/usr`, `/var`, `/root`, `/sys`, `/proc`
- **Global:** `node_modules`, `.git`, `.vscode`, `.idea`, `dist`, `build`
### ⚙️ Custom Configuration
You can customize behavior by editing the user configuration file.
**Config Location:**
- **Windows:** `%APPDATA%\file-organizer-mcp\config.json`
- **macOS:** `$HOME/Library/Application Support/file-organizer-mcp/config.json`
- **Linux:** `$HOME/.config/file-organizer-mcp/config.json`
**How to Add Directories:**
1. Open `config.json`
2. Add paths to `customAllowedDirectories`:
```json
{
"customAllowedDirectories": [
"C:\\Users\\Name\\My Special Folder",
"D:\\Backups"
]
}
💡 Tip: You can copy a folder path directly from your file explorer's address bar and paste it into
customAllowedDirectories.
By default, for security reasons, you cannot add paths outside your home directory. If you need to access external volumes (like /Volumes/My Drive on macOS or /media/user/usb on Linux), you must explicitly opt-in by adding "allowExternalVolumes": true:
{
"allowExternalVolumes": true,
"customAllowedDirectories": [
"/Volumes/MyExternalDrive",
"/Volumes/Photography Backup"
]
}
(Note: Windows drive letters like D:\ work out of the box and do not require this flag.)
Set your preferred default conflict resolution strategy:
{
"conflictStrategy": "rename"
}
Available strategies:
"rename" (default) - Renames new file (e.g., file (1).txt)"skip" - Keeps existing file, skips new one"overwrite" - Replaces existing file (creates backup first)Simple schedule configuration (for basic hourly/daily/weekly):
{
"autoOrganize": {
"enabled": true,
"schedule": "daily"
}
}
For advanced cron-based scheduling, use the file_organizer_watch_directory tool.
| Attack Type | Protection Mechanism | Status |
|---|---|---|
| Unauthorized Access | Whitelist + Blacklist Enforcement | ✅ Protected |
| Path Traversal | 8-Layer Validation Pipeline | ✅ Protected |
| Symlink Attacks | Real Path Resolution | ✅ Protected |
| DoS | Resource Limits (Files, Depth, Size) | ✅ Protected |
node --versionclaude_desktop_config.json is correctls -ladry_run mode is NOT enabledFile Organizer MCP is built with modern web technologies and follows strict security practices:
@modelcontextprotocol/sdk - Model Context Protocol implementationmusic-metadata - ID3 tag extraction for audio filesexif-parser - EXIF metadata extraction for imagesnode-cron - Cron-based schedule management@inquirer/prompts - Interactive CLI promptsThe File Organizer MCP server implements a "Screen-Then-Enrich" architecture for secure and efficient file operations:
┌───────────────────────────────────────────────────────────┐
│ MCP Client (LLM) │
└─────────────────────────┬─────────────────────────────────┘
│ JSON-RPC 2.0
┌─────────────────────────▼─────────────────────────────────┐
│ MCP Server Layer │
│ (server.ts - Protocol Handler) │
└─────────────────────────┬─────────────────────────────────┘
│
┌─────────────────────────▼─────────────────────────────────┐
│ Security Screening │
│ - Path validation & containment checks │
│ - Sensitive file detection │
│ - Rate limiting │
└─────────────────────────┬─────────────────────────────────┘
│
┌─────────────────────────▼─────────────────────────────────┐
│ Metadata Enrichment │
│ - EXIF extraction for images (camera, date, GPS) │
│ - ID3 extraction for audio (artist, album, title) │
│ - Document metadata (PDF, DOCX properties) │
└─────────────────────────┬─────────────────────────────────┘
│
┌─────────────────────────▼─────────────────────────────────┐
│ Services Layer │
│ ┌────────────┬──────────────┬─────────────┬──────────┐ │
│ │ Path │ Organizer │ Hash │ Scanner │ │
│ │ Validator │ Service │ Calculator │ Service │ │
│ └────────────┴──────────────┴─────────────┴──────────┘ │
└─────────────────────────┬─────────────────────────────────┘
│
┌─────────────────────────▼─────────────────────────────────┐
│ File System │
└───────────────────────────────────────────────────────────┘
file_organizer_inspect_metadataDescription: Extracts comprehensive metadata from files with privacy controls
Parameters:
file: string (required) - Full path to the fileresponse_format: 'json' | 'markdown' (optional, default: 'markdown')Returns:
Configuration:
{
"metadataCache": {
"enabled": true,
"maxAge": 604800000, // 7 days in ms
"maxEntries": 10000,
"cacheDir": ".cache"
}
}
Cache Stats:
// Get cache statistics
const stats = await getCacheStats();
// {
// totalEntries: 1500,
// audioEntries: 800,
// imageEntries: 700,
// cacheSize: 256000
// }
.) are automatically skippedContributions are welcome! Please read CONTRIBUTING.md for guidelines.
git clone https://github.com/kridaydave/File-Organizer-MCP.git
cd File-Organizer-MCP
npm install
npm run build
npm test
🚨 Security vulnerabilities: Email [email protected]
🐛 Bugs/features: GitHub Issues
MIT License - see LICENSE file for details
Built with ❤️ for the MCP community
Добавь это в claude_desktop_config.json и перезапусти Claude Desktop.
{
"mcpServers": {
"file-organizer-mcp": {
"command": "npx",
"args": []
}
}
}