Local File Organizer
A file organization MCP server that safely categorizes and manages files in allowed directories by type, with search and analysis capabilities.
README
Local File Organizer
A Python-based file organization system that leverages the Model Context Protocol (MCP) to safely organize and manage files across directories.
Overview
This project implements a file organization system using the Model Context Protocol (MCP) framework to:
- Safely access user-specified directories through robust permission checking
- Automatically organize files by type into categorized directories
- Search for files across allowed directories
- Analyze directory contents and provide detailed file information
Key Features
- Directory Security: Only operates on explicitly allowed directories
- Smart Categorization: Organizes files by extension into categories:
- Documents (PDF, DOC, DOCX, TXT, RTF, MD, HTML, JSON, CSV, etc.)
- Images (JPG, PNG, GIF, SVG, WEBP, HEIC, etc.)
- Videos (MP4, MOV, AVI, MKV, etc.)
- Audio (MP3, WAV, OGG, FLAC, etc.)
- Archives (ZIP, RAR, 7Z, TAR, etc.)
- Code (PY, JS, HTML, CSS, Java, etc.)
- Applications (DMG, EXE, MSI, etc.)
- Others (uncategorized file types)
- Project Detection: Identifies project directories to avoid disrupting code repositories
- Recursive Processing: Can analyze and organize nested directory structures
- Resource-Efficient: Optimized for performance with large directory structures
- Detailed Analytics: Provides insights into file distribution by type
Installation
# 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
Usage
1. Configure 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 to allow the MCP server to access.
2. Enable the MCP Server
After configuring the .cursor/mcp.json file:
- Restart Cursor
- Open Cursor Settings (⚙️)
- Navigate to
MCP - You should see the
filesystemserver in the list of MCP servers- The server should appear with the name "filesystem" .
- Enable it by clicking the toggle switch next to the server name
3. Use File Organization Commands
Once the MCP server is enabled, you can use the file organization commands directly in Cursor's Agent:
# List all available categories
list_categories
# Analyze a directory without making changes
analyze_directory /path/to/directory
# Create category folders in a target directory
create_category_directories /path/to/target
# Organize files by type
organize_files /path/to/directory
# Search for files
search_files /path/to/directory "*.jpg"
Technical Implementation
The system uses:
- MCP Python SDK: For the core server implementation
- Filesystem MCP Server: For secure file operations
- Pathlib: For cross-platform path handling
- Type Annotations: For improved code quality and IDE support
Planned Features
The following features are planned for upcoming releases:
- File Write and Edit Functionality: Add capabilities to:
- Modify file contents directly
- Create new files with templates
- Batch rename files using patterns
- Edit file metadata
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
- Model Context Protocol (MCP) Team
- Cursor IDE for MCP integration
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.