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.
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
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.
After configuration:
MCP
filesystem
server in the listOnce enabled, you can use these commands in Cursor's Agent:
list_categories
This will display all file categories the organizer can sort files into, including Documents, Images, Videos, Audio, Archives, Code, Applications, and Others.
To scan a directory without making any modifications:
analyze_directory /path/to/directory
This provides a breakdown of file types found in the directory.
Set up the organizational structure:
create_category_directories /path/to/target
This creates folders for each category (Documents, Images, etc.) in the target directory.
Sort files into their appropriate category folders:
organize_files /path/to/directory
This will move files into category-specific folders based on their extensions.
Find files matching specific patterns:
search_files /path/to/directory "*.jpg"
This searches for files matching the pattern within the specified directory.
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.
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.
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"
]
}
}
}
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.
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.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.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