Local File Organizer MCP server

Automatically organizes files by categorizing them based on extensions while preserving project structures for efficient directory management and backup preparation.
Back to servers
Setup instructions
Provider
Diganto Deb
Release date
Mar 21, 2025
Language
Python
Stats
1 star

This MCP server provides a Python-based file organization system that leverages the Model Context Protocol to safely organize and manage files across directories. It categorizes files by type and ensures operations only occur within explicitly permitted locations.

Installation

To install the Local File Organizer:

# Clone the repository
git clone https://github.com/diganto-deb/local_file_organizer.git
cd local_file_organizer

# Install requirements
pip install -r requirements.txt

Configuration

Setting Up Allowed Directories

Create or modify the .cursor/mcp.json file in your project directory:

{
  "mcpServers": {
    "filesystem": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-filesystem",
        "/path/to/organize/dir1",
        "/path/to/organize/dir2"
      ]
    }
  }
}

Replace the paths with the directories you want the MCP server to access.

Enabling the MCP Server

After configuration:

  1. Restart Cursor
  2. Open Cursor Settings (⚙️)
  3. Navigate to MCP
  4. Look for the filesystem server in the list
  5. Enable it by clicking the toggle switch

Using the File Organizer

Once enabled, you can use these commands in Cursor's Agent:

View Available Categories

list_categories

This will display all file categories the organizer can sort files into, including Documents, Images, Videos, Audio, Archives, Code, Applications, and Others.

Analyze Without Changes

To scan a directory without making any modifications:

analyze_directory /path/to/directory

This provides a breakdown of file types found in the directory.

Create Category Folders

Set up the organizational structure:

create_category_directories /path/to/target

This creates folders for each category (Documents, Images, etc.) in the target directory.

Organize Files

Sort files into their appropriate category folders:

organize_files /path/to/directory

This will move files into category-specific folders based on their extensions.

Search for Files

Find files matching specific patterns:

search_files /path/to/directory "*.jpg"

This searches for files matching the pattern within the specified directory.

Key Features

  • Security: Only operates on explicitly allowed directories
  • Smart Categorization: Organizes files into logical groups based on extension
  • Project Detection: Avoids disrupting code repositories
  • Recursive Processing: Handles nested directory structures
  • Detailed Analytics: Provides insights into file distribution

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "filesystem" '{"command":"npx","args":["-y","@modelcontextprotocol/server-filesystem","/path/to/organize/dir1","/path/to/organize/dir2"]}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "filesystem": {
            "command": "npx",
            "args": [
                "-y",
                "@modelcontextprotocol/server-filesystem",
                "/path/to/organize/dir1",
                "/path/to/organize/dir2"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "filesystem": {
            "command": "npx",
            "args": [
                "-y",
                "@modelcontextprotocol/server-filesystem",
                "/path/to/organize/dir1",
                "/path/to/organize/dir2"
            ]
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later