file-organizer-mcp 3.1.0 → 3.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,6 +1,12 @@
1
1
  # Changelog
2
2
 
3
- ## [3.1.0] - 2026-02-06
3
+ ## [3.1.2] - 2026-02-06
4
+
5
+ ### 🐛 Fixed
6
+ - **Bin Entry**: Fixed `file-organizer-setup` bin path (`tui-index.js` → `index.js`)
7
+ - **Postinstall**: Added postinstall welcome message after npm install
8
+
9
+ ## [3.1.1] - 2026-02-06
4
10
 
5
11
  ### ✨ New Features
6
12
  - **Interactive Setup Wizard**: New TUI-based setup (`npx file-organizer-mcp --setup`) for easy configuration of folders, conflict strategies, and Claude Desktop integration.
@@ -8,13 +14,19 @@
8
14
  - Organization by Year/Month for images and videos.
9
15
  - Organization by Artist/Album for audio files.
10
16
  - New tool `file_organizer_inspect_metadata` for safe metadata extraction.
11
- - **File Watching**:
12
- - New tools (`watch_directory`, `unwatch_directory`, `list_watches`) to schedule automatic organization.
13
- - Cron-based scheduling support.
17
+ - **Smart Scheduling & Watch Mode**:
18
+ - New tools: `file_organizer_watch_directory`, `file_organizer_unwatch_directory`, `file_organizer_list_watches`.
19
+ - Cron-based scheduling for automatic organization (e.g., `"0 10 * * *"` for daily at 10am).
20
+ - Per-directory configuration with independent schedules.
21
+ - `min_file_age_minutes` - Skip files newer than X minutes (prevents organizing in-progress downloads).
22
+ - `max_files_per_run` - Limit files processed per scheduled run.
23
+ - Hot-reload configuration without server restart.
14
24
  - **Batch Renaming**: New powerful `file_organizer_batch_rename` tool.
15
25
 
16
26
  ### 🛡️ Improvements
17
- - **Security Check**: Enforced stricter validation for symlink security.
27
+ - **Conflict Strategy**: Configurable default conflict resolution (`rename`/`skip`/`overwrite`) via config.
28
+ - **Security Check**: Enforced stricter validation for symlink security with explicit `lstat` checks.
29
+ - **Config Management**: Deep merge updates preserve existing settings when adding new configuration.
18
30
  - **Free Models**: Updated default configuration to prioritize free models.
19
31
 
20
32
  ### 🐛 Fixed
package/README.md CHANGED
@@ -1,12 +1,12 @@
1
1
  # <a id="file-organizer-mcp-server"></a>File Organizer MCP Server 🗂️
2
2
 
3
- **Version:** 3.1.0 | **MCP Protocol:** 2024-11-05 | **Node:** ≥18.0.0
3
+ **Version:** 3.1.1 | **MCP Protocol:** 2024-11-05 | **Node:** ≥18.0.0
4
4
 
5
5
  [Quick Start](#quick-start) • [Features](#features) • [Tools](#tools-reference) • [Examples](#example-workflows) • [API](API.md) • [Security](#security-configuration) • [Architecture](ARCHITECTURE.md)
6
6
 
7
7
  ---
8
8
 
9
- [![npm version](https://img.shields.io/badge/npm-v3.1.0-blue.svg)](https://www.npmjs.com/package/file-organizer-mcp)
9
+ [![npm version](https://img.shields.io/badge/npm-v3.1.2-blue.svg)](https://www.npmjs.com/package/file-organizer-mcp)
10
10
  [![npm downloads](https://img.shields.io/npm/dm/file-organizer-mcp.svg)](https://www.npmjs.com/package/file-organizer-mcp)
11
11
  [![Security](https://img.shields.io/badge/security-hardened-green.svg)](https://github.com/kridaydave/File-Organizer-MCP)
12
12
  [![Node](https://img.shields.io/badge/node-%3E%3D18.0.0-brightgreen.svg)](https://nodejs.org)
@@ -57,10 +57,20 @@ Add to `claude_desktop_config.json`:
57
57
 
58
58
  ### First Steps
59
59
 
60
- 1. **Restart Claude Desktop**
61
- 2. Try: `"Scan my Downloads folder"`
62
- 3. Then: `"Show me the largest files"`
63
- 4. Finally: `"Organize my files — preview first"`
60
+ 1. **Run the Setup Wizard (Recommended)**
61
+ ```bash
62
+ npx file-organizer-mcp --setup
63
+ ```
64
+ This interactive wizard helps you:
65
+ - Select folders to organize
66
+ - Set your preferred conflict strategy
67
+ - Configure auto-organize schedules
68
+ - Generate Claude Desktop config
69
+
70
+ 2. **Restart Claude Desktop**
71
+ 3. Try: `"Scan my Downloads folder"`
72
+ 4. Then: `"Show me the largest files"`
73
+ 5. Finally: `"Organize my files — preview first"`
64
74
 
65
75
  ---
66
76
 
@@ -69,20 +79,22 @@ Add to `claude_desktop_config.json`:
69
79
  ### Core Functionality
70
80
 
71
81
  * **🤖 Auto-categorization** - Intelligently organizes files into 12+ categories
82
+ * **📅 Smart Scheduling** - Cron-based automatic organization with per-directory configuration
72
83
  * **🔍 Duplicate Detection** - Finds duplicate files using SHA-256 content hashing
73
84
  * **🏷️ Smart Metadata** - Extracts EXIF/ID3 tags for content-aware organization
74
85
  * **✏️ Batch Renaming** - Flexible renaming with patterns, regex, and case conversion
75
- * **🛡️ Smart Conflict Resolution** - Handles filename conflicts automatically (rename/skip/overwrite)
86
+ * **🛡️ Smart Conflict Resolution** - Handles filename conflicts (rename/skip/overwrite)
76
87
  * **👁️ Dry Run Mode** - Preview changes before executing
77
- * **👀 File Watching** - Schedule automatic organization with cron-based triggers
88
+ * **👀 File Watching** - Watch directories and auto-organize on schedule
89
+ * **⏱️ Age-Based Filtering** - Skip files newer than X minutes (prevents organizing in-progress downloads)
78
90
  * **📊 Comprehensive Scanning** - Detailed directory analysis with statistics
79
91
  * **📈 Space Analysis** - Quickly identify space-consuming files
80
92
  * **⏮️ Rollback Support** - Undo file organization operations
81
93
  * **⚛️ Safe Atomic Moves** - Uses `COPYFILE_EXCL` to prevent race conditions during file moves
82
94
  * **💾 Automatic Backups** - Safely backs up files before overwriting to `.file-organizer-backups`
83
- * **📝 Structured Logging** - JSON-formatted logs with configurable log levels (debug/info/warn/error)
84
- * **📜 Audit Trail** - Complete logging of all tool inputs, outputs, and execution status for transparency
85
- * **💻 Multi-Platform Support** - Native support for Windows, macOS, and Linux (Ubuntu, Debian, etc.)
95
+ * **📝 Structured Logging** - JSON-formatted logs with configurable log levels
96
+ * **📜 Audit Trail** - Complete logging of all operations for transparency
97
+ * **💻 Multi-Platform Support** - Native support for Windows, macOS, and Linux
86
98
 
87
99
  ### Security Features
88
100
 
@@ -111,24 +123,25 @@ This server implements a multi-layered security architecture designed to operate
111
123
  - **Race Condition Mitigation**: Uses atomic copy-then-delete strategy to prevent data loss if a file is modified during a move operation.
112
124
  - **Safe Overwrites**: When `conflict_strategy: 'overwrite'` is used, the existing file is moved to a timestamped backup folder before replacement.
113
125
 
114
- ### 🚀 Upcoming Features
126
+ ### 🚀 Features Overview
115
127
 
116
- ### ⚙️ Interactive Configuration
117
- The new TUI Setup Wizard makes configuration easy:
118
- `npx file-organizer-mcp --setup`
119
- - **📁 Folder Selection**: Interactively choose which folders to manage.
120
- - **⚡ Conflict Handling**: Choose between **Rename**, **Skip**, or **Overwrite** strategies.
121
- - **🤖 Claude Integration**: Automatically generates/updates your `claude_desktop_config.json`.
128
+ ### ⚙️ Interactive Setup Wizard
129
+ Run `npx file-organizer-mcp --setup` for guided configuration:
130
+ - **📁 Folder Selection** - Interactively choose folders to manage
131
+ - **⚡ Conflict Handling** - Set default rename/skip/overwrite strategy
132
+ - **📅 Schedule Setup** - Configure automatic organization schedules
133
+ - **🤖 Claude Integration** - Auto-generates `claude_desktop_config.json`
122
134
 
123
135
  ### What's New in v3.1.0
124
136
 
125
137
  **New Features:**
126
- * **🧙 Interactive Setup Wizard** - Run `npx file-organizer-mcp --setup` for a guided configuration experience.
127
- * **🎵 Smart Metadata** - Organize images by Year/Month and audio by Artist/Album automatically.
128
- * **👀 File Watching** - Schedule folders for automatic organization using cron expressions.
129
- * **🏷️ Batch Renaming** - Powerful bulk renaming with find/replace, regex, and numbering support.
130
- * **🛡️ Enhanced Security** - Improved symlink detection and path validation.
131
- * **🆓 Free Models** - Optimized default configuration to use free models.
138
+ * **🧙 Interactive Setup Wizard** - Run `npx file-organizer-mcp --setup` for guided configuration
139
+ * **📅 Smart Scheduling** - Cron-based watch mode with `file_organizer_watch_directory`
140
+ * **⏱️ Age Filtering** - Skip recently modified files during auto-organization
141
+ * **🎵 Smart Metadata** - Organize images by Year/Month and audio by Artist/Album
142
+ * **🏷️ Batch Renaming** - Bulk renaming with patterns, regex, and numbering
143
+ * **⚙️ Conflict Strategy** - Configurable default conflict resolution
144
+ * **🛡️ Enhanced Security** - Improved symlink detection and path validation
132
145
 
133
146
  See [CHANGELOG.md](CHANGELOG.md) for full details.
134
147
 
@@ -333,6 +346,64 @@ file_organizer_batch_rename({
333
346
 
334
347
  ---
335
348
 
349
+ ### Watch & Schedule Tools
350
+
351
+ #### `file_organizer_watch_directory`
352
+
353
+ Add a directory to the automatic organization watch list with cron-based scheduling.
354
+ Files will be automatically organized based on the schedule you set.
355
+
356
+ **Parameters:**
357
+ - `directory` (string, required) - Full path to the directory to watch
358
+ - `schedule` (string, required) - Cron expression (e.g., `"0 10 * * *"` for daily at 10am)
359
+ - `auto_organize` (boolean, optional) - Enable auto-organization (default: true)
360
+ - `min_file_age_minutes` (number, optional) - Only organize files older than X minutes
361
+ - `max_files_per_run` (number, optional) - Maximum files to process per run
362
+ - `response_format` ('json'|'markdown', optional) - Output format
363
+
364
+ **Cron Expression Examples:**
365
+ | Expression | Schedule |
366
+ |------------|----------|
367
+ | `0 10 * * *` | Daily at 10:00 AM |
368
+ | `*/30 * * * *` | Every 30 minutes |
369
+ | `0 */6 * * *` | Every 6 hours |
370
+ | `0 9 * * 1` | Every Monday at 9:00 AM |
371
+ | `0 0 * * 0` | Weekly on Sunday at midnight |
372
+
373
+ **Example:**
374
+ ```typescript
375
+ // Watch Downloads folder - organize daily at 9am, files must be 5+ minutes old
376
+ file_organizer_watch_directory({
377
+ directory: "/Users/john/Downloads",
378
+ schedule: "0 9 * * *",
379
+ min_file_age_minutes: 5,
380
+ max_files_per_run: 100
381
+ })
382
+ ```
383
+
384
+ ---
385
+
386
+ #### `file_organizer_unwatch_directory`
387
+
388
+ Remove a directory from the watch list.
389
+
390
+ **Parameters:**
391
+ - `directory` (string, required) - Full path to remove from watch list
392
+ - `response_format` ('json'|'markdown', optional) - Output format
393
+
394
+ ---
395
+
396
+ #### `file_organizer_list_watches`
397
+
398
+ List all directories currently being watched with their schedules.
399
+
400
+ **Parameters:**
401
+ - `response_format` ('json'|'markdown', optional) - Output format
402
+
403
+ **Returns:** List of watched directories with schedules and rules
404
+
405
+ ---
406
+
336
407
  ### Utility Tools
337
408
 
338
409
  #### `file_organizer_get_categories`
@@ -481,6 +552,36 @@ Result: Clear visibility into space usage with actionable insights
481
552
 
482
553
  ---
483
554
 
555
+ ### Workflow 5: Set Up Automatic Organization
556
+
557
+ ```
558
+ User: "Claude, automatically organize my Downloads folder every day at 9am"
559
+
560
+ Claude:
561
+ 1. Sets up watch directory →
562
+ file_organizer_watch_directory({
563
+ directory: "/Users/john/Downloads",
564
+ schedule: "0 9 * * *",
565
+ min_file_age_minutes: 5
566
+ })
567
+ 2. Confirms setup → "Downloads folder will be organized daily at 9:00 AM"
568
+ 3. Shows current watches → Lists all watched directories
569
+
570
+ User: "Also watch my Desktop folder every hour"
571
+
572
+ Claude:
573
+ 4. Adds second watch →
574
+ file_organizer_watch_directory({
575
+ directory: "/Users/john/Desktop",
576
+ schedule: "0 * * * *",
577
+ max_files_per_run: 50
578
+ })
579
+
580
+ Result: Automatic background organization with smart scheduling
581
+ ```
582
+
583
+ ---
584
+
484
585
  ## <a id="security-configuration"></a>Security Configuration 🔐
485
586
 
486
587
  ### Security Score: 10/10 🌟
@@ -510,7 +611,7 @@ To prevent accidents, the following are **always blocked**, even if added to con
510
611
 
511
612
  ### ⚙️ Custom Configuration
512
613
 
513
- You can allow access to additional folders by editing the user configuration file.
614
+ You can customize behavior by editing the user configuration file.
514
615
 
515
616
  **Config Location:**
516
617
  * **Windows:** `%APPDATA%\file-organizer-mcp\config.json`
@@ -526,17 +627,43 @@ You can allow access to additional folders by editing the user configuration fil
526
627
  "customAllowedDirectories": [
527
628
  "C:\\Users\\Name\\My Special Folder",
528
629
  "D:\\Backups"
529
- ],
530
- "settings": {
531
- "maxScanDepth": 10,
532
- "logAccess": true
533
- }
630
+ ]
534
631
  }
535
632
  ```
536
633
  > 💡 **Tip:** You can copy a folder path directly from your file explorer's address bar and paste it into `customAllowedDirectories`.
537
634
 
538
635
  3. Restart Claude Desktop.
539
636
 
637
+ ### Conflict Strategy
638
+
639
+ Set your preferred default conflict resolution strategy:
640
+
641
+ ```json
642
+ {
643
+ "conflictStrategy": "rename"
644
+ }
645
+ ```
646
+
647
+ Available strategies:
648
+ - `"rename"` (default) - Renames new file (e.g., `file (1).txt`)
649
+ - `"skip"` - Keeps existing file, skips new one
650
+ - `"overwrite"` - Replaces existing file (creates backup first)
651
+
652
+ ### Auto-Organize Schedule (Legacy)
653
+
654
+ Simple schedule configuration (for basic hourly/daily/weekly):
655
+
656
+ ```json
657
+ {
658
+ "autoOrganize": {
659
+ "enabled": true,
660
+ "schedule": "daily"
661
+ }
662
+ }
663
+ ```
664
+
665
+ For advanced cron-based scheduling, use the `file_organizer_watch_directory` tool.
666
+
540
667
  ### Security Defenses
541
668
 
542
669
  | Attack Type | Protection Mechanism | Status |
package/dist/config.js CHANGED
@@ -6,7 +6,7 @@ import os from 'os';
6
6
  import path from 'path';
7
7
  import fs from 'fs';
8
8
  export const CONFIG = {
9
- VERSION: '3.0.1',
9
+ VERSION: '3.1.2',
10
10
  // Security Settings
11
11
  security: {
12
12
  enablePathValidation: true,
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "file-organizer-mcp",
3
- "version": "3.1.0",
3
+ "version": "3.1.2",
4
4
  "description": "Intelligent file organization MCP server for Claude with security-hardened operations, auto-categorization, and duplicate detection",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "bin": {
8
8
  "file-organizer-mcp": "./dist/index.js",
9
9
  "file-organizer": "./dist/index.js",
10
- "file-organizer-setup": "./dist/tui/tui-index.js"
10
+ "file-organizer-setup": "./dist/tui/index.js"
11
11
  },
12
12
  "scripts": {
13
13
  "build": "tsc",
@@ -19,6 +19,7 @@
19
19
  "test:coverage": "node --experimental-vm-modules node_modules/jest/bin/jest.js --coverage",
20
20
  "test:security": "node dist/tests/test-security.js",
21
21
  "setup": "node dist/tui/index.js",
22
+ "postinstall": "node scripts/postinstall.js",
22
23
  "test:phase1": "node dist/tests/test-phase1.js",
23
24
  "lint": "eslint src/**/*.ts",
24
25
  "lint:fix": "eslint src/**/*.ts --fix",
@@ -83,6 +84,7 @@
83
84
  },
84
85
  "files": [
85
86
  "dist",
87
+ "scripts/postinstall.js",
86
88
  "README.md",
87
89
  "LICENSE",
88
90
  "CHANGELOG.md",
@@ -0,0 +1,38 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * Post-install script for file-organizer-mcp
5
+ * Shows a welcome message and setup instructions after npm install
6
+ */
7
+
8
+ import chalk from 'chalk';
9
+
10
+ // Skip message in CI/non-interactive environments
11
+ if (process.env.CI || process.env.NODE_ENV === 'test') {
12
+ process.exit(0);
13
+ }
14
+
15
+ console.log('');
16
+ console.log(chalk.cyan.bold('╔════════════════════════════════════════════════════════════╗'));
17
+ console.log(chalk.cyan.bold('║ ║'));
18
+ console.log(chalk.cyan.bold('║ 🗂️ File Organizer MCP Server ║'));
19
+ console.log(chalk.cyan.bold('║ ║'));
20
+ console.log(chalk.cyan.bold('╚════════════════════════════════════════════════════════════╝'));
21
+ console.log('');
22
+ console.log(chalk.white('Thanks for installing file-organizer-mcp!'));
23
+ console.log('');
24
+ console.log(chalk.yellow('📋 Next Steps:'));
25
+ console.log('');
26
+ console.log(chalk.white(' 1. Run the setup wizard to configure:'));
27
+ console.log(chalk.cyan(' npx file-organizer-mcp --setup'));
28
+ console.log('');
29
+ console.log(chalk.white(' 2. Or manually configure by editing:'));
30
+ console.log(chalk.gray(' Windows: %APPDATA%\\file-organizer-mcp\\config.json'));
31
+ console.log(chalk.gray(' macOS: ~/Library/Application Support/file-organizer-mcp/config.json'));
32
+ console.log(chalk.gray(' Linux: ~/.config/file-organizer-mcp/config.json'));
33
+ console.log('');
34
+ console.log(chalk.white(' 3. Add to Claude Desktop config:'));
35
+ console.log(chalk.gray(' https://github.com/kridaydave/File-Organizer-MCP#claude-desktop-configuration'));
36
+ console.log('');
37
+ console.log(chalk.green('✨ Happy organizing!'));
38
+ console.log('');